| 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 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 Mov(x1, builtin); | 1698 Mov(x1, builtin); |
| 1699 CEntryStub stub(isolate(), 1); | 1699 CEntryStub stub(isolate(), 1); |
| 1700 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 1700 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 1701 } | 1701 } |
| 1702 | 1702 |
| 1703 | 1703 |
| 1704 void MacroAssembler::GetBuiltinFunction(Register target, | 1704 void MacroAssembler::GetBuiltinFunction(Register target, |
| 1705 int native_context_index) { | 1705 int native_context_index) { |
| 1706 // Load the builtins object into target register. | 1706 // Load the builtins object into target register. |
| 1707 Ldr(target, GlobalObjectMemOperand()); | 1707 Ldr(target, GlobalObjectMemOperand()); |
| 1708 Ldr(target, FieldMemOperand(target, GlobalObject::kNativeContextOffset)); | 1708 Ldr(target, FieldMemOperand(target, JSGlobalObject::kNativeContextOffset)); |
| 1709 // Load the JavaScript builtin function from the builtins object. | 1709 // Load the JavaScript builtin function from the builtins object. |
| 1710 Ldr(target, ContextMemOperand(target, native_context_index)); | 1710 Ldr(target, ContextMemOperand(target, native_context_index)); |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1713 | 1713 |
| 1714 void MacroAssembler::GetBuiltinEntry(Register target, Register function, | 1714 void MacroAssembler::GetBuiltinEntry(Register target, Register function, |
| 1715 int native_context_index) { | 1715 int native_context_index) { |
| 1716 DCHECK(!AreAliased(target, function)); | 1716 DCHECK(!AreAliased(target, function)); |
| 1717 GetBuiltinFunction(function, native_context_index); | 1717 GetBuiltinFunction(function, native_context_index); |
| 1718 // Load the code entry point from the builtins object. | 1718 // Load the code entry point from the builtins object. |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2995 // Slot is in the current function context. Move it into the | 2995 // Slot is in the current function context. Move it into the |
| 2996 // destination register in case we store into it (the write barrier | 2996 // destination register in case we store into it (the write barrier |
| 2997 // cannot be allowed to destroy the context in cp). | 2997 // cannot be allowed to destroy the context in cp). |
| 2998 Mov(dst, cp); | 2998 Mov(dst, cp); |
| 2999 } | 2999 } |
| 3000 } | 3000 } |
| 3001 | 3001 |
| 3002 | 3002 |
| 3003 void MacroAssembler::LoadGlobalProxy(Register dst) { | 3003 void MacroAssembler::LoadGlobalProxy(Register dst) { |
| 3004 Ldr(dst, GlobalObjectMemOperand()); | 3004 Ldr(dst, GlobalObjectMemOperand()); |
| 3005 Ldr(dst, FieldMemOperand(dst, GlobalObject::kGlobalProxyOffset)); | 3005 Ldr(dst, FieldMemOperand(dst, JSGlobalObject::kGlobalProxyOffset)); |
| 3006 } | 3006 } |
| 3007 | 3007 |
| 3008 | 3008 |
| 3009 void MacroAssembler::DebugBreak() { | 3009 void MacroAssembler::DebugBreak() { |
| 3010 Mov(x0, 0); | 3010 Mov(x0, 0); |
| 3011 Mov(x1, ExternalReference(Runtime::kHandleDebuggerStatement, isolate())); | 3011 Mov(x1, ExternalReference(Runtime::kHandleDebuggerStatement, isolate())); |
| 3012 CEntryStub ces(isolate(), 1); | 3012 CEntryStub ces(isolate(), 1); |
| 3013 DCHECK(AllowThisStubCall(&ces)); | 3013 DCHECK(AllowThisStubCall(&ces)); |
| 3014 Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT); | 3014 Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT); |
| 3015 } | 3015 } |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3775 // In debug mode, make sure the lexical context is set. | 3775 // In debug mode, make sure the lexical context is set. |
| 3776 #ifdef DEBUG | 3776 #ifdef DEBUG |
| 3777 Cmp(scratch1, 0); | 3777 Cmp(scratch1, 0); |
| 3778 Check(ne, kWeShouldNotHaveAnEmptyLexicalContext); | 3778 Check(ne, kWeShouldNotHaveAnEmptyLexicalContext); |
| 3779 #endif | 3779 #endif |
| 3780 | 3780 |
| 3781 // Load the native context of the current context. | 3781 // Load the native context of the current context. |
| 3782 int offset = | 3782 int offset = |
| 3783 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | 3783 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; |
| 3784 Ldr(scratch1, FieldMemOperand(scratch1, offset)); | 3784 Ldr(scratch1, FieldMemOperand(scratch1, offset)); |
| 3785 Ldr(scratch1, FieldMemOperand(scratch1, GlobalObject::kNativeContextOffset)); | 3785 Ldr(scratch1, |
| 3786 FieldMemOperand(scratch1, JSGlobalObject::kNativeContextOffset)); |
| 3786 | 3787 |
| 3787 // Check the context is a native context. | 3788 // Check the context is a native context. |
| 3788 if (emit_debug_code()) { | 3789 if (emit_debug_code()) { |
| 3789 // Read the first word and compare to the native_context_map. | 3790 // Read the first word and compare to the native_context_map. |
| 3790 Ldr(scratch2, FieldMemOperand(scratch1, HeapObject::kMapOffset)); | 3791 Ldr(scratch2, FieldMemOperand(scratch1, HeapObject::kMapOffset)); |
| 3791 CompareRoot(scratch2, Heap::kNativeContextMapRootIndex); | 3792 CompareRoot(scratch2, Heap::kNativeContextMapRootIndex); |
| 3792 Check(eq, kExpectedNativeContext); | 3793 Check(eq, kExpectedNativeContext); |
| 3793 } | 3794 } |
| 3794 | 3795 |
| 3795 // Check if both contexts are the same. | 3796 // Check if both contexts are the same. |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4609 | 4610 |
| 4610 void MacroAssembler::LoadTransitionedArrayMapConditional( | 4611 void MacroAssembler::LoadTransitionedArrayMapConditional( |
| 4611 ElementsKind expected_kind, | 4612 ElementsKind expected_kind, |
| 4612 ElementsKind transitioned_kind, | 4613 ElementsKind transitioned_kind, |
| 4613 Register map_in_out, | 4614 Register map_in_out, |
| 4614 Register scratch1, | 4615 Register scratch1, |
| 4615 Register scratch2, | 4616 Register scratch2, |
| 4616 Label* no_map_match) { | 4617 Label* no_map_match) { |
| 4617 // Load the global or builtins object from the current context. | 4618 // Load the global or builtins object from the current context. |
| 4618 Ldr(scratch1, GlobalObjectMemOperand()); | 4619 Ldr(scratch1, GlobalObjectMemOperand()); |
| 4619 Ldr(scratch1, FieldMemOperand(scratch1, GlobalObject::kNativeContextOffset)); | 4620 Ldr(scratch1, |
| 4621 FieldMemOperand(scratch1, JSGlobalObject::kNativeContextOffset)); |
| 4620 | 4622 |
| 4621 // Check that the function's map is the same as the expected cached map. | 4623 // Check that the function's map is the same as the expected cached map. |
| 4622 Ldr(scratch1, ContextMemOperand(scratch1, Context::JS_ARRAY_MAPS_INDEX)); | 4624 Ldr(scratch1, ContextMemOperand(scratch1, Context::JS_ARRAY_MAPS_INDEX)); |
| 4623 int offset = (expected_kind * kPointerSize) + FixedArrayBase::kHeaderSize; | 4625 int offset = (expected_kind * kPointerSize) + FixedArrayBase::kHeaderSize; |
| 4624 Ldr(scratch2, FieldMemOperand(scratch1, offset)); | 4626 Ldr(scratch2, FieldMemOperand(scratch1, offset)); |
| 4625 Cmp(map_in_out, scratch2); | 4627 Cmp(map_in_out, scratch2); |
| 4626 B(ne, no_map_match); | 4628 B(ne, no_map_match); |
| 4627 | 4629 |
| 4628 // Use the transitioned cached map. | 4630 // Use the transitioned cached map. |
| 4629 offset = (transitioned_kind * kPointerSize) + FixedArrayBase::kHeaderSize; | 4631 offset = (transitioned_kind * kPointerSize) + FixedArrayBase::kHeaderSize; |
| 4630 Ldr(map_in_out, FieldMemOperand(scratch1, offset)); | 4632 Ldr(map_in_out, FieldMemOperand(scratch1, offset)); |
| 4631 } | 4633 } |
| 4632 | 4634 |
| 4633 | 4635 |
| 4634 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 4636 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
| 4635 // Load the global or builtins object from the current context. | 4637 // Load the global or builtins object from the current context. |
| 4636 Ldr(function, GlobalObjectMemOperand()); | 4638 Ldr(function, GlobalObjectMemOperand()); |
| 4637 // Load the native context from the global or builtins object. | 4639 // Load the native context from the global or builtins object. |
| 4638 Ldr(function, FieldMemOperand(function, | 4640 Ldr(function, |
| 4639 GlobalObject::kNativeContextOffset)); | 4641 FieldMemOperand(function, JSGlobalObject::kNativeContextOffset)); |
| 4640 // Load the function from the native context. | 4642 // Load the function from the native context. |
| 4641 Ldr(function, ContextMemOperand(function, index)); | 4643 Ldr(function, ContextMemOperand(function, index)); |
| 4642 } | 4644 } |
| 4643 | 4645 |
| 4644 | 4646 |
| 4645 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, | 4647 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, |
| 4646 Register map, | 4648 Register map, |
| 4647 Register scratch) { | 4649 Register scratch) { |
| 4648 // Load the initial map. The global functions all have initial maps. | 4650 // Load the initial map. The global functions all have initial maps. |
| 4649 Ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 4651 Ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5075 } | 5077 } |
| 5076 | 5078 |
| 5077 | 5079 |
| 5078 #undef __ | 5080 #undef __ |
| 5079 | 5081 |
| 5080 | 5082 |
| 5081 } // namespace internal | 5083 } // namespace internal |
| 5082 } // namespace v8 | 5084 } // namespace v8 |
| 5083 | 5085 |
| 5084 #endif // V8_TARGET_ARCH_ARM64 | 5086 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |