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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 447793003: VM: Micro-optimization of inline array allocation code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 38967)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -2257,15 +2257,17 @@
// R8: iterator which initially points to the start of the variable
// data area to be initialized.
// R3: null
- __ LoadImmediate(R3, reinterpret_cast<intptr_t>(Object::null()));
- __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag);
+ if (num_elements > 0) {
+ __ LoadImmediate(R3, reinterpret_cast<intptr_t>(Object::null()));
+ __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag);
- Label init_loop;
- __ Bind(&init_loop);
- __ cmp(R8, Operand(R7));
- __ str(R3, Address(R8, 0), CC);
- __ AddImmediate(R8, kWordSize, CC);
- __ b(&init_loop, CC);
+ Label init_loop;
+ __ Bind(&init_loop);
+ __ cmp(R8, Operand(R7));
+ __ str(R3, Address(R8, 0), CC);
+ __ AddImmediate(R8, kWordSize, CC);
+ __ b(&init_loop, CC);
+ }
__ b(done);
}
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698