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

Unified Diff: runtime/vm/dart_entry.cc

Issue 1393373003: Remove isolate argument from handle allocation: Part I (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanups 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/constant_propagator.cc ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 82055bb7b89f2531f6e63add2ff149d3fee6b3e5..c0a0ef9afb20ba3d6e8639dc3a3753d72a2c7614 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -229,9 +229,10 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver,
if (function.IsNull()) {
ASSERT(!FLAG_lazy_dispatchers);
// If noSuchMethod(invocation) is not found, call Object::noSuchMethod.
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
function ^= Resolver::ResolveDynamicForReceiverClass(
- Class::Handle(isolate, isolate->object_store()->object_class()),
+ Class::Handle(thread->zone(),
+ thread->isolate()->object_store()->object_class()),
Symbols::NoSuchMethod(),
args_desc);
}
@@ -483,10 +484,9 @@ RawObject* DartLibraryCalls::Equals(const Instance& left,
RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) {
- Isolate* isolate = Isolate::Current();
- Function& function =
- Function::Handle(isolate,
- isolate->object_store()->lookup_port_handler());
+ Thread* thread = Thread::Current();
+ Function& function = Function::Handle(thread->zone(),
+ thread->isolate()->object_store()->lookup_port_handler());
const int kNumArguments = 1;
if (function.IsNull()) {
Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
@@ -501,7 +501,7 @@ RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) {
kNumArguments,
Object::empty_array());
ASSERT(!function.IsNull());
- isolate->object_store()->set_lookup_port_handler(function);
+ thread->isolate()->object_store()->set_lookup_port_handler(function);
}
const Array& args = Array::Handle(Array::New(kNumArguments));
args.SetAt(0, Integer::Handle(Integer::New(port_id)));
@@ -513,16 +513,18 @@ RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) {
RawObject* DartLibraryCalls::HandleMessage(const Object& handler,
const Instance& message) {
- Isolate* isolate = Isolate::Current();
- Function& function = Function::Handle(isolate,
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Isolate* isolate = thread->isolate();
+ Function& function = Function::Handle(zone,
isolate->object_store()->handle_message_function());
const int kNumArguments = 2;
if (function.IsNull()) {
- Library& isolate_lib = Library::Handle(isolate, Library::IsolateLibrary());
+ Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
ASSERT(!isolate_lib.IsNull());
- const String& class_name = String::Handle(isolate,
+ const String& class_name = String::Handle(zone,
isolate_lib.PrivateName(Symbols::_RawReceivePortImpl()));
- const String& function_name = String::Handle(isolate,
+ const String& function_name = String::Handle(zone,
isolate_lib.PrivateName(Symbols::_handleMessage()));
function = Resolver::ResolveStatic(isolate_lib,
class_name,
@@ -532,7 +534,7 @@ RawObject* DartLibraryCalls::HandleMessage(const Object& handler,
ASSERT(!function.IsNull());
isolate->object_store()->set_handle_message_function(function);
}
- const Array& args = Array::Handle(isolate, Array::New(kNumArguments));
+ const Array& args = Array::Handle(zone, Array::New(kNumArguments));
args.SetAt(0, handler);
args.SetAt(1, message);
if (isolate->debugger()->IsStepping()) {
@@ -541,7 +543,7 @@ RawObject* DartLibraryCalls::HandleMessage(const Object& handler,
// at the first location the user is interested in.
isolate->debugger()->SetSingleStep();
}
- const Object& result = Object::Handle(isolate,
+ const Object& result = Object::Handle(zone,
DartEntry::InvokeFunction(function, args));
ASSERT(result.IsNull() || result.IsError());
return result.raw();
@@ -549,13 +551,13 @@ RawObject* DartLibraryCalls::HandleMessage(const Object& handler,
RawObject* DartLibraryCalls::DrainMicrotaskQueue() {
- Isolate* isolate = Isolate::Current();
- Library& isolate_lib = Library::Handle(isolate, Library::IsolateLibrary());
+ Zone* zone = Thread::Current()->zone();
+ Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
ASSERT(!isolate_lib.IsNull());
- Function& function = Function::Handle(isolate,
+ Function& function = Function::Handle(zone,
isolate_lib.LookupFunctionAllowPrivate(
Symbols::_runPendingImmediateCallback()));
- const Object& result = Object::Handle(isolate,
+ const Object& result = Object::Handle(zone,
DartEntry::InvokeFunction(function, Object::empty_array()));
ASSERT(result.IsNull() || result.IsError());
return result.raw();
« no previous file with comments | « runtime/vm/constant_propagator.cc ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698