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

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

Issue 2980033002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 Label* failure, 1253 Label* failure,
1254 Register instance_reg, 1254 Register instance_reg,
1255 Register temp_reg) { 1255 Register temp_reg) {
1256 ASSERT(failure != NULL); 1256 ASSERT(failure != NULL);
1257 if (FLAG_inline_alloc) { 1257 if (FLAG_inline_alloc) {
1258 // If this allocation is traced, program will jump to failure path 1258 // If this allocation is traced, program will jump to failure path
1259 // (i.e. the allocation stub) which will allocate the object and trace the 1259 // (i.e. the allocation stub) which will allocate the object and trace the
1260 // allocation call site. 1260 // allocation call site.
1261 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure)); 1261 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure));
1262 const intptr_t instance_size = cls.instance_size(); 1262 const intptr_t instance_size = cls.instance_size();
1263 Heap::Space space = Heap::kNew; 1263 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
1264 ldr(temp_reg, Address(THR, Thread::heap_offset())); 1264 ldr(instance_reg, Address(THR, Thread::top_offset()));
1265 ldr(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
1266 // TODO(koda): Protect against unsigned overflow here. 1265 // TODO(koda): Protect against unsigned overflow here.
1267 AddImmediateSetFlags(instance_reg, instance_reg, instance_size); 1266 AddImmediateSetFlags(instance_reg, instance_reg, instance_size);
1268 1267
1269 // instance_reg: potential next object start. 1268 // instance_reg: potential next object start.
1270 ldr(TMP, Address(temp_reg, Heap::EndOffset(space))); 1269 ldr(TMP, Address(THR, Thread::end_offset()));
1271 CompareRegisters(TMP, instance_reg); 1270 CompareRegisters(TMP, instance_reg);
1272 // fail if heap end unsigned less than or equal to instance_reg. 1271 // fail if heap end unsigned less than or equal to instance_reg.
1273 b(failure, LS); 1272 b(failure, LS);
1274 1273
1275 // Successfully allocated the object, now update top to point to 1274 // Successfully allocated the object, now update top to point to
1276 // next object start and store the class in the class field of object. 1275 // next object start and store the class in the class field of object.
1277 str(instance_reg, Address(temp_reg, Heap::TopOffset(space))); 1276 str(instance_reg, Address(THR, Thread::top_offset()));
1278 1277
1279 ASSERT(instance_size >= kHeapObjectTag); 1278 ASSERT(instance_size >= kHeapObjectTag);
1280 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); 1279 AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
1281 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space)); 1280 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space));
1282 1281
1283 uint32_t tags = 0; 1282 uint32_t tags = 0;
1284 tags = RawObject::SizeTag::update(instance_size, tags); 1283 tags = RawObject::SizeTag::update(instance_size, tags);
1285 ASSERT(cls.id() != kIllegalCid); 1284 ASSERT(cls.id() != kIllegalCid);
1286 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1285 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1287 // Extends the 32 bit tags with zeros, which is the uninitialized 1286 // Extends the 32 bit tags with zeros, which is the uninitialized
(...skipping 10 matching lines...) Expand all
1298 Label* failure, 1297 Label* failure,
1299 Register instance, 1298 Register instance,
1300 Register end_address, 1299 Register end_address,
1301 Register temp1, 1300 Register temp1,
1302 Register temp2) { 1301 Register temp2) {
1303 if (FLAG_inline_alloc) { 1302 if (FLAG_inline_alloc) {
1304 // If this allocation is traced, program will jump to failure path 1303 // If this allocation is traced, program will jump to failure path
1305 // (i.e. the allocation stub) which will allocate the object and trace the 1304 // (i.e. the allocation stub) which will allocate the object and trace the
1306 // allocation call site. 1305 // allocation call site.
1307 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure)); 1306 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure));
1308 Heap::Space space = Heap::kNew; 1307 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
1309 ldr(temp1, Address(THR, Thread::heap_offset()));
1310 // Potential new object start. 1308 // Potential new object start.
1311 ldr(instance, Address(temp1, Heap::TopOffset(space))); 1309 ldr(instance, Address(THR, Thread::top_offset()));
1312 AddImmediateSetFlags(end_address, instance, instance_size); 1310 AddImmediateSetFlags(end_address, instance, instance_size);
1313 b(failure, CS); // Fail on unsigned overflow. 1311 b(failure, CS); // Fail on unsigned overflow.
1314 1312
1315 // Check if the allocation fits into the remaining space. 1313 // Check if the allocation fits into the remaining space.
1316 // instance: potential new object start. 1314 // instance: potential new object start.
1317 // end_address: potential next object start. 1315 // end_address: potential next object start.
1318 ldr(temp2, Address(temp1, Heap::EndOffset(space))); 1316 ldr(temp2, Address(THR, Thread::end_offset()));
1319 cmp(end_address, Operand(temp2)); 1317 cmp(end_address, Operand(temp2));
1320 b(failure, CS); 1318 b(failure, CS);
1321 1319
1322 // Successfully allocated the object(s), now update top to point to 1320 // Successfully allocated the object(s), now update top to point to
1323 // next object start and initialize the object. 1321 // next object start and initialize the object.
1324 str(end_address, Address(temp1, Heap::TopOffset(space))); 1322 str(end_address, Address(THR, Thread::top_offset()));
1325 add(instance, instance, Operand(kHeapObjectTag)); 1323 add(instance, instance, Operand(kHeapObjectTag));
1326 LoadImmediate(temp2, instance_size); 1324 LoadImmediate(temp2, instance_size);
1327 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space)); 1325 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space));
1328 1326
1329 // Initialize the tags. 1327 // Initialize the tags.
1330 // instance: new object start as a tagged pointer. 1328 // instance: new object start as a tagged pointer.
1331 uint32_t tags = 0; 1329 uint32_t tags = 0;
1332 tags = RawObject::ClassIdTag::update(cid, tags); 1330 tags = RawObject::ClassIdTag::update(cid, tags);
1333 tags = RawObject::SizeTag::update(instance_size, tags); 1331 tags = RawObject::SizeTag::update(instance_size, tags);
1334 // Extends the 32 bit tags with zeros, which is the uninitialized 1332 // Extends the 32 bit tags with zeros, which is the uninitialized
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 str(tmp, Address(addr, 7), kUnsignedByte); 1483 str(tmp, Address(addr, 7), kUnsignedByte);
1486 if (sz == kDoubleWord) { 1484 if (sz == kDoubleWord) {
1487 return; 1485 return;
1488 } 1486 }
1489 UNIMPLEMENTED(); 1487 UNIMPLEMENTED();
1490 } 1488 }
1491 1489
1492 } // namespace dart 1490 } // namespace dart
1493 1491
1494 #endif // defined TARGET_ARCH_ARM64 1492 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698