| Index: runtime/vm/dart.cc
|
| diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
|
| index 4d39b00acd22675aa26b1ad87826b9e0c66eab05..9f7c474e2ad13ff329605191731fcb71fe728334 100644
|
| --- a/runtime/vm/dart.cc
|
| +++ b/runtime/vm/dart.cc
|
| @@ -70,6 +70,7 @@ class ReadOnlyHandles {
|
|
|
| private:
|
| VMHandles handles_;
|
| + LocalHandles api_handles_;
|
|
|
| friend class Dart;
|
| DISALLOW_COPY_AND_ASSIGN(ReadOnlyHandles);
|
| @@ -178,10 +179,8 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
|
| vm_isolate_->heap()->Verify(kRequireMarked);
|
| #endif
|
| }
|
| - // There is a planned and known asymmetry here: We enter one scope for the VM
|
| - // isolate so that we can allocate the "persistent" scoped handles for the
|
| - // predefined API values (such as Dart_True, Dart_False and Dart_Null).
|
| - Dart_EnterScope();
|
| + // Allocate the "persistent" scoped handles for the predefined API
|
| + // values (such as Dart_True, Dart_False and Dart_Null).
|
| Api::InitHandles();
|
|
|
| Thread::ExitIsolate(); // Unregister the VM isolate from this thread.
|
| @@ -360,6 +359,13 @@ uword Dart::AllocateReadOnlyHandle() {
|
| }
|
|
|
|
|
| +LocalHandle* Dart::AllocateReadOnlyApiHandle() {
|
| + ASSERT(Isolate::Current() == Dart::vm_isolate());
|
| + ASSERT(predefined_handles_ != NULL);
|
| + return predefined_handles_->api_handles_.AllocateHandle();
|
| +}
|
| +
|
| +
|
| bool Dart::IsReadOnlyHandle(uword address) {
|
| ASSERT(predefined_handles_ != NULL);
|
| return predefined_handles_->handles_.IsValidScopedHandle(address);
|
|
|