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

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
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 22603)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1377,6 +1377,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:
@@ -1439,6 +1445,10 @@
// VM objects length getter.
switch (recognized_kind) {
+ case MethodRecognizer::kObjectCid: {
+ InlineObjectCid(call);
+ return true;
+ }
case MethodRecognizer::kObjectArrayLength:
case MethodRecognizer::kImmutableArrayLength:
case MethodRecognizer::kTypedDataLength:

Powered by Google App Engine
This is Rietveld 408576698