Lines Matching defs:isolate
5 #include "src/execution/isolate.h"
51 #include "src/execution/isolate-inl.h"
52 #include "src/execution/local-isolate.h"
70 #include "src/init/setup-isolate.h"
179 // an isolate instance. This is needed e.g. by Code::InstructionStart, which may
180 // not have access to an isolate but still needs to access the embedded blob.
181 // The variables are initialized by each isolate in Init(). Writes and reads are
670 Isolate* isolate, StackTraceFailureMessage::StackTraceMode mode, void* ptr1,
672 isolate_ = isolate;
686 isolate->PrintStack(&accumulator, Isolate::kPrintStackVerbose);
691 StackFrameIterator it(isolate);
705 CallSiteBuilder(Isolate* isolate, FrameSkipMode mode, int limit,
707 : isolate_(isolate),
717 elements_ = isolate->factory()->NewFixedArray(std::min(64, limit));
903 bool GetStackTraceLimit(Isolate* isolate, int* result) {
905 Handle<JSObject> error = isolate->error_function();
907 Handle<String> key = isolate->factory()->stackTraceLimit_string();
909 JSReceiver::GetDataProperty(isolate, error, key);
916 isolate->CountUsage(v8::Isolate::kErrorStackTraceLimit);
922 bool IsBuiltinFunction(Isolate* isolate, HeapObject object, Builtin builtin) {
925 return function.code() == isolate->builtins()->code(builtin);
928 void CaptureAsyncStackTrace(Isolate* isolate, Handle<JSPromise> promise,
937 PromiseReaction::cast(promise->reactions()), isolate);
942 if (IsBuiltinFunction(isolate, reaction->fulfill_handler(),
944 IsBuiltinFunction(isolate, reaction->fulfill_handler(),
946 IsBuiltinFunction(isolate, reaction->fulfill_handler(),
951 JSFunction::cast(reaction->fulfill_handler()).context(), isolate);
953 JSGeneratorObject::cast(context->extension()), isolate);
963 promise = handle(async_function_object->promise(), isolate);
967 if (async_generator_object->queue().IsUndefined(isolate)) return;
970 isolate);
972 isolate);
974 } else if (IsBuiltinFunction(isolate, reaction->fulfill_handler(),
977 isolate);
978 Handle<Context> context(function->context(), isolate);
980 isolate);
989 PromiseCapability::cast(context->get(index)), isolate);
991 promise = handle(JSPromise::cast(capability->promise()), isolate);
993 isolate, reaction->fulfill_handler(),
996 isolate);
997 Handle<Context> context(function->context(), isolate);
999 context->native_context().promise_all_settled(), isolate);
1008 PromiseCapability::cast(context->get(index)), isolate);
1010 promise = handle(JSPromise::cast(capability->promise()), isolate);
1011 } else if (IsBuiltinFunction(isolate, reaction->reject_handler(),
1014 isolate);
1015 Handle<Context> context(function->context(), isolate);
1017 isolate);
1025 PromiseCapability::cast(context->get(index)), isolate);
1027 promise = handle(JSPromise::cast(capability->promise()), isolate);
1028 } else if (IsBuiltinFunction(isolate, reaction->fulfill_handler(),
1031 isolate);
1032 Handle<Context> context(function->context(), isolate);
1035 isolate);
1041 reaction->promise_or_capability(), isolate);
1048 promise = handle(JSPromise::cast(capability->promise()), isolate);
1051 CHECK(promise_or_capability->IsUndefined(isolate));
1058 void CaptureAsyncStackTrace(Isolate* isolate, CallSiteBuilder* builder) {
1059 Handle<Object> current_microtask = isolate->factory()->current_microtask();
1065 if (IsBuiltinFunction(isolate, promise_reaction_job_task->handler(),
1067 IsBuiltinFunction(isolate, promise_reaction_job_task->handler(),
1069 IsBuiltinFunction(isolate, promise_reaction_job_task->handler(),
1071 IsBuiltinFunction(isolate, promise_reaction_job_task->handler(),
1073 IsBuiltinFunction(isolate, promise_reaction_job_task->handler(),
1079 isolate);
1081 JSGeneratorObject::cast(context->extension()), isolate);
1086 Handle<JSPromise> promise(async_function_object->promise(), isolate);
1087 CaptureAsyncStackTrace(isolate, promise, builder);
1091 Handle<Object> queue(async_generator_object->queue(), isolate);
1092 if (!queue->IsUndefined(isolate)) {
1096 JSPromise::cast(async_generator_request->promise()), isolate);
1097 CaptureAsyncStackTrace(isolate, promise, builder);
1107 promise_reaction_job_task->promise_or_capability(), isolate);
1111 CaptureAsyncStackTrace(isolate, promise, builder);
1118 void VisitStack(Isolate* isolate, Visitor* visitor,
1120 DisallowJavascriptExecution no_js(isolate);
1121 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1144 isolate->context())) {
1158 Handle<FixedArray> CaptureSimpleStackTrace(Isolate* isolate, int limit,
1168 CallSiteBuilder builder(isolate, mode, limit, caller);
1169 VisitStack(isolate, &builder);
1175 CaptureAsyncStackTrace(isolate, &builder);
1326 StackFrameBuilder(Isolate* isolate, int limit)
1327 : isolate_(isolate),
1371 explicit CurrentScriptNameStackVisitor(Isolate* isolate)
1372 : isolate_(isolate) {}
1431 static void PrintFrames(Isolate* isolate, StringStream* accumulator,
1433 StackFrameIterator it(isolate);
1904 // back to isolate->set_pending_exception(...).
2648 bool PromiseIsRejectHandler(Isolate* isolate, Handle<JSReceiver> handler) {
2656 Handle<Symbol> key = isolate->factory()->promise_forwarding_handler_symbol();
2658 JSReceiver::GetDataProperty(isolate, handler, key);
2659 return forwarding_handler->IsUndefined(isolate);
2662 bool PromiseHasUserDefinedRejectHandlerInternal(Isolate* isolate,
2664 Handle<Object> current(promise->reactions(), isolate);
2668 isolate);
2669 if (!promise_or_capability->IsUndefined(isolate)) {
2673 isolate);
2676 if (!reaction->reject_handler().IsUndefined(isolate)) {
2678 JSReceiver::cast(reaction->reject_handler()), isolate);
2679 if (PromiseIsRejectHandler(isolate, reject_handler)) return true;
2681 if (isolate->PromiseHasUserDefinedRejectHandler(promise)) return true;
2683 current = handle(reaction->next(), isolate);
3008 explicit TracingAccountingAllocator(Isolate* isolate) : isolate_(isolate) {}
3082 // Note: Neither isolate nor zones are locked, so be careful with accesses
3086 << "\"isolate\": \"" << reinterpret_cast<void*>(isolate_) << "\", "
3151 Isolate* isolate = Isolate::Allocate(true);
3152 v8::Isolate::Initialize(reinterpret_cast<v8::Isolate*>(isolate), params);
3153 return isolate;
3166 Isolate* isolate =
3169 DCHECK(IsAligned(isolate->isolate_root(), kPtrComprCageBaseAlignment));
3170 DCHECK_EQ(isolate->isolate_root(), isolate->cage_base());
3177 return isolate;
3181 void Isolate::Delete(Isolate* isolate) {
3182 DCHECK_NOT_NULL(isolate);
3185 // Temporarily set this isolate as current so that various parts of
3186 // the isolate can access it in their destructors without having a
3189 PerIsolateThreadData* saved_data = isolate->CurrentPerIsolateThreadData();
3192 base::Thread::GetThreadLocal(isolate->isolate_key_));
3193 SetIsolateThreadLocals(isolate, nullptr);
3194 isolate->set_thread_id(ThreadId::Current());
3196 isolate->Deinit();
3205 std::move(isolate->isolate_allocator_);
3206 isolate->~Isolate();
3210 // Restore the previous current isolate.
3257 // ThreadManager is initialized early to support locking an isolate
3342 heap()->isolate()->logger()->is_listening_to_code_events() ||
3427 // At this point there are no more background threads left in this isolate.
3431 // This isolate might have to park for a shared GC initiated by another
3432 // client isolate before it can actually detach from the shared isolate.
3503 void Isolate::SetIsolateThreadLocals(Isolate* isolate,
3505 base::Thread::SetThreadLocal(isolate_key_, isolate);
3655 void CreateOffHeapTrampolines(Isolate* isolate) {
3656 DCHECK_NOT_NULL(isolate->embedded_blob_code());
3657 DCHECK_NE(0, isolate->embedded_blob_code_size());
3658 DCHECK_NOT_NULL(isolate->embedded_blob_data());
3659 DCHECK_NE(0, isolate->embedded_blob_data_size());
3661 HandleScope scope(isolate);
3662 Builtins* builtins = isolate->builtins();
3664 EmbeddedData d = EmbeddedData::FromBlob(isolate);
3671 Handle<Code> trampoline = isolate->factory()->NewOffHeapTrampolineFor(
3672 FromCodeT(builtins->code_handle(builtin), isolate), instruction_start);
3681 bool IsolateIsCompatibleWithEmbeddedBlob(Isolate* isolate) {
3682 EmbeddedData d = EmbeddedData::FromBlob(isolate);
3683 return (d.IsolateHash() == isolate->HashIsolateForEmbeddedBlob());
3862 explicit BigIntPlatform(Isolate* isolate) : isolate_(isolate) {}
3971 // isolate. Otherwise a global safepoint would find an isolate without
3985 // Only refer to shared string table after attaching to the shared isolate.
4202 PrintF("[Initializing isolate from scratch took %0.3f ms]\n", ms);
4241 // Same thread re-enters the isolate, no need to re-init anything.
4257 // In case it's the first time some thread enters the isolate.
4281 // Reinit the current thread for the isolate it was running before this one.
4501 // be fixed once the default isolate cleanup is done.
4609 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this);
4610 if (perform_checkpoint) microtask_queue->PerformCheckpoint(isolate);
4614 v8::Isolate::SuppressMicrotaskExecutionScope suppress(isolate);
4642 MaybeHandle<JSPromise> NewRejectedPromise(Isolate* isolate,
4647 isolate, resolver, v8::Promise::Resolver::New(api_context),
4651 isolate, resolver->Reject(api_context, v8::Utils::ToLocal(exception)),
5023 // so pop the outer promise from the isolate's promise stack.
5182 std::string Isolate::GetTurboCfgFileName(Isolate* isolate) {
5186 if (isolate != nullptr) {
5187 os << isolate->id();
5344 std::string GetStringFromLocales(Isolate* isolate, Handle<Object> locales) {
5345 if (locales->IsUndefined(isolate)) return "";
5349 bool StringEqualsLocales(Isolate* isolate, const std::string& str,
5351 if (locales->IsUndefined(isolate)) return str == "";
5422 SaveContext::SaveContext(Isolate* isolate) : isolate_(isolate) {
5423 if (!isolate->context().is_null()) {
5424 context_ = Handle<Context>(isolate->context(), isolate);
5427 c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top());
5438 SaveAndSwitchContext::SaveAndSwitchContext(Isolate* isolate,
5440 : SaveContext(isolate) {
5441 isolate->set_context(new_context);
5445 AssertNoContextChange::AssertNoContextChange(Isolate* isolate)
5446 : isolate_(isolate), context_(isolate->context(), isolate) {}
5568 Isolate* isolate = reinterpret_cast<Isolate*>(data.GetIsolate());
5570 isolate->recorder_context_id_map_.erase(context_id);