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"
47 using namespace v8::internal;
49 class StringResource8 : public v8::String::ExternalOneByteStringResource {
61 std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
62 const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
63 v8::Local<v8::Context> context) {
66 v8::Local<v8::String> source_handle;
69 source_handle = v8::String::NewFromUtf8(
71 v8::NewStringType::kNormal).ToLocalChecked();
76 v8::String::NewFromTwoByte(
78 v8::NewStringType::kNormal, length / 2).ToLocalChecked();
84 source_handle = v8::String::NewExternalOneByte(isolate, string_resource)
89 v8::base::TimeDelta parse_time1, parse_time2;
92 v8::Utils::OpenHandle(*source_handle));
99 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
100 v8::base::ElapsedTimer timer;
108 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
116 info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache);
117 v8::base::ElapsedTimer timer;
125 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
133 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
134 v8::V8::InitializeICUDefaultLocation(argv[0]);
135 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
136 v8::V8::InitializePlatform(platform);
137 v8::V8::Initialize();
138 v8::V8::InitializeExternalStartupData(argv[0]);
160 v8::Isolate::CreateParams create_params;
162 v8::ArrayBuffer::Allocator::NewDefaultAllocator();
163 v8::Isolate* isolate = v8::Isolate::New(create_params);
165 v8::Isolate::Scope isolate_scope(isolate);
166 v8::HandleScope handle_scope(isolate);
167 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
168 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
171 v8::Context::Scope scope(context);
175 std::pair<v8::base::TimeDelta, v8::base::TimeDelta> time =
188 v8::V8::Dispose();
189 v8::V8::ShutdownPlatform();