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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 18292003: Inline native setters for length and data in the optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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_builder.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 24793)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1677,6 +1677,37 @@
MethodRecognizer::Kind recognized_kind =
MethodRecognizer::RecognizeKind(target);
+ if (recognized_kind == MethodRecognizer::kGrowableArraySetData &&
+ (ic_data.NumberOfChecks() == 1) &&
+ class_ids[0] == kGrowableObjectArrayCid) {
srdjan 2013/07/08 16:19:06 Add parentheses
Florian Schneider 2013/07/08 16:24:58 Done.
+ // This is an internal method, no need to check argument types.
+ Definition* array = call->ArgumentAt(0);
+ Definition* value = call->ArgumentAt(1);
+ StoreVMFieldInstr* store = new StoreVMFieldInstr(
+ new Value(array),
+ GrowableObjectArray::data_offset(),
+ new Value(value),
+ Type::ZoneHandle());
+ ReplaceCall(call, store);
+ return true;
+ }
+
+ if (recognized_kind == MethodRecognizer::kGrowableArraySetLength &&
+ (ic_data.NumberOfChecks() == 1) &&
+ class_ids[0] == kGrowableObjectArrayCid) {
+ // This is an internal method, no need to check argument types nor
+ // range.
+ Definition* array = call->ArgumentAt(0);
+ Definition* value = call->ArgumentAt(1);
+ StoreVMFieldInstr* store = new StoreVMFieldInstr(
+ new Value(array),
+ GrowableObjectArray::length_offset(),
+ new Value(value),
+ Type::ZoneHandle());
+ ReplaceCall(call, store);
+ return true;
+ }
+
if ((recognized_kind == MethodRecognizer::kStringBaseCodeUnitAt) &&
(ic_data.NumberOfChecks() == 1) &&
((class_ids[0] == kOneByteStringCid) ||
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698