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

Unified Diff: runtime/vm/dart_entry.cc

Issue 11968022: Lookup functions by name that contains the private key, except for dart_api which allows ignoring t… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
Index: runtime/vm/dart_entry.cc
===================================================================
--- runtime/vm/dart_entry.cc (revision 17169)
+++ runtime/vm/dart_entry.cc (working copy)
@@ -151,9 +151,11 @@
Class& invocation_mirror_class = Class::Handle(
core_lib.LookupClassAllowPrivate(Symbols::InvocationMirror()));
Ivan Posva 2013/01/17 00:25:14 Why are we allowing private here?
srdjan 2013/01/17 00:31:11 Changed to use private key.
ASSERT(!invocation_mirror_class.IsNull());
+ const String& function_name =
+ String::Handle(core_lib.PrivateName(Symbols::AllocateInvocationMirror()));
const Function& allocation_function = Function::Handle(
Resolver::ResolveStaticByName(invocation_mirror_class,
- Symbols::AllocateInvocationMirror(),
+ function_name,
Resolver::kIsQualified));
ASSERT(!allocation_function.IsNull());
const int kNumAllocationArgs = 3;
@@ -401,9 +403,11 @@
ASSERT(!isolate_lib.IsNull());
const String& class_name =
String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl()));
+ const String& function_name =
+ String::Handle(isolate_lib.PrivateName(Symbols::_lookupReceivePort()));
function = Resolver::ResolveStatic(isolate_lib,
class_name,
- Symbols::_lookupReceivePort(),
+ function_name,
kNumArguments,
Object::empty_array(),
Resolver::kIsQualified);
@@ -430,9 +434,11 @@
ASSERT(!isolate_lib.IsNull());
const String& class_name =
String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl()));
+ const String& function_name =
+ String::Handle(isolate_lib.PrivateName(Symbols::_handleMessage()));
function = Resolver::ResolveStatic(isolate_lib,
class_name,
- Symbols::_handleMessage(),
+ function_name,
kNumArguments,
Object::empty_array(),
Resolver::kIsQualified);
@@ -455,10 +461,12 @@
const String& class_name =
String::Handle(isolate_lib.PrivateName(Symbols::_SendPortImpl()));
const int kNumArguments = 1;
+ const String& function_name =
+ String::Handle(isolate_lib.PrivateName(Symbols::_create()));
const Function& function = Function::Handle(
Resolver::ResolveStatic(isolate_lib,
class_name,
- Symbols::_create(),
+ function_name,
kNumArguments,
Object::empty_array(),
Resolver::kIsQualified));
@@ -490,7 +498,10 @@
RawObject* DartLibraryCalls::PortGetId(const Instance& port) {
const Class& cls = Class::Handle(port.clazz());
- const String& func_name = String::Handle(Field::GetterName(Symbols::_id()));
+ const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ const String& func_name =
+ String::Handle(isolate_lib.PrivateName(
+ String::Handle(Field::GetterName(Symbols::_id()))));
const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
ASSERT(!func.IsNull());
const Array& args = Array::Handle(Array::New(1));

Powered by Google App Engine
This is Rietveld 408576698