Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: runtime/vm/object_store.cc

Issue 1389353004: Remove isolate argument from handle allocation: Part II (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_store.cc
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 220b13037f45b68359138bce6e6cf96bb8201333..e70c76ada45ec6e7998aaf4d878f9fa15fe6b127 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -116,7 +116,9 @@ void ObjectStore::Init(Isolate* isolate) {
bool ObjectStore::PreallocateObjects() {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ Zone* zone = thread->zone();
ASSERT(isolate != NULL && isolate->object_store() == this);
if (this->stack_overflow() != Instance::null()) {
ASSERT(this->out_of_memory() != Instance::null());
@@ -160,14 +162,14 @@ bool ObjectStore::PreallocateObjects() {
// pre-allocated OutOfMemoryError.
const UnhandledException& unhandled_exception = UnhandledException::Handle(
UnhandledException::New(Instance::Cast(result),
- Stacktrace::Handle(isolate)));
+ Stacktrace::Handle(zone)));
set_preallocated_unhandled_exception(unhandled_exception);
- const Array& code_array = Array::Handle(isolate,
+ const Array& code_array = Array::Handle(zone,
Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
- const Array& pc_offset_array = Array::Handle(isolate,
+ const Array& pc_offset_array = Array::Handle(zone,
Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
- const Stacktrace& stack_trace = Stacktrace::Handle(isolate,
+ const Stacktrace& stack_trace = Stacktrace::Handle(zone,
Stacktrace::New(code_array, pc_offset_array));
// Expansion of inlined functions requires additional memory at run time,
// avoid it.
@@ -179,12 +181,14 @@ bool ObjectStore::PreallocateObjects() {
void ObjectStore::InitKnownObjects() {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL && isolate->object_store() == this);
const Library& async_lib = Library::Handle(async_library());
ASSERT(!async_lib.IsNull());
- Class& cls = Class::Handle(isolate);
+ Class& cls = Class::Handle(zone);
cls = async_lib.LookupClass(Symbols::Future());
ASSERT(!cls.IsNull());
set_future_class(cls);
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698