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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 11312183: - Do not mix scalar values and object fields in RawInstance to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/stub_code_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 14777)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1219,9 +1219,9 @@
// RAX: new object start.
// RBX: next object start.
// RDX: class of the object to be allocated.
+ // RDI: new object type arguments (if is_cls_parameterized).
// First try inlining the initialization without a loop.
- if (instance_size < (kInlineInstanceSize * kWordSize) &&
- cls.num_native_fields() == 0) {
+ if (instance_size < (kInlineInstanceSize * kWordSize)) {
// Check if the object contains any non-header fields.
// Small objects are initialized using a consecutive set of writes.
for (intptr_t current_offset = sizeof(RawObject);
@@ -1232,31 +1232,11 @@
} else {
__ leaq(RCX, Address(RAX, sizeof(RawObject)));
// Loop until the whole object is initialized.
- Label init_loop;
- if (cls.num_native_fields() > 0) {
- // Initialize native fields.
- // RAX: new object.
- // RBX: next object start.
- // RDX: class of the object to be allocated.
- // RCX: next word to be initialized.
- intptr_t offset = Class::num_native_fields_offset() - kHeapObjectTag;
- __ movq(RDX, Address(RDX, offset));
- __ leaq(RDX, Address(RAX, RDX, TIMES_8, sizeof(RawObject)));
-
- // RDX: start of dart fields.
- // RCX: next word to be initialized.
- Label init_native_loop;
- __ Bind(&init_native_loop);
- __ cmpq(RCX, RDX);
- __ j(ABOVE_EQUAL, &init_loop, Assembler::kNearJump);
- __ movq(Address(RCX, 0), Immediate(0));
- __ addq(RCX, Immediate(kWordSize));
- __ jmp(&init_native_loop, Assembler::kNearJump);
- }
- // Now initialize the dart fields.
// RAX: new object.
// RBX: next object start.
// RCX: next word to be initialized.
+ // RDI: new object type arguments (if is_cls_parameterized).
+ Label init_loop;
Label done;
__ Bind(&init_loop);
__ cmpq(RCX, RBX);
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698