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

Unified Diff: runtime/vm/flow_graph_builder.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
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 17175)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -31,6 +31,13 @@
DECLARE_FLAG(bool, enable_type_checks);
+static const String& PrivateCoreLibName(const String& str) {
+ const Library& core_lib = Library::Handle(Library::CoreLibrary());
+ const String& private_name = String::ZoneHandle(core_lib.PrivateName(str));
+ return private_name;
+}
+
+
FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function,
InliningContext* inlining_context)
: parsed_function_(parsed_function),
@@ -950,7 +957,6 @@
&push_instantiator,
&push_type_args);
}
- const String& name = String::ZoneHandle(Symbols::New("_instanceOf"));
ZoneGrowableArray<PushArgumentInstr*>* arguments =
new ZoneGrowableArray<PushArgumentInstr*>(5);
arguments->Add(push_left);
@@ -965,12 +971,13 @@
Value* negate_arg = Bind(new ConstantInstr(negate));
arguments->Add(PushArgument(negate_arg));
const intptr_t kNumArgsChecked = 1;
- InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(),
- name,
- node->kind(),
- arguments,
- Array::ZoneHandle(),
- kNumArgsChecked);
+ InstanceCallInstr* call = new InstanceCallInstr(
+ node->token_pos(),
+ PrivateCoreLibName(Symbols::_instanceOf()),
+ node->kind(),
+ arguments,
+ Array::ZoneHandle(),
+ kNumArgsChecked);
ReturnDefinition(call);
}
@@ -2879,9 +2886,10 @@
corelib.LookupClassAllowPrivate(Symbols::InvocationMirror()));
ASSERT(!mirror_class.IsNull());
const Function& allocation_function = Function::ZoneHandle(
- Resolver::ResolveStaticByName(mirror_class,
- Symbols::AllocateInvocationMirror(),
- Resolver::kIsQualified));
+ Resolver::ResolveStaticByName(
+ mirror_class,
+ PrivateCoreLibName(Symbols::AllocateInvocationMirror()),
+ Resolver::kIsQualified));
ASSERT(!allocation_function.IsNull());
// Evaluate the receiver before the arguments. This will be used
@@ -2975,7 +2983,7 @@
ASSERT(!cls.IsNull());
const Function& func = Function::ZoneHandle(
Resolver::ResolveStatic(cls,
- Symbols::ThrowNew(),
+ PrivateCoreLibName(Symbols::ThrowNew()),
arguments->length(),
Array::ZoneHandle(),
Resolver::kIsQualified));
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698