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

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1480003002: [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. Created 5 years 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/arm64/code-stubs-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 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/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
11 #include "src/full-codegen/full-codegen.h" 11 #include "src/full-codegen/full-codegen.h"
12 #include "src/runtime/runtime.h" 12 #include "src/runtime/runtime.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 17
18 #define __ ACCESS_MASM(masm) 18 #define __ ACCESS_MASM(masm)
19 19
20 20
21 // Load the built-in Array function from the current context. 21 // Load the built-in Array function from the current context.
22 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) { 22 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
23 // Load the native context.
24 __ Ldr(result, GlobalObjectMemOperand());
25 __ Ldr(result, FieldMemOperand(result, JSGlobalObject::kNativeContextOffset));
26 // Load the InternalArray function from the native context. 23 // Load the InternalArray function from the native context.
27 __ Ldr(result, 24 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
28 MemOperand(result,
29 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX)));
30 } 25 }
31 26
32 27
33 // Load the built-in InternalArray function from the current context. 28 // Load the built-in InternalArray function from the current context.
34 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, 29 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
35 Register result) { 30 Register result) {
36 // Load the native context.
37 __ Ldr(result, GlobalObjectMemOperand());
38 __ Ldr(result, FieldMemOperand(result, JSGlobalObject::kNativeContextOffset));
39 // Load the InternalArray function from the native context. 31 // Load the InternalArray function from the native context.
40 __ Ldr(result, ContextMemOperand(result, 32 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
41 Context::INTERNAL_ARRAY_FUNCTION_INDEX));
42 } 33 }
43 34
44 35
45 void Builtins::Generate_Adaptor(MacroAssembler* masm, 36 void Builtins::Generate_Adaptor(MacroAssembler* masm,
46 CFunctionId id, 37 CFunctionId id,
47 BuiltinExtraArguments extra_args) { 38 BuiltinExtraArguments extra_args) {
48 // ----------- S t a t e ------------- 39 // ----------- S t a t e -------------
49 // -- x0 : number of arguments excluding receiver 40 // -- x0 : number of arguments excluding receiver
50 // (only guaranteed when the called function 41 // (only guaranteed when the called function
51 // is not marked as DontAdaptArguments) 42 // is not marked as DontAdaptArguments)
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 CompatibleReceiverCheck(masm, x2, x3, x4, x5, x6, &receiver_check_failed); 1206 CompatibleReceiverCheck(masm, x2, x3, x4, x5, x6, &receiver_check_failed);
1216 1207
1217 // Get the callback offset from the FunctionTemplateInfo, and jump to the 1208 // Get the callback offset from the FunctionTemplateInfo, and jump to the
1218 // beginning of the code. 1209 // beginning of the code.
1219 __ Ldr(x4, FieldMemOperand(x3, FunctionTemplateInfo::kCallCodeOffset)); 1210 __ Ldr(x4, FieldMemOperand(x3, FunctionTemplateInfo::kCallCodeOffset));
1220 __ Ldr(x4, FieldMemOperand(x4, CallHandlerInfo::kFastHandlerOffset)); 1211 __ Ldr(x4, FieldMemOperand(x4, CallHandlerInfo::kFastHandlerOffset));
1221 __ Add(x4, x4, Operand(Code::kHeaderSize - kHeapObjectTag)); 1212 __ Add(x4, x4, Operand(Code::kHeaderSize - kHeapObjectTag));
1222 __ Jump(x4); 1213 __ Jump(x4);
1223 1214
1224 __ Bind(&set_global_proxy); 1215 __ Bind(&set_global_proxy);
1225 __ Ldr(x2, GlobalObjectMemOperand()); 1216 __ LoadGlobalProxy(x2);
1226 __ Ldr(x2, FieldMemOperand(x2, JSGlobalObject::kGlobalProxyOffset));
1227 __ Str(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2)); 1217 __ Str(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2));
1228 __ B(&valid_receiver); 1218 __ B(&valid_receiver);
1229 1219
1230 // Compatible receiver check failed: throw an Illegal Invocation exception. 1220 // Compatible receiver check failed: throw an Illegal Invocation exception.
1231 __ Bind(&receiver_check_failed); 1221 __ Bind(&receiver_check_failed);
1232 // Drop the arguments (including the receiver) 1222 // Drop the arguments (including the receiver)
1233 __ add(x0, x0, Operand(1)); 1223 __ add(x0, x0, Operand(1));
1234 __ Drop(x0); 1224 __ Drop(x0);
1235 __ TailCallRuntime(Runtime::kThrowIllegalInvocation, 0, 1); 1225 __ TailCallRuntime(Runtime::kThrowIllegalInvocation, 0, 1);
1236 } 1226 }
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 1703
1714 // 2. Call to something else, which might have a [[Call]] internal method (if 1704 // 2. Call to something else, which might have a [[Call]] internal method (if
1715 // not we raise an exception). 1705 // not we raise an exception).
1716 __ Bind(&non_function); 1706 __ Bind(&non_function);
1717 // Check if target has a [[Call]] internal method. 1707 // Check if target has a [[Call]] internal method.
1718 __ Ldrb(x4, FieldMemOperand(x4, Map::kBitFieldOffset)); 1708 __ Ldrb(x4, FieldMemOperand(x4, Map::kBitFieldOffset));
1719 __ TestAndBranchIfAllClear(x4, 1 << Map::kIsCallable, &non_callable); 1709 __ TestAndBranchIfAllClear(x4, 1 << Map::kIsCallable, &non_callable);
1720 // Overwrite the original receiver with the (original) target. 1710 // Overwrite the original receiver with the (original) target.
1721 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2)); 1711 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2));
1722 // Let the "call_as_function_delegate" take care of the rest. 1712 // Let the "call_as_function_delegate" take care of the rest.
1723 __ LoadGlobalFunction(Context::CALL_AS_FUNCTION_DELEGATE_INDEX, x1); 1713 __ LoadNativeContextSlot(Context::CALL_AS_FUNCTION_DELEGATE_INDEX, x1);
1724 __ Jump(masm->isolate()->builtins()->CallFunction( 1714 __ Jump(masm->isolate()->builtins()->CallFunction(
1725 ConvertReceiverMode::kNotNullOrUndefined), 1715 ConvertReceiverMode::kNotNullOrUndefined),
1726 RelocInfo::CODE_TARGET); 1716 RelocInfo::CODE_TARGET);
1727 1717
1728 // 3. Call to something that is not callable. 1718 // 3. Call to something that is not callable.
1729 __ bind(&non_callable); 1719 __ bind(&non_callable);
1730 { 1720 {
1731 FrameScope scope(masm, StackFrame::INTERNAL); 1721 FrameScope scope(masm, StackFrame::INTERNAL);
1732 __ Push(x1); 1722 __ Push(x1);
1733 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); 1723 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 1785
1796 // Check if target has a [[Construct]] internal method. 1786 // Check if target has a [[Construct]] internal method.
1797 __ Ldrb(x2, FieldMemOperand(x4, Map::kBitFieldOffset)); 1787 __ Ldrb(x2, FieldMemOperand(x4, Map::kBitFieldOffset));
1798 __ TestAndBranchIfAllClear(x2, 1 << Map::kIsConstructor, &non_constructor); 1788 __ TestAndBranchIfAllClear(x2, 1 << Map::kIsConstructor, &non_constructor);
1799 1789
1800 // Called Construct on an exotic Object with a [[Construct]] internal method. 1790 // Called Construct on an exotic Object with a [[Construct]] internal method.
1801 { 1791 {
1802 // Overwrite the original receiver with the (original) target. 1792 // Overwrite the original receiver with the (original) target.
1803 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2)); 1793 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2));
1804 // Let the "call_as_constructor_delegate" take care of the rest. 1794 // Let the "call_as_constructor_delegate" take care of the rest.
1805 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, x1); 1795 __ LoadNativeContextSlot(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, x1);
1806 __ Jump(masm->isolate()->builtins()->CallFunction(), 1796 __ Jump(masm->isolate()->builtins()->CallFunction(),
1807 RelocInfo::CODE_TARGET); 1797 RelocInfo::CODE_TARGET);
1808 } 1798 }
1809 1799
1810 // Called Construct on an Object that doesn't have a [[Construct]] internal 1800 // Called Construct on an Object that doesn't have a [[Construct]] internal
1811 // method. 1801 // method.
1812 __ bind(&non_constructor); 1802 __ bind(&non_constructor);
1813 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), 1803 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(),
1814 RelocInfo::CODE_TARGET); 1804 RelocInfo::CODE_TARGET);
1815 } 1805 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 } 2044 }
2055 } 2045 }
2056 2046
2057 2047
2058 #undef __ 2048 #undef __
2059 2049
2060 } // namespace internal 2050 } // namespace internal
2061 } // namespace v8 2051 } // namespace v8
2062 2052
2063 #endif // V8_TARGET_ARCH_ARM 2053 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698