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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 536043002: Merge array allocation and List._copyFromObjectArray to provide fast path for large arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 2df010cf886b4b52c52abb00a606a26847fa418e..835fe406114c1a85f2c21df59d63500b5e587ae0 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1601,6 +1601,13 @@ Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) {
return call->ArgumentAt(0);
}
}
+
+ CreateArrayInstr* create_array = instance()->definition()->AsCreateArray();
+ if ((create_array != NULL) &&
+ (recognized_kind() == MethodRecognizer::kObjectArrayLength)) {
+ return create_array->num_elements()->definition();
+ }
+
// For arrays with guarded lengths, replace the length load
// with a constant.
LoadFieldInstr* load_array = instance()->definition()->AsLoadField();

Powered by Google App Engine
This is Rietveld 408576698