| 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 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1525 | 1525 |
| 1526 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, | 1526 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
| 1527 Register scratch1, | 1527 Register scratch1, |
| 1528 Register scratch2, | 1528 Register scratch2, |
| 1529 Label* no_memento_found) { | 1529 Label* no_memento_found) { |
| 1530 Label map_check; | 1530 Label map_check; |
| 1531 Label top_check; | 1531 Label top_check; |
| 1532 ExternalReference new_space_allocation_top_adr = | 1532 ExternalReference new_space_allocation_top_adr = |
| 1533 ExternalReference::new_space_allocation_top_address(isolate()); | 1533 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1534 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 1534 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 1535 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 1535 const int kMementoLastWordOffset = |
| 1536 kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
| 1536 | 1537 |
| 1537 // Bail out if the object is not in new space. | 1538 // Bail out if the object is not in new space. |
| 1538 JumpIfNotInNewSpace(receiver, no_memento_found); | 1539 JumpIfNotInNewSpace(receiver, no_memento_found); |
| 1539 Add(scratch1, receiver, kMementoEndOffset); | 1540 Add(scratch1, receiver, kMementoLastWordOffset); |
| 1540 // If the object is in new space, we need to check whether it is on the same | 1541 // If the object is in new space, we need to check whether it is on the same |
| 1541 // page as the current top. | 1542 // page as the current top. |
| 1542 Mov(scratch2, new_space_allocation_top_adr); | 1543 Mov(scratch2, new_space_allocation_top_adr); |
| 1543 Ldr(scratch2, MemOperand(scratch2)); | 1544 Ldr(scratch2, MemOperand(scratch2)); |
| 1544 Eor(scratch2, scratch1, scratch2); | 1545 Eor(scratch2, scratch1, scratch2); |
| 1545 Tst(scratch2, ~Page::kPageAlignmentMask); | 1546 Tst(scratch2, ~Page::kPageAlignmentMask); |
| 1546 B(eq, &top_check); | 1547 B(eq, &top_check); |
| 1547 // The object is on a different page than allocation top. Bail out if the | 1548 // The object is on a different page than allocation top. Bail out if the |
| 1548 // object sits on the page boundary as no memento can follow and we cannot | 1549 // object sits on the page boundary as no memento can follow and we cannot |
| 1549 // touch the memory following it. | 1550 // touch the memory following it. |
| 1550 Eor(scratch2, scratch1, receiver); | 1551 Eor(scratch2, scratch1, receiver); |
| 1551 Tst(scratch2, ~Page::kPageAlignmentMask); | 1552 Tst(scratch2, ~Page::kPageAlignmentMask); |
| 1552 B(ne, no_memento_found); | 1553 B(ne, no_memento_found); |
| 1553 // Continue with the actual map check. | 1554 // Continue with the actual map check. |
| 1554 jmp(&map_check); | 1555 jmp(&map_check); |
| 1555 // If top is on the same page as the current object, we need to check whether | 1556 // If top is on the same page as the current object, we need to check whether |
| 1556 // we are below top. | 1557 // we are below top. |
| 1557 bind(&top_check); | 1558 bind(&top_check); |
| 1558 Mov(scratch2, new_space_allocation_top_adr); | 1559 Mov(scratch2, new_space_allocation_top_adr); |
| 1559 Ldr(scratch2, MemOperand(scratch2)); | 1560 Ldr(scratch2, MemOperand(scratch2)); |
| 1560 Cmp(scratch1, scratch2); | 1561 Cmp(scratch1, scratch2); |
| 1561 B(gt, no_memento_found); | 1562 B(ge, no_memento_found); |
| 1562 // Memento map check. | 1563 // Memento map check. |
| 1563 bind(&map_check); | 1564 bind(&map_check); |
| 1564 Ldr(scratch1, MemOperand(receiver, kMementoMapOffset)); | 1565 Ldr(scratch1, MemOperand(receiver, kMementoMapOffset)); |
| 1565 Cmp(scratch1, Operand(isolate()->factory()->allocation_memento_map())); | 1566 Cmp(scratch1, Operand(isolate()->factory()->allocation_memento_map())); |
| 1566 } | 1567 } |
| 1567 | 1568 |
| 1568 | 1569 |
| 1569 void MacroAssembler::InNewSpace(Register object, | 1570 void MacroAssembler::InNewSpace(Register object, |
| 1570 Condition cond, | 1571 Condition cond, |
| 1571 Label* branch) { | 1572 Label* branch) { |
| (...skipping 3361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4933 } | 4934 } |
| 4934 | 4935 |
| 4935 | 4936 |
| 4936 #undef __ | 4937 #undef __ |
| 4937 | 4938 |
| 4938 | 4939 |
| 4939 } // namespace internal | 4940 } // namespace internal |
| 4940 } // namespace v8 | 4941 } // namespace v8 |
| 4941 | 4942 |
| 4942 #endif // V8_TARGET_ARCH_ARM64 | 4943 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |