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

Unified Diff: runtime/vm/dart_entry.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 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/dart_api_impl_test.cc ('k') | runtime/vm/dart_entry_test.cc » ('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 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();
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/dart_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698