OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
(...skipping 107 matching lines...) Loading... |
118 // ----------------------------------------------------------------------------- | 118 // ----------------------------------------------------------------------------- |
119 // Static helper functions. | 119 // Static helper functions. |
120 | 120 |
121 #if defined(V8_TARGET_LITTLE_ENDIAN) | 121 #if defined(V8_TARGET_LITTLE_ENDIAN) |
122 #define SmiWordOffset(offset) (offset + kPointerSize / 2) | 122 #define SmiWordOffset(offset) (offset + kPointerSize / 2) |
123 #else | 123 #else |
124 #define SmiWordOffset(offset) offset | 124 #define SmiWordOffset(offset) offset |
125 #endif | 125 #endif |
126 | 126 |
127 | 127 |
128 inline MemOperand ContextOperand(Register context, int index) { | 128 inline MemOperand ContextMemOperand(Register context, int index) { |
129 return MemOperand(context, Context::SlotOffset(index)); | 129 return MemOperand(context, Context::SlotOffset(index)); |
130 } | 130 } |
131 | 131 |
132 | 132 |
133 inline MemOperand GlobalObjectOperand() { | 133 inline MemOperand NativeContextMemOperand() { |
134 return ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX); | 134 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
135 } | 135 } |
136 | 136 |
137 | 137 |
138 // Generate a MemOperand for loading a field from an object. | 138 // Generate a MemOperand for loading a field from an object. |
139 inline MemOperand FieldMemOperand(Register object, int offset) { | 139 inline MemOperand FieldMemOperand(Register object, int offset) { |
140 return MemOperand(object, offset - kHeapObjectTag); | 140 return MemOperand(object, offset - kHeapObjectTag); |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 inline MemOperand UntagSmiMemOperand(Register rm, int offset) { | 144 inline MemOperand UntagSmiMemOperand(Register rm, int offset) { |
(...skipping 833 matching lines...) Loading... |
978 bool argument_count_is_length = false); | 978 bool argument_count_is_length = false); |
979 | 979 |
980 // Get the actual activation frame alignment for target environment. | 980 // Get the actual activation frame alignment for target environment. |
981 static int ActivationFrameAlignment(); | 981 static int ActivationFrameAlignment(); |
982 | 982 |
983 // Make sure the stack is aligned. Only emits code in debug mode. | 983 // Make sure the stack is aligned. Only emits code in debug mode. |
984 void AssertStackIsAligned(); | 984 void AssertStackIsAligned(); |
985 | 985 |
986 void LoadContext(Register dst, int context_chain_length); | 986 void LoadContext(Register dst, int context_chain_length); |
987 | 987 |
| 988 // Load the global object from the current context. |
| 989 void LoadGlobalObject(Register dst) { |
| 990 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
| 991 } |
| 992 |
988 // Load the global proxy from the current context. | 993 // Load the global proxy from the current context. |
989 void LoadGlobalProxy(Register dst); | 994 void LoadGlobalProxy(Register dst) { |
| 995 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
| 996 } |
990 | 997 |
991 // Conditionally load the cached Array transitioned map of type | 998 // Conditionally load the cached Array transitioned map of type |
992 // transitioned_kind from the native context if the map in register | 999 // transitioned_kind from the native context if the map in register |
993 // map_in_out is the cached Array map in the native context of | 1000 // map_in_out is the cached Array map in the native context of |
994 // expected_kind. | 1001 // expected_kind. |
995 void LoadTransitionedArrayMapConditional( | 1002 void LoadTransitionedArrayMapConditional( |
996 ElementsKind expected_kind, | 1003 ElementsKind expected_kind, |
997 ElementsKind transitioned_kind, | 1004 ElementsKind transitioned_kind, |
998 Register map_in_out, | 1005 Register map_in_out, |
999 Register scratch, | 1006 Register scratch, |
1000 Label* no_map_match); | 1007 Label* no_map_match); |
1001 | 1008 |
1002 void LoadGlobalFunction(int index, Register function); | 1009 void LoadNativeContextSlot(int index, Register dst); |
1003 | 1010 |
1004 // Load the initial map from the global function. The registers | 1011 // Load the initial map from the global function. The registers |
1005 // function and map can be the same, function is then overwritten. | 1012 // function and map can be the same, function is then overwritten. |
1006 void LoadGlobalFunctionInitialMap(Register function, | 1013 void LoadGlobalFunctionInitialMap(Register function, |
1007 Register map, | 1014 Register map, |
1008 Register scratch); | 1015 Register scratch); |
1009 | 1016 |
1010 void InitializeRootRegister() { | 1017 void InitializeRootRegister() { |
1011 ExternalReference roots_array_start = | 1018 ExternalReference roots_array_start = |
1012 ExternalReference::roots_array_start(isolate()); | 1019 ExternalReference::roots_array_start(isolate()); |
(...skipping 377 matching lines...) Loading... |
1390 void MovToFloatResult(DoubleRegister src); | 1397 void MovToFloatResult(DoubleRegister src); |
1391 | 1398 |
1392 // Jump to the builtin routine. | 1399 // Jump to the builtin routine. |
1393 void JumpToExternalReference(const ExternalReference& builtin, | 1400 void JumpToExternalReference(const ExternalReference& builtin, |
1394 BranchDelaySlot bd = PROTECT); | 1401 BranchDelaySlot bd = PROTECT); |
1395 | 1402 |
1396 // Invoke specified builtin JavaScript function. | 1403 // Invoke specified builtin JavaScript function. |
1397 void InvokeBuiltin(int native_context_index, InvokeFlag flag, | 1404 void InvokeBuiltin(int native_context_index, InvokeFlag flag, |
1398 const CallWrapper& call_wrapper = NullCallWrapper()); | 1405 const CallWrapper& call_wrapper = NullCallWrapper()); |
1399 | 1406 |
1400 // Store the code object for the given builtin in the target register and | |
1401 // setup the function in a1. | |
1402 void GetBuiltinEntry(Register target, int native_context_index); | |
1403 | |
1404 // Store the function for the given builtin in the target register. | |
1405 void GetBuiltinFunction(Register target, int native_context_index); | |
1406 | |
1407 struct Unresolved { | 1407 struct Unresolved { |
1408 int pc; | 1408 int pc; |
1409 uint32_t flags; // See Bootstrapper::FixupFlags decoders/encoders. | 1409 uint32_t flags; // See Bootstrapper::FixupFlags decoders/encoders. |
1410 const char* name; | 1410 const char* name; |
1411 }; | 1411 }; |
1412 | 1412 |
1413 Handle<Object> CodeObject() { | 1413 Handle<Object> CodeObject() { |
1414 DCHECK(!code_object_.is_null()); | 1414 DCHECK(!code_object_.is_null()); |
1415 return code_object_; | 1415 return code_object_; |
1416 } | 1416 } |
(...skipping 427 matching lines...) Loading... |
1844 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1844 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1845 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1845 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1846 #else | 1846 #else |
1847 #define ACCESS_MASM(masm) masm-> | 1847 #define ACCESS_MASM(masm) masm-> |
1848 #endif | 1848 #endif |
1849 | 1849 |
1850 } // namespace internal | 1850 } // namespace internal |
1851 } // namespace v8 | 1851 } // namespace v8 |
1852 | 1852 |
1853 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1853 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |