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_X64_MACRO_ASSEMBLER_X64_H_ | 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ |
6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ | 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/flags.h" | 10 #include "src/base/flags.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 void InvokeFunction(Handle<JSFunction> function, | 391 void InvokeFunction(Handle<JSFunction> function, |
392 const ParameterCount& expected, | 392 const ParameterCount& expected, |
393 const ParameterCount& actual, | 393 const ParameterCount& actual, |
394 InvokeFlag flag, | 394 InvokeFlag flag, |
395 const CallWrapper& call_wrapper); | 395 const CallWrapper& call_wrapper); |
396 | 396 |
397 // Invoke specified builtin JavaScript function. | 397 // Invoke specified builtin JavaScript function. |
398 void InvokeBuiltin(int native_context_index, InvokeFlag flag, | 398 void InvokeBuiltin(int native_context_index, InvokeFlag flag, |
399 const CallWrapper& call_wrapper = NullCallWrapper()); | 399 const CallWrapper& call_wrapper = NullCallWrapper()); |
400 | 400 |
| 401 // Store the function for the given builtin in the target register. |
| 402 void GetBuiltinFunction(Register target, int native_context_index); |
| 403 |
401 // --------------------------------------------------------------------------- | 404 // --------------------------------------------------------------------------- |
402 // Smi tagging, untagging and operations on tagged smis. | 405 // Smi tagging, untagging and operations on tagged smis. |
403 | 406 |
404 // Support for constant splitting. | 407 // Support for constant splitting. |
405 bool IsUnsafeInt(const int32_t x); | 408 bool IsUnsafeInt(const int32_t x); |
406 void SafeMove(Register dst, Smi* src); | 409 void SafeMove(Register dst, Smi* src); |
407 void SafePush(Smi* src); | 410 void SafePush(Smi* src); |
408 | 411 |
409 // Conversions between tagged smi values and non-tagged integer values. | 412 // Conversions between tagged smi values and non-tagged integer values. |
410 | 413 |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 | 1347 |
1345 // Picks out an array index from the hash field. | 1348 // Picks out an array index from the hash field. |
1346 // Register use: | 1349 // Register use: |
1347 // hash - holds the index's hash. Clobbered. | 1350 // hash - holds the index's hash. Clobbered. |
1348 // index - holds the overwritten index on exit. | 1351 // index - holds the overwritten index on exit. |
1349 void IndexFromHash(Register hash, Register index); | 1352 void IndexFromHash(Register hash, Register index); |
1350 | 1353 |
1351 // Find the function context up the context chain. | 1354 // Find the function context up the context chain. |
1352 void LoadContext(Register dst, int context_chain_length); | 1355 void LoadContext(Register dst, int context_chain_length); |
1353 | 1356 |
1354 // Load the global object from the current context. | |
1355 void LoadGlobalObject(Register dst) { | |
1356 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); | |
1357 } | |
1358 | |
1359 // Load the global proxy from the current context. | 1357 // Load the global proxy from the current context. |
1360 void LoadGlobalProxy(Register dst) { | 1358 void LoadGlobalProxy(Register dst); |
1361 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); | |
1362 } | |
1363 | 1359 |
1364 // Conditionally load the cached Array transitioned map of type | 1360 // Conditionally load the cached Array transitioned map of type |
1365 // transitioned_kind from the native context if the map in register | 1361 // transitioned_kind from the native context if the map in register |
1366 // map_in_out is the cached Array map in the native context of | 1362 // map_in_out is the cached Array map in the native context of |
1367 // expected_kind. | 1363 // expected_kind. |
1368 void LoadTransitionedArrayMapConditional( | 1364 void LoadTransitionedArrayMapConditional( |
1369 ElementsKind expected_kind, | 1365 ElementsKind expected_kind, |
1370 ElementsKind transitioned_kind, | 1366 ElementsKind transitioned_kind, |
1371 Register map_in_out, | 1367 Register map_in_out, |
1372 Register scratch, | 1368 Register scratch, |
1373 Label* no_map_match); | 1369 Label* no_map_match); |
1374 | 1370 |
1375 // Load the native context slot with the current index. | 1371 // Load the global function with the given index. |
1376 void LoadNativeContextSlot(int index, Register dst); | 1372 void LoadGlobalFunction(int index, Register function); |
1377 | 1373 |
1378 // Load the initial map from the global function. The registers | 1374 // Load the initial map from the global function. The registers |
1379 // function and map can be the same. | 1375 // function and map can be the same. |
1380 void LoadGlobalFunctionInitialMap(Register function, Register map); | 1376 void LoadGlobalFunctionInitialMap(Register function, Register map); |
1381 | 1377 |
1382 // --------------------------------------------------------------------------- | 1378 // --------------------------------------------------------------------------- |
1383 // Runtime calls | 1379 // Runtime calls |
1384 | 1380 |
1385 // Call a code stub. | 1381 // Call a code stub. |
1386 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); | 1382 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 inline Operand ContextOperand(Register context, int index) { | 1687 inline Operand ContextOperand(Register context, int index) { |
1692 return Operand(context, Context::SlotOffset(index)); | 1688 return Operand(context, Context::SlotOffset(index)); |
1693 } | 1689 } |
1694 | 1690 |
1695 | 1691 |
1696 inline Operand ContextOperand(Register context, Register index) { | 1692 inline Operand ContextOperand(Register context, Register index) { |
1697 return Operand(context, index, times_pointer_size, Context::SlotOffset(0)); | 1693 return Operand(context, index, times_pointer_size, Context::SlotOffset(0)); |
1698 } | 1694 } |
1699 | 1695 |
1700 | 1696 |
1701 inline Operand NativeContextOperand() { | 1697 inline Operand GlobalObjectOperand() { |
1702 return ContextOperand(rsi, Context::NATIVE_CONTEXT_INDEX); | 1698 return ContextOperand(rsi, Context::GLOBAL_OBJECT_INDEX); |
1703 } | 1699 } |
1704 | 1700 |
1705 | 1701 |
1706 // Provides access to exit frame stack space (not GCed). | 1702 // Provides access to exit frame stack space (not GCed). |
1707 inline Operand StackSpaceOperand(int index) { | 1703 inline Operand StackSpaceOperand(int index) { |
1708 #ifdef _WIN64 | 1704 #ifdef _WIN64 |
1709 const int kShaddowSpace = 4; | 1705 const int kShaddowSpace = 4; |
1710 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); | 1706 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); |
1711 #else | 1707 #else |
1712 return Operand(rsp, index * kPointerSize); | 1708 return Operand(rsp, index * kPointerSize); |
(...skipping 23 matching lines...) Expand all Loading... |
1736 } \ | 1732 } \ |
1737 masm-> | 1733 masm-> |
1738 #else | 1734 #else |
1739 #define ACCESS_MASM(masm) masm-> | 1735 #define ACCESS_MASM(masm) masm-> |
1740 #endif | 1736 #endif |
1741 | 1737 |
1742 } // namespace internal | 1738 } // namespace internal |
1743 } // namespace v8 | 1739 } // namespace v8 |
1744 | 1740 |
1745 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1741 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |