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

Side by Side Diff: runtime/vm/stub_code_arm.cc

Issue 56033002: Compute next field offset correctly. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); 1158 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
1159 1159
1160 // R0: raw null. 1160 // R0: raw null.
1161 // R2: new object start. 1161 // R2: new object start.
1162 // R3: next object start. 1162 // R3: next object start.
1163 // R1: new object type arguments (if is_cls_parameterized). 1163 // R1: new object type arguments (if is_cls_parameterized).
1164 // First try inlining the initialization without a loop. 1164 // First try inlining the initialization without a loop.
1165 if (instance_size < (kInlineInstanceSize * kWordSize)) { 1165 if (instance_size < (kInlineInstanceSize * kWordSize)) {
1166 // Check if the object contains any non-header fields. 1166 // Check if the object contains any non-header fields.
1167 // Small objects are initialized using a consecutive set of writes. 1167 // Small objects are initialized using a consecutive set of writes.
1168 for (intptr_t current_offset = sizeof(RawObject); 1168 for (intptr_t current_offset = Instance::NextFieldOffset();
1169 current_offset < instance_size; 1169 current_offset < instance_size;
1170 current_offset += kWordSize) { 1170 current_offset += kWordSize) {
1171 __ StoreToOffset(kWord, R0, R2, current_offset); 1171 __ StoreToOffset(kWord, R0, R2, current_offset);
1172 } 1172 }
1173 } else { 1173 } else {
1174 __ add(R4, R2, ShifterOperand(sizeof(RawObject))); 1174 __ add(R4, R2, ShifterOperand(Instance::NextFieldOffset()));
1175 // Loop until the whole object is initialized. 1175 // Loop until the whole object is initialized.
1176 // R0: raw null. 1176 // R0: raw null.
1177 // R2: new object. 1177 // R2: new object.
1178 // R3: next object start. 1178 // R3: next object start.
1179 // R4: next word to be initialized. 1179 // R4: next word to be initialized.
1180 // R1: new object type arguments (if is_cls_parameterized). 1180 // R1: new object type arguments (if is_cls_parameterized).
1181 Label init_loop; 1181 Label init_loop;
1182 Label done; 1182 Label done;
1183 __ Bind(&init_loop); 1183 __ Bind(&init_loop);
1184 __ cmp(R4, ShifterOperand(R3)); 1184 __ cmp(R4, ShifterOperand(R3));
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 __ ldr(left, Address(SP, 4 * kWordSize)); 2140 __ ldr(left, Address(SP, 4 * kWordSize));
2141 __ ldr(right, Address(SP, 3 * kWordSize)); 2141 __ ldr(right, Address(SP, 3 * kWordSize));
2142 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2142 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2143 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); 2143 __ PopList((1 << R0) | (1 << R1) | (1 << R2));
2144 __ Ret(); 2144 __ Ret();
2145 } 2145 }
2146 2146
2147 } // namespace dart 2147 } // namespace dart
2148 2148
2149 #endif // defined TARGET_ARCH_ARM 2149 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698