Lines Matching refs:v8
70 typedef v8::internal::EnumSet<CcTestExtensionIds> CcTestExtensionFlags;
92 static v8::Isolate* isolate() { in EXTENSION_LIST()
94 v8::base::NoBarrier_Store(&isolate_used_, 1); in EXTENSION_LIST()
111 static v8::base::RandomNumberGenerator* random_number_generator() { in EXTENSION_LIST()
115 static v8::Local<v8::Object> global() { in EXTENSION_LIST()
119 static v8::ArrayBuffer::Allocator* array_buffer_allocator() { in EXTENSION_LIST()
124 v8::ArrayBuffer::Allocator* allocator) { in EXTENSION_LIST()
131 CHECK(!v8::base::NoBarrier_Load(&isolate_used_)); in EXTENSION_LIST()
134 v8::HandleScope handle_scope(CcTest::isolate()); in EXTENSION_LIST()
135 v8::Context::New(CcTest::isolate())->Enter(); in EXTENSION_LIST()
143 static v8::Local<v8::Context> NewContext( in EXTENSION_LIST()
145 v8::Isolate* isolate = CcTest::isolate()); in EXTENSION_LIST()
160 static v8::ArrayBuffer::Allocator* allocator_; in EXTENSION_LIST()
161 static v8::Isolate* isolate_; in EXTENSION_LIST()
163 static v8::base::Atomic32 isolate_used_; in EXTENSION_LIST()
176 class ApiTestFuzzer: public v8::base::Thread {
210 v8::base::Semaphore gate_;
214 static v8::base::Semaphore all_tests_done_;
258 LocalContext(v8::Isolate* isolate, v8::ExtensionConfiguration* extensions = 0,
259 v8::Local<v8::ObjectTemplate> global_template =
260 v8::Local<v8::ObjectTemplate>(),
261 v8::Local<v8::Value> global_object = v8::Local<v8::Value>()) {
265 LocalContext(v8::ExtensionConfiguration* extensions = 0,
266 v8::Local<v8::ObjectTemplate> global_template =
267 v8::Local<v8::ObjectTemplate>(),
268 v8::Local<v8::Value> global_object = v8::Local<v8::Value>()) {
273 v8::HandleScope scope(isolate_); in ~LocalContext()
274 v8::Local<v8::Context>::New(isolate_, context_)->Exit(); in ~LocalContext()
278 v8::Context* operator->() {
279 return *reinterpret_cast<v8::Context**>(&context_);
281 v8::Context* operator*() { return operator->(); }
284 v8::Local<v8::Context> local() { in local()
285 return v8::Local<v8::Context>::New(isolate_, context_); in local()
289 void Initialize(v8::Isolate* isolate, v8::ExtensionConfiguration* extensions, in Initialize()
290 v8::Local<v8::ObjectTemplate> global_template, in Initialize()
291 v8::Local<v8::Value> global_object) { in Initialize()
292 v8::HandleScope scope(isolate); in Initialize()
293 v8::Local<v8::Context> context = v8::Context::New(isolate, in Initialize()
303 v8::Persistent<v8::Context> context_;
304 v8::Isolate* isolate_;
316 static inline v8::Local<v8::Value> v8_num(double x) { in v8_num()
317 return v8::Number::New(v8::Isolate::GetCurrent(), x); in v8_num()
321 static inline v8::Local<v8::String> v8_str(const char* x) { in v8_str()
322 return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), x, in v8_str()
323 v8::NewStringType::kNormal) in v8_str()
328 static inline v8::Local<v8::String> v8_str(v8::Isolate* isolate, in v8_str()
330 return v8::String::NewFromUtf8(isolate, x, v8::NewStringType::kNormal) in v8_str()
335 static inline v8::Local<v8::Symbol> v8_symbol(const char* name) { in v8_symbol()
336 return v8::Symbol::New(v8::Isolate::GetCurrent(), v8_str(name)); in v8_symbol()
340 static inline v8::Local<v8::Script> v8_compile(v8::Local<v8::String> x) { in v8_compile()
341 v8::Local<v8::Script> result; in v8_compile()
342 if (v8::Script::Compile(v8::Isolate::GetCurrent()->GetCurrentContext(), x) in v8_compile()
346 return v8::Local<v8::Script>(); in v8_compile()
350 static inline v8::Local<v8::Script> v8_compile(const char* x) { in v8_compile()
355 static inline int32_t v8_run_int32value(v8::Local<v8::Script> script) { in v8_run_int32value()
356 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in v8_run_int32value()
361 static inline v8::Local<v8::Script> CompileWithOrigin( in CompileWithOrigin()
362 v8::Local<v8::String> source, v8::Local<v8::String> origin_url) { in CompileWithOrigin()
363 v8::ScriptOrigin origin(origin_url); in CompileWithOrigin()
364 v8::ScriptCompiler::Source script_source(source, origin); in CompileWithOrigin()
365 return v8::ScriptCompiler::Compile( in CompileWithOrigin()
366 v8::Isolate::GetCurrent()->GetCurrentContext(), &script_source) in CompileWithOrigin()
371 static inline v8::Local<v8::Script> CompileWithOrigin( in CompileWithOrigin()
372 v8::Local<v8::String> source, const char* origin_url) { in CompileWithOrigin()
377 static inline v8::Local<v8::Script> CompileWithOrigin(const char* source, in CompileWithOrigin()
384 static inline v8::MaybeLocal<v8::Value> CompileRun( in CompileRun()
385 v8::Local<v8::Context> context, const char* source) { in CompileRun()
386 return v8::Script::Compile(context, v8_str(source)) in CompileRun()
392 static inline v8::Local<v8::Value> CompileRunChecked(v8::Isolate* isolate, in CompileRunChecked()
394 v8::Local<v8::String> source_string = in CompileRunChecked()
395 v8::String::NewFromUtf8(isolate, source, v8::NewStringType::kNormal) in CompileRunChecked()
397 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in CompileRunChecked()
398 v8::Local<v8::Script> script = in CompileRunChecked()
399 v8::Script::Compile(context, source_string).ToLocalChecked(); in CompileRunChecked()
404 static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) { in CompileRun()
405 v8::Local<v8::Value> result; in CompileRun()
407 ->Run(v8::Isolate::GetCurrent()->GetCurrentContext()) in CompileRun()
411 return v8::Local<v8::Value>(); in CompileRun()
416 static inline v8::Local<v8::Value> CompileRun(const char* source) { in CompileRun()
421 static inline v8::Local<v8::Value> CompileRun( in CompileRun()
422 v8::Local<v8::Context> context, v8::ScriptCompiler::Source* script_source, in CompileRun()
423 v8::ScriptCompiler::CompileOptions options) { in CompileRun()
424 v8::Local<v8::Value> result; in CompileRun()
425 if (v8::ScriptCompiler::Compile(context, script_source, options) in CompileRun()
431 return v8::Local<v8::Value>(); in CompileRun()
435 static inline v8::Local<v8::Value> ParserCacheCompileRun(const char* source) { in ParserCacheCompileRun()
438 v8::Isolate* isolate = v8::Isolate::GetCurrent(); in ParserCacheCompileRun()
439 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in ParserCacheCompileRun()
440 v8::ScriptCompiler::Source script_source(v8_str(source)); in ParserCacheCompileRun()
441 v8::ScriptCompiler::Compile(context, &script_source, in ParserCacheCompileRun()
442 v8::ScriptCompiler::kProduceParserCache) in ParserCacheCompileRun()
446 v8::ScriptCompiler::CompileOptions options = in ParserCacheCompileRun()
447 script_source.GetCachedData() ? v8::ScriptCompiler::kConsumeParserCache in ParserCacheCompileRun()
448 : v8::ScriptCompiler::kNoCompileOptions; in ParserCacheCompileRun()
455 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source, in CompileRunWithOrigin()
459 v8::Isolate* isolate = v8::Isolate::GetCurrent(); in CompileRunWithOrigin()
460 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in CompileRunWithOrigin()
461 v8::ScriptOrigin origin(v8_str(origin_url), in CompileRunWithOrigin()
462 v8::Integer::New(isolate, line_number), in CompileRunWithOrigin()
463 v8::Integer::New(isolate, column_number)); in CompileRunWithOrigin()
464 v8::ScriptCompiler::Source script_source(v8_str(source), origin); in CompileRunWithOrigin()
466 v8::ScriptCompiler::CompileOptions()); in CompileRunWithOrigin()
470 static inline v8::Local<v8::Value> CompileRunWithOrigin( in CompileRunWithOrigin()
471 v8::Local<v8::String> source, const char* origin_url) { in CompileRunWithOrigin()
472 v8::Isolate* isolate = v8::Isolate::GetCurrent(); in CompileRunWithOrigin()
473 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in CompileRunWithOrigin()
474 v8::ScriptCompiler::Source script_source( in CompileRunWithOrigin()
475 source, v8::ScriptOrigin(v8_str(origin_url))); in CompileRunWithOrigin()
477 v8::ScriptCompiler::CompileOptions()); in CompileRunWithOrigin()
481 static inline v8::Local<v8::Value> CompileRunWithOrigin( in CompileRunWithOrigin()
489 v8::Local<v8::Value> result = CompileRun(code); in ExpectString()
491 v8::String::Utf8Value utf8(result); in ExpectString()
497 v8::Local<v8::Value> result = CompileRun(code); in ExpectInt32()
500 result->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext()) in ExpectInt32()
506 v8::Local<v8::Value> result = CompileRun(code); in ExpectBoolean()
509 result->BooleanValue(v8::Isolate::GetCurrent()->GetCurrentContext()) in ExpectBoolean()
525 v8::Local<v8::Value> expected) { in ExpectObject()
526 v8::Local<v8::Value> result = CompileRun(code); in ExpectObject()
532 v8::Local<v8::Value> result = CompileRun(code); in ExpectUndefined()
538 v8::Local<v8::Value> result = CompileRun(code); in ExpectNull()
551 const v8::Debug::EventDetails& event_details) {} in DummyDebugEventListener()
554 static inline void EnableDebugger(v8::Isolate* isolate) { in EnableDebugger()
555 v8::Debug::SetDebugEventListener(isolate, &DummyDebugEventListener); in EnableDebugger()
559 static inline void DisableDebugger(v8::Isolate* isolate) { in DisableDebugger()
560 v8::Debug::SetDebugEventListener(isolate, nullptr); in DisableDebugger()
564 static inline void EmptyMessageQueues(v8::Isolate* isolate) { in EmptyMessageQueues()
565 while (v8::platform::PumpMessageLoop(v8::internal::V8::GetCurrentPlatform(), in EmptyMessageQueues()
594 v8::base::AccountingAllocator allocator_;