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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 47073009: Improve indexOf for one byte string receiver to work with other string classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/dart_api_impl_test.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 29605)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -3124,6 +3124,17 @@
InvokeMathCFunctionInstr* invoke =
new InvokeMathCFunctionInstr(args, call->deopt_id(), recognized_kind);
ReplaceCall(call, invoke);
+ } else if (Library::PrivateCoreLibName(Symbols::ClassId()).Equals(
+ String::Handle(call->function().name()))) {
+ // Check for core library get:_classId.
+ intptr_t cid = Class::Handle(call->function().Owner()).id();
+ // Currently only implemented for a subset of classes.
+ ASSERT((cid == kOneByteStringCid) || (cid == kTwoByteStringCid) ||
+ (cid == kExternalOneByteStringCid) ||
+ (cid == kGrowableObjectArrayCid) ||
+ (cid == kImmutableArrayCid) || (cid == kArrayCid));
+ ConstantInstr* cid_instr = new ConstantInstr(Smi::Handle(Smi::New(cid)));
+ ReplaceCall(call, cid_instr);
}
}
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698