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

Side by Side Diff: runtime/vm/assembler_arm.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 | « no previous file | runtime/vm/assembler_arm64.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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 ASSERT(failure != NULL); 3443 ASSERT(failure != NULL);
3444 if (FLAG_inline_alloc) { 3444 if (FLAG_inline_alloc) {
3445 ASSERT(instance_reg != temp_reg); 3445 ASSERT(instance_reg != temp_reg);
3446 ASSERT(temp_reg != IP); 3446 ASSERT(temp_reg != IP);
3447 const intptr_t instance_size = cls.instance_size(); 3447 const intptr_t instance_size = cls.instance_size();
3448 ASSERT(instance_size != 0); 3448 ASSERT(instance_size != 0);
3449 // If this allocation is traced, program will jump to failure path 3449 // If this allocation is traced, program will jump to failure path
3450 // (i.e. the allocation stub) which will allocate the object and trace the 3450 // (i.e. the allocation stub) which will allocate the object and trace the
3451 // allocation call site. 3451 // allocation call site.
3452 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure)); 3452 NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure));
3453 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 3453 Heap::Space space = Heap::kNew;
3454 ldr(instance_reg, Address(THR, Thread::top_offset())); 3454 ldr(temp_reg, Address(THR, Thread::heap_offset()));
3455 ldr(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
3455 // TODO(koda): Protect against unsigned overflow here. 3456 // TODO(koda): Protect against unsigned overflow here.
3456 AddImmediateSetFlags(instance_reg, instance_reg, instance_size); 3457 AddImmediateSetFlags(instance_reg, instance_reg, instance_size);
3457 3458
3458 // instance_reg: potential next object start. 3459 // instance_reg: potential next object start.
3459 ldr(IP, Address(THR, Thread::end_offset())); 3460 ldr(IP, Address(temp_reg, Heap::EndOffset(space)));
3460 cmp(IP, Operand(instance_reg)); 3461 cmp(IP, Operand(instance_reg));
3461 // fail if heap end unsigned less than or equal to instance_reg. 3462 // fail if heap end unsigned less than or equal to instance_reg.
3462 b(failure, LS); 3463 b(failure, LS);
3463 3464
3464 // Successfully allocated the object, now update top to point to 3465 // Successfully allocated the object, now update top to point to
3465 // next object start and store the class in the class field of object. 3466 // next object start and store the class in the class field of object.
3466 str(instance_reg, Address(THR, Thread::top_offset())); 3467 str(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
3468
3467 NOT_IN_PRODUCT(LoadAllocationStatsAddress(temp_reg, cls.id())); 3469 NOT_IN_PRODUCT(LoadAllocationStatsAddress(temp_reg, cls.id()));
3468 3470
3469 ASSERT(instance_size >= kHeapObjectTag); 3471 ASSERT(instance_size >= kHeapObjectTag);
3470 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); 3472 AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
3471 3473
3472 uint32_t tags = 0; 3474 uint32_t tags = 0;
3473 tags = RawObject::SizeTag::update(instance_size, tags); 3475 tags = RawObject::SizeTag::update(instance_size, tags);
3474 ASSERT(cls.id() != kIllegalCid); 3476 ASSERT(cls.id() != kIllegalCid);
3475 tags = RawObject::ClassIdTag::update(cls.id(), tags); 3477 tags = RawObject::ClassIdTag::update(cls.id(), tags);
3476 LoadImmediate(IP, tags); 3478 LoadImmediate(IP, tags);
(...skipping 11 matching lines...) Expand all
3488 Label* failure, 3490 Label* failure,
3489 Register instance, 3491 Register instance,
3490 Register end_address, 3492 Register end_address,
3491 Register temp1, 3493 Register temp1,
3492 Register temp2) { 3494 Register temp2) {
3493 if (FLAG_inline_alloc) { 3495 if (FLAG_inline_alloc) {
3494 // If this allocation is traced, program will jump to failure path 3496 // If this allocation is traced, program will jump to failure path
3495 // (i.e. the allocation stub) which will allocate the object and trace the 3497 // (i.e. the allocation stub) which will allocate the object and trace the
3496 // allocation call site. 3498 // allocation call site.
3497 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure)); 3499 NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp1, failure));
3498 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 3500 Heap::Space space = Heap::kNew;
3501 ldr(temp1, Address(THR, Thread::heap_offset()));
3499 // Potential new object start. 3502 // Potential new object start.
3500 ldr(instance, Address(THR, Thread::top_offset())); 3503 ldr(instance, Address(temp1, Heap::TopOffset(space)));
3501 AddImmediateSetFlags(end_address, instance, instance_size); 3504 AddImmediateSetFlags(end_address, instance, instance_size);
3502 b(failure, CS); // Branch if unsigned overflow. 3505 b(failure, CS); // Branch if unsigned overflow.
3503 3506
3504 // Check if the allocation fits into the remaining space. 3507 // Check if the allocation fits into the remaining space.
3505 // instance: potential new object start. 3508 // instance: potential new object start.
3506 // end_address: potential next object start. 3509 // end_address: potential next object start.
3507 ldr(temp2, Address(THR, Thread::end_offset())); 3510 ldr(temp2, Address(temp1, Heap::EndOffset(space)));
3508 cmp(end_address, Operand(temp2)); 3511 cmp(end_address, Operand(temp2));
3509 b(failure, CS); 3512 b(failure, CS);
3510 3513
3511 NOT_IN_PRODUCT(LoadAllocationStatsAddress(temp2, cid)); 3514 NOT_IN_PRODUCT(LoadAllocationStatsAddress(temp2, cid));
3512 3515
3513 // Successfully allocated the object(s), now update top to point to 3516 // Successfully allocated the object(s), now update top to point to
3514 // next object start and initialize the object. 3517 // next object start and initialize the object.
3515 str(end_address, Address(THR, Thread::top_offset())); 3518 str(end_address, Address(temp1, Heap::TopOffset(space)));
3516 add(instance, instance, Operand(kHeapObjectTag)); 3519 add(instance, instance, Operand(kHeapObjectTag));
3517 3520
3518 // Initialize the tags. 3521 // Initialize the tags.
3519 // instance: new object start as a tagged pointer. 3522 // instance: new object start as a tagged pointer.
3520 uint32_t tags = 0; 3523 uint32_t tags = 0;
3521 tags = RawObject::ClassIdTag::update(cid, tags); 3524 tags = RawObject::ClassIdTag::update(cid, tags);
3522 tags = RawObject::SizeTag::update(instance_size, tags); 3525 tags = RawObject::SizeTag::update(instance_size, tags);
3523 LoadImmediate(temp1, tags); 3526 LoadImmediate(temp1, tags);
3524 str(temp1, FieldAddress(instance, Array::tags_offset())); // Store tags. 3527 str(temp1, FieldAddress(instance, Array::tags_offset())); // Store tags.
3525 3528
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
3725 3728
3726 3729
3727 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3730 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3728 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3731 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3729 return fpu_reg_names[reg]; 3732 return fpu_reg_names[reg];
3730 } 3733 }
3731 3734
3732 } // namespace dart 3735 } // namespace dart
3733 3736
3734 #endif // defined TARGET_ARCH_ARM 3737 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698