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

Unified Diff: runtime/vm/stub_code_ia32.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/raw_object.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 14777)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1239,9 +1239,9 @@
// EAX: new object start.
// EBX: next object start.
// EDX: class of the object to be allocated.
+ // EDI: 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);
@@ -1252,31 +1252,11 @@
} else {
__ leal(ECX, Address(EAX, sizeof(RawObject)));
// Loop until the whole object is initialized.
- Label init_loop;
- if (cls.num_native_fields() > 0) {
- // Initialize native fields.
- // EAX: new object.
- // EBX: next object start.
- // EDX: class of the object to be allocated.
- // ECX: next word to be initialized.
- intptr_t offset = Class::num_native_fields_offset() - kHeapObjectTag;
- __ movl(EDX, Address(EDX, offset));
- __ leal(EDX, Address(EAX, EDX, TIMES_4, sizeof(RawObject)));
-
- // EDX: start of dart fields.
- // ECX: next word to be initialized.
- Label init_native_loop;
- __ Bind(&init_native_loop);
- __ cmpl(ECX, EDX);
- __ j(ABOVE_EQUAL, &init_loop, Assembler::kNearJump);
- __ movl(Address(ECX, 0), Immediate(0));
- __ addl(ECX, Immediate(kWordSize));
- __ jmp(&init_native_loop, Assembler::kNearJump);
- }
- // Now initialize the dart fields.
// EAX: new object.
// EBX: next object start.
// ECX: next word to be initialized.
+ // EDI: new object type arguments (if is_cls_parameterized).
+ Label init_loop;
Label done;
__ Bind(&init_loop);
__ cmpl(ECX, EBX);
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698