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

Side by Side Diff: src/arm64/macro-assembler-arm64.cc

Issue 1845463003: Remove usages of Heap::NewSpaceStart and its external reference (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only use 1 constant, reordered checks a bit to have earlier bail outs for old space Created 4 years, 8 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 | « src/arm/macro-assembler-arm.cc ('k') | src/assembler.h » ('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 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset)); 1549 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset));
1550 Cmp(current_object, null_value); 1550 Cmp(current_object, null_value);
1551 B(ne, &next); 1551 B(ne, &next);
1552 } 1552 }
1553 1553
1554 1554
1555 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, 1555 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver,
1556 Register scratch1, 1556 Register scratch1,
1557 Register scratch2, 1557 Register scratch2,
1558 Label* no_memento_found) { 1558 Label* no_memento_found) {
1559 ExternalReference new_space_start = 1559 Label map_check;
1560 ExternalReference::new_space_start(isolate()); 1560 Label top_check;
1561 ExternalReference new_space_allocation_top = 1561 ExternalReference new_space_allocation_top =
1562 ExternalReference::new_space_allocation_top_address(isolate()); 1562 ExternalReference::new_space_allocation_top_address(isolate());
1563 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
1564 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize;
1563 1565
1564 Add(scratch1, receiver, 1566 // Bail out if the object is not in new space.
1565 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag); 1567 JumpIfNotInNewSpace(receiver, no_memento_found);
1566 Cmp(scratch1, new_space_start); 1568 Add(scratch1, receiver, kMementoEndOffset);
1567 B(lt, no_memento_found); 1569 // If the object is in new space, we need to check whether it is on the same
1568 1570 // page as the current top.
1569 Mov(scratch2, new_space_allocation_top); 1571 Eor(scratch2, scratch1, new_space_allocation_top);
1570 Ldr(scratch2, MemOperand(scratch2)); 1572 Tst(scratch2, ~Page::kPageAlignmentMask);
1571 Cmp(scratch1, scratch2); 1573 B(eq, &top_check);
1574 // The object is on a different page than allocation top. Bail out if the
1575 // object sits on the page boundary as no memento can follow and we cannot
1576 // touch the memory following it.
1577 Eor(scratch2, scratch1, receiver);
1578 Tst(scratch2, ~Page::kPageAlignmentMask);
1579 B(ne, no_memento_found);
1580 // Continue with the actual map check.
1581 jmp(&map_check);
1582 // If top is on the same page as the current object, we need to check whether
1583 // we are below top.
1584 bind(&top_check);
1585 Cmp(scratch1, new_space_allocation_top);
1572 B(gt, no_memento_found); 1586 B(gt, no_memento_found);
1573 1587 // Memento map check.
1574 Ldr(scratch1, MemOperand(scratch1, -AllocationMemento::kSize)); 1588 bind(&map_check);
1575 Cmp(scratch1, 1589 Ldr(scratch1, MemOperand(receiver, kMementoMapOffset));
1576 Operand(isolate()->factory()->allocation_memento_map())); 1590 Cmp(scratch1, Operand(isolate()->factory()->allocation_memento_map()));
1577 } 1591 }
1578 1592
1579 1593
1580 void MacroAssembler::InNewSpace(Register object, 1594 void MacroAssembler::InNewSpace(Register object,
1581 Condition cond, 1595 Condition cond,
1582 Label* branch) { 1596 Label* branch) {
1583 DCHECK(cond == eq || cond == ne); 1597 DCHECK(cond == eq || cond == ne);
1584 UseScratchRegisterScope temps(this); 1598 UseScratchRegisterScope temps(this);
1585 const int mask = 1599 const int mask =
1586 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE); 1600 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
(...skipping 3492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5079 } 5093 }
5080 5094
5081 5095
5082 #undef __ 5096 #undef __
5083 5097
5084 5098
5085 } // namespace internal 5099 } // namespace internal
5086 } // namespace v8 5100 } // namespace v8
5087 5101
5088 #endif // V8_TARGET_ARCH_ARM64 5102 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698