Index: runtime/vm/dart_entry.cc |
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc |
index e8bc0ce58a6ecea497907fc65a98c404ebf228a6..ea55b49e9f7eeaa6d5ca9d714ebfddeb2cd9617f 100644 |
--- a/runtime/vm/dart_entry.cc |
+++ b/runtime/vm/dart_entry.cc |
@@ -136,12 +136,14 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments) { |
RawObject* DartEntry::InvokeClosure(const Array& arguments, |
const Array& arguments_descriptor) { |
- Instance& instance = Instance::Handle(); |
+ Thread* thread = Thread::Current(); |
+ Zone* zone = thread->zone(); |
+ Instance& instance = Instance::Handle(zone); |
instance ^= arguments.At(0); |
// Get the entrypoint corresponding to the closure function or to the call |
// method of the instance. This will result in a compilation of the function |
// if it is not already compiled. |
- Function& function = Function::Handle(); |
+ Function& function = Function::Handle(zone); |
if (instance.IsCallable(&function)) { |
// Only invoke the function if its arguments are compatible. |
const ArgumentsDescriptor args_desc(arguments_descriptor); |
@@ -160,12 +162,11 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments, |
// call method. If the arguments didn't match, go to noSuchMethod instead |
// of infinitely recursing on the getter. |
} else { |
- const String& getter_name = String::Handle(Symbols::New("get:call")); |
- Class& cls = Class::Handle(instance.clazz()); |
+ const String& getter_name = Symbols::GetCall(); |
+ Class& cls = Class::Handle(zone, instance.clazz()); |
while (!cls.IsNull()) { |
function ^= cls.LookupDynamicFunction(getter_name); |
if (!function.IsNull()) { |
- Thread* thread = Thread::Current(); |
Isolate* isolate = thread->isolate(); |
volatile uword c_stack_pos = Thread::GetCurrentStackPointer(); |
volatile uword c_stack_limit = OSThread::Current()->stack_base() - |
@@ -176,14 +177,14 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments, |
if (c_stack_pos < c_stack_limit) { |
const Instance& exception = |
- Instance::Handle(isolate->object_store()->stack_overflow()); |
- return UnhandledException::New(exception, Stacktrace::Handle()); |
+ Instance::Handle(zone, isolate->object_store()->stack_overflow()); |
+ return UnhandledException::New(exception, Stacktrace::Handle(zone)); |
} |
- const Array& getter_arguments = Array::Handle(Array::New(1)); |
+ const Array& getter_arguments = Array::Handle(zone, Array::New(1)); |
getter_arguments.SetAt(0, instance); |
const Object& getter_result = |
- Object::Handle(DartEntry::InvokeFunction(function, |
+ Object::Handle(zone, DartEntry::InvokeFunction(function, |
getter_arguments)); |
if (getter_result.IsError()) { |
return getter_result.raw(); |
@@ -194,8 +195,8 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments, |
// This otherwise unnecessary handle is used to prevent clang from |
// doing tail call elimination, which would make the stack overflow |
// check above ineffective. |
- Object& result = Object::Handle(InvokeClosure(arguments, |
- arguments_descriptor)); |
+ Object& result = Object::Handle(zone, |
+ InvokeClosure(arguments, arguments_descriptor)); |
return result.raw(); |
} |
cls = cls.SuperClass(); |