Home | History | Annotate | Download | only in tools

Lines Matching refs:V8

1 // Copyright 2014 the V8 project authors. All rights reserved.
34 #include "src/v8.h"
48 using namespace v8::internal;
50 class StringResource8 : public v8::String::ExternalOneByteStringResource {
62 std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
63 const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
64 v8::Local<v8::Context> context) {
67 v8::Local<v8::String> source_handle;
70 source_handle = v8::String::NewFromUtf8(
72 v8::NewStringType::kNormal).ToLocalChecked();
77 v8::String::NewFromTwoByte(
79 v8::NewStringType::kNormal, length / 2).ToLocalChecked();
85 source_handle = v8::String::NewExternalOneByte(isolate, string_resource)
90 v8::base::TimeDelta parse_time1, parse_time2;
93 v8::Utils::OpenHandle(*source_handle));
99 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
100 v8::base::ElapsedTimer timer;
106 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
113 info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache);
114 v8::base::ElapsedTimer timer;
120 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
128 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
129 v8::V8::InitializeICUDefaultLocation(argv[0]);
130 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
131 v8::V8::InitializePlatform(platform);
132 v8::V8::Initialize();
133 v8::V8::InitializeExternalStartupData(argv[0]);
155 v8::Isolate::CreateParams create_params;
157 v8::ArrayBuffer::Allocator::NewDefaultAllocator();
158 v8::Isolate* isolate = v8::Isolate::New(create_params);
160 v8::Isolate::Scope isolate_scope(isolate);
161 v8::HandleScope handle_scope(isolate);
162 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
163 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
166 v8::Context::Scope scope(context);
170 std::pair<v8::base::TimeDelta, v8::base::TimeDelta> time =
183 v8::V8::Dispose();
184 v8::V8::ShutdownPlatform();