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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 14703005: Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.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 22688)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1416,6 +1416,12 @@
}
+void FlowGraphOptimizer::InlineObjectCid(InstanceCallInstr* call) {
+ LoadClassIdInstr* load = new LoadClassIdInstr(new Value(call->ArgumentAt(0)));
+ ReplaceCall(call, load);
+}
+
+
static intptr_t OffsetForLengthGetter(MethodRecognizer::Kind kind) {
switch (kind) {
case MethodRecognizer::kObjectArrayLength:
@@ -1495,6 +1501,10 @@
// VM objects length getter.
switch (recognized_kind) {
+ case MethodRecognizer::kObjectCid: {
+ InlineObjectCid(call);
+ return true;
+ }
case MethodRecognizer::kObjectArrayLength:
case MethodRecognizer::kImmutableArrayLength:
case MethodRecognizer::kTypedDataLength:
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698