diff options
Diffstat (limited to 'deps/v8/src/isolate-inl.h')
-rw-r--r-- | deps/v8/src/isolate-inl.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/deps/v8/src/isolate-inl.h b/deps/v8/src/isolate-inl.h index 7a43f1367fc..017032c3201 100644 --- a/deps/v8/src/isolate-inl.h +++ b/deps/v8/src/isolate-inl.h @@ -11,17 +11,28 @@ namespace v8 { namespace internal { +bool Isolate::FromWritableHeapObject(HeapObject* obj, Isolate** isolate) { + i::MemoryChunk* chunk = i::MemoryChunk::FromHeapObject(obj); + if (chunk->owner()->identity() == i::RO_SPACE) { + *isolate = nullptr; + return false; + } + *isolate = chunk->heap()->isolate(); + return true; +} void Isolate::set_context(Context* context) { DCHECK(context == nullptr || context->IsContext()); thread_local_top_.context_ = context; } -Handle<Context> Isolate::native_context() { +Handle<NativeContext> Isolate::native_context() { return handle(context()->native_context(), this); } -Context* Isolate::raw_native_context() { return context()->native_context(); } +NativeContext* Isolate::raw_native_context() { + return context()->native_context(); +} Object* Isolate::pending_exception() { DCHECK(has_pending_exception()); |