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

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

Issue 2974403002: Revert "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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 Label* failure, 1336 Label* failure,
1337 Register instance_reg, 1337 Register instance_reg,
1338 Register temp_reg) { 1338 Register temp_reg) {
1339 ASSERT(failure != NULL); 1339 ASSERT(failure != NULL);
1340 if (FLAG_inline_alloc) { 1340 if (FLAG_inline_alloc) {
1341 // If this allocation is traced, program will jump to failure path 1341 // If this allocation is traced, program will jump to failure path
1342 // (i.e. the allocation stub) which will allocate the object and trace the 1342 // (i.e. the allocation stub) which will allocate the object and trace the
1343 // allocation call site. 1343 // allocation call site.
1344 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure)); 1344 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure));
1345 const intptr_t instance_size = cls.instance_size(); 1345 const intptr_t instance_size = cls.instance_size();
1346 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 1346 Heap::Space space = Heap::kNew;
1347 ldr(instance_reg, Address(THR, Thread::top_offset())); 1347 ldr(temp_reg, Address(THR, Thread::heap_offset()));
1348 ldr(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
1348 // TODO(koda): Protect against unsigned overflow here. 1349 // TODO(koda): Protect against unsigned overflow here.
1349 AddImmediateSetFlags(instance_reg, instance_reg, instance_size); 1350 AddImmediateSetFlags(instance_reg, instance_reg, instance_size);
1350 1351
1351 // instance_reg: potential next object start. 1352 // instance_reg: potential next object start.
1352 ldr(TMP, Address(THR, Thread::end_offset())); 1353 ldr(TMP, Address(temp_reg, Heap::EndOffset(space)));
1353 CompareRegisters(TMP, instance_reg); 1354 CompareRegisters(TMP, instance_reg);
1354 // fail if heap end unsigned less than or equal to instance_reg. 1355 // fail if heap end unsigned less than or equal to instance_reg.
1355 b(failure, LS); 1356 b(failure, LS);
1356 1357
1357 // Successfully allocated the object, now update top to point to 1358 // Successfully allocated the object, now update top to point to
1358 // next object start and store the class in the class field of object. 1359 // next object start and store the class in the class field of object.
1359 str(instance_reg, Address(THR, Thread::top_offset())); 1360 str(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
1360 1361
1361 ASSERT(instance_size >= kHeapObjectTag); 1362 ASSERT(instance_size >= kHeapObjectTag);
1362 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); 1363 AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
1363 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space)); 1364 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space));
1364 1365
1365 uint32_t tags = 0; 1366 uint32_t tags = 0;
1366 tags = RawObject::SizeTag::update(instance_size, tags); 1367 tags = RawObject::SizeTag::update(instance_size, tags);
1367 ASSERT(cls.id() != kIllegalCid); 1368 ASSERT(cls.id() != kIllegalCid);
1368 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1369 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1369 // Extends the 32 bit tags with zeros, which is the uninitialized 1370 // Extends the 32 bit tags with zeros, which is the uninitialized
(...skipping 11 matching lines...) Expand all
1381 Label* failure, 1382 Label* failure,
1382 Register instance, 1383 Register instance,
1383 Register end_address, 1384 Register end_address,
1384 Register temp1, 1385 Register temp1,
1385 Register temp2) { 1386 Register temp2) {
1386 if (FLAG_inline_alloc) { 1387 if (FLAG_inline_alloc) {
1387 // If this allocation is traced, program will jump to failure path 1388 // If this allocation is traced, program will jump to failure path
1388 // (i.e. the allocation stub) which will allocate the object and trace the 1389 // (i.e. the allocation stub) which will allocate the object and trace the
1389 // allocation call site. 1390 // allocation call site.
1390 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure)); 1391 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure));
1391 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 1392 Heap::Space space = Heap::kNew;
1393 ldr(temp1, Address(THR, Thread::heap_offset()));
1392 // Potential new object start. 1394 // Potential new object start.
1393 ldr(instance, Address(THR, Thread::top_offset())); 1395 ldr(instance, Address(temp1, Heap::TopOffset(space)));
1394 AddImmediateSetFlags(end_address, instance, instance_size); 1396 AddImmediateSetFlags(end_address, instance, instance_size);
1395 b(failure, CS); // Fail on unsigned overflow. 1397 b(failure, CS); // Fail on unsigned overflow.
1396 1398
1397 // Check if the allocation fits into the remaining space. 1399 // Check if the allocation fits into the remaining space.
1398 // instance: potential new object start. 1400 // instance: potential new object start.
1399 // end_address: potential next object start. 1401 // end_address: potential next object start.
1400 ldr(temp2, Address(THR, Thread::end_offset())); 1402 ldr(temp2, Address(temp1, Heap::EndOffset(space)));
1401 cmp(end_address, Operand(temp2)); 1403 cmp(end_address, Operand(temp2));
1402 b(failure, CS); 1404 b(failure, CS);
1403 1405
1404 // Successfully allocated the object(s), now update top to point to 1406 // Successfully allocated the object(s), now update top to point to
1405 // next object start and initialize the object. 1407 // next object start and initialize the object.
1406 str(end_address, Address(THR, Thread::top_offset())); 1408 str(end_address, Address(temp1, Heap::TopOffset(space)));
1407 add(instance, instance, Operand(kHeapObjectTag)); 1409 add(instance, instance, Operand(kHeapObjectTag));
1408 LoadImmediate(temp2, instance_size); 1410 LoadImmediate(temp2, instance_size);
1409 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space)); 1411 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space));
1410 1412
1411 // Initialize the tags. 1413 // Initialize the tags.
1412 // instance: new object start as a tagged pointer. 1414 // instance: new object start as a tagged pointer.
1413 uint32_t tags = 0; 1415 uint32_t tags = 0;
1414 tags = RawObject::ClassIdTag::update(cid, tags); 1416 tags = RawObject::ClassIdTag::update(cid, tags);
1415 tags = RawObject::SizeTag::update(instance_size, tags); 1417 tags = RawObject::SizeTag::update(instance_size, tags);
1416 // Extends the 32 bit tags with zeros, which is the uninitialized 1418 // Extends the 32 bit tags with zeros, which is the uninitialized
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 str(tmp, Address(addr, 7), kUnsignedByte); 1575 str(tmp, Address(addr, 7), kUnsignedByte);
1574 if (sz == kDoubleWord) { 1576 if (sz == kDoubleWord) {
1575 return; 1577 return;
1576 } 1578 }
1577 UNIMPLEMENTED(); 1579 UNIMPLEMENTED();
1578 } 1580 }
1579 1581
1580 } // namespace dart 1582 } // namespace dart
1581 1583
1582 #endif // defined TARGET_ARCH_ARM64 1584 #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