OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 B(ne, &next); | 1529 B(ne, &next); |
1530 } | 1530 } |
1531 | 1531 |
1532 | 1532 |
1533 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, | 1533 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
1534 Register scratch1, | 1534 Register scratch1, |
1535 Register scratch2, | 1535 Register scratch2, |
1536 Label* no_memento_found) { | 1536 Label* no_memento_found) { |
1537 Label map_check; | 1537 Label map_check; |
1538 Label top_check; | 1538 Label top_check; |
1539 ExternalReference new_space_allocation_top = | 1539 ExternalReference new_space_allocation_top_adr = |
1540 ExternalReference::new_space_allocation_top_address(isolate()); | 1540 ExternalReference::new_space_allocation_top_address(isolate()); |
1541 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 1541 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
1542 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 1542 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
1543 | 1543 |
1544 // Bail out if the object is not in new space. | 1544 // Bail out if the object is not in new space. |
1545 JumpIfNotInNewSpace(receiver, no_memento_found); | 1545 JumpIfNotInNewSpace(receiver, no_memento_found); |
1546 Add(scratch1, receiver, kMementoEndOffset); | 1546 Add(scratch1, receiver, kMementoEndOffset); |
1547 // If the object is in new space, we need to check whether it is on the same | 1547 // If the object is in new space, we need to check whether it is on the same |
1548 // page as the current top. | 1548 // page as the current top. |
1549 Eor(scratch2, scratch1, new_space_allocation_top); | 1549 Mov(scratch2, new_space_allocation_top_adr); |
| 1550 Ldr(scratch2, MemOperand(scratch2)); |
| 1551 Eor(scratch2, scratch1, scratch2); |
1550 Tst(scratch2, ~Page::kPageAlignmentMask); | 1552 Tst(scratch2, ~Page::kPageAlignmentMask); |
1551 B(eq, &top_check); | 1553 B(eq, &top_check); |
1552 // The object is on a different page than allocation top. Bail out if the | 1554 // The object is on a different page than allocation top. Bail out if the |
1553 // object sits on the page boundary as no memento can follow and we cannot | 1555 // object sits on the page boundary as no memento can follow and we cannot |
1554 // touch the memory following it. | 1556 // touch the memory following it. |
1555 Eor(scratch2, scratch1, receiver); | 1557 Eor(scratch2, scratch1, receiver); |
1556 Tst(scratch2, ~Page::kPageAlignmentMask); | 1558 Tst(scratch2, ~Page::kPageAlignmentMask); |
1557 B(ne, no_memento_found); | 1559 B(ne, no_memento_found); |
1558 // Continue with the actual map check. | 1560 // Continue with the actual map check. |
1559 jmp(&map_check); | 1561 jmp(&map_check); |
1560 // If top is on the same page as the current object, we need to check whether | 1562 // If top is on the same page as the current object, we need to check whether |
1561 // we are below top. | 1563 // we are below top. |
1562 bind(&top_check); | 1564 bind(&top_check); |
1563 Cmp(scratch1, new_space_allocation_top); | 1565 Mov(scratch2, new_space_allocation_top_adr); |
| 1566 Ldr(scratch2, MemOperand(scratch2)); |
| 1567 Cmp(scratch1, scratch2); |
1564 B(gt, no_memento_found); | 1568 B(gt, no_memento_found); |
1565 // Memento map check. | 1569 // Memento map check. |
1566 bind(&map_check); | 1570 bind(&map_check); |
1567 Ldr(scratch1, MemOperand(receiver, kMementoMapOffset)); | 1571 Ldr(scratch1, MemOperand(receiver, kMementoMapOffset)); |
1568 Cmp(scratch1, Operand(isolate()->factory()->allocation_memento_map())); | 1572 Cmp(scratch1, Operand(isolate()->factory()->allocation_memento_map())); |
1569 } | 1573 } |
1570 | 1574 |
1571 | 1575 |
1572 void MacroAssembler::InNewSpace(Register object, | 1576 void MacroAssembler::InNewSpace(Register object, |
1573 Condition cond, | 1577 Condition cond, |
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5145 } | 5149 } |
5146 | 5150 |
5147 | 5151 |
5148 #undef __ | 5152 #undef __ |
5149 | 5153 |
5150 | 5154 |
5151 } // namespace internal | 5155 } // namespace internal |
5152 } // namespace v8 | 5156 } // namespace v8 |
5153 | 5157 |
5154 #endif // V8_TARGET_ARCH_ARM64 | 5158 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |