OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_MACRO_ASSEMBLER_PPC_H_ | 5 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 6 #define V8_PPC_MACRO_ASSEMBLER_PPC_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/frames.h" | 10 #include "src/frames.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // remove in a register (or no_reg, if there is nothing to remove). | 423 // remove in a register (or no_reg, if there is nothing to remove). |
424 void LeaveExitFrame(bool save_doubles, Register argument_count, | 424 void LeaveExitFrame(bool save_doubles, Register argument_count, |
425 bool restore_context, | 425 bool restore_context, |
426 bool argument_count_is_length = false); | 426 bool argument_count_is_length = false); |
427 | 427 |
428 // Get the actual activation frame alignment for target environment. | 428 // Get the actual activation frame alignment for target environment. |
429 static int ActivationFrameAlignment(); | 429 static int ActivationFrameAlignment(); |
430 | 430 |
431 void LoadContext(Register dst, int context_chain_length); | 431 void LoadContext(Register dst, int context_chain_length); |
432 | 432 |
| 433 // Load the global object from the current context. |
| 434 void LoadGlobalObject(Register dst) { |
| 435 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
| 436 } |
| 437 |
433 // Load the global proxy from the current context. | 438 // Load the global proxy from the current context. |
434 void LoadGlobalProxy(Register dst); | 439 void LoadGlobalProxy(Register dst) { |
| 440 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
| 441 } |
435 | 442 |
436 // Conditionally load the cached Array transitioned map of type | 443 // Conditionally load the cached Array transitioned map of type |
437 // transitioned_kind from the native context if the map in register | 444 // transitioned_kind from the native context if the map in register |
438 // map_in_out is the cached Array map in the native context of | 445 // map_in_out is the cached Array map in the native context of |
439 // expected_kind. | 446 // expected_kind. |
440 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, | 447 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, |
441 ElementsKind transitioned_kind, | 448 ElementsKind transitioned_kind, |
442 Register map_in_out, | 449 Register map_in_out, |
443 Register scratch, | 450 Register scratch, |
444 Label* no_map_match); | 451 Label* no_map_match); |
445 | 452 |
446 void LoadGlobalFunction(int index, Register function); | 453 void LoadNativeContextSlot(int index, Register dst); |
447 | 454 |
448 // Load the initial map from the global function. The registers | 455 // Load the initial map from the global function. The registers |
449 // function and map can be the same, function is then overwritten. | 456 // function and map can be the same, function is then overwritten. |
450 void LoadGlobalFunctionInitialMap(Register function, Register map, | 457 void LoadGlobalFunctionInitialMap(Register function, Register map, |
451 Register scratch); | 458 Register scratch); |
452 | 459 |
453 void InitializeRootRegister() { | 460 void InitializeRootRegister() { |
454 ExternalReference roots_array_start = | 461 ExternalReference roots_array_start = |
455 ExternalReference::roots_array_start(isolate()); | 462 ExternalReference::roots_array_start(isolate()); |
456 mov(kRootRegister, Operand(roots_array_start)); | 463 mov(kRootRegister, Operand(roots_array_start)); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 void MovFromFloatParameter(DoubleRegister dst); | 998 void MovFromFloatParameter(DoubleRegister dst); |
992 void MovFromFloatResult(DoubleRegister dst); | 999 void MovFromFloatResult(DoubleRegister dst); |
993 | 1000 |
994 // Jump to a runtime routine. | 1001 // Jump to a runtime routine. |
995 void JumpToExternalReference(const ExternalReference& builtin); | 1002 void JumpToExternalReference(const ExternalReference& builtin); |
996 | 1003 |
997 // Invoke specified builtin JavaScript function. | 1004 // Invoke specified builtin JavaScript function. |
998 void InvokeBuiltin(int native_context_index, InvokeFlag flag, | 1005 void InvokeBuiltin(int native_context_index, InvokeFlag flag, |
999 const CallWrapper& call_wrapper = NullCallWrapper()); | 1006 const CallWrapper& call_wrapper = NullCallWrapper()); |
1000 | 1007 |
1001 // Store the code object for the given builtin in the target register and | |
1002 // setup the function in r1. | |
1003 void GetBuiltinEntry(Register target, int native_context_index); | |
1004 | |
1005 // Store the function for the given builtin in the target register. | |
1006 void GetBuiltinFunction(Register target, int native_context_index); | |
1007 | |
1008 Handle<Object> CodeObject() { | 1008 Handle<Object> CodeObject() { |
1009 DCHECK(!code_object_.is_null()); | 1009 DCHECK(!code_object_.is_null()); |
1010 return code_object_; | 1010 return code_object_; |
1011 } | 1011 } |
1012 | 1012 |
1013 | 1013 |
1014 // Emit code for a truncating division by a constant. The dividend register is | 1014 // Emit code for a truncating division by a constant. The dividend register is |
1015 // unchanged and ip gets clobbered. Dividend and result must be different. | 1015 // unchanged and ip gets clobbered. Dividend and result must be different. |
1016 void TruncatingDiv(Register result, Register dividend, int32_t divisor); | 1016 void TruncatingDiv(Register result, Register dividend, int32_t divisor); |
1017 | 1017 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 byte* address_; // The address of the code being patched. | 1560 byte* address_; // The address of the code being patched. |
1561 int size_; // Number of bytes of the expected patch size. | 1561 int size_; // Number of bytes of the expected patch size. |
1562 MacroAssembler masm_; // Macro assembler used to generate the code. | 1562 MacroAssembler masm_; // Macro assembler used to generate the code. |
1563 FlushICache flush_cache_; // Whether to flush the I cache after patching. | 1563 FlushICache flush_cache_; // Whether to flush the I cache after patching. |
1564 }; | 1564 }; |
1565 | 1565 |
1566 | 1566 |
1567 // ----------------------------------------------------------------------------- | 1567 // ----------------------------------------------------------------------------- |
1568 // Static helper functions. | 1568 // Static helper functions. |
1569 | 1569 |
1570 inline MemOperand ContextOperand(Register context, int index = 0) { | 1570 inline MemOperand ContextMemOperand(Register context, int index = 0) { |
1571 return MemOperand(context, Context::SlotOffset(index)); | 1571 return MemOperand(context, Context::SlotOffset(index)); |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 inline MemOperand GlobalObjectOperand() { | 1575 inline MemOperand NativeContextMemOperand() { |
1576 return ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX); | 1576 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
1577 } | 1577 } |
1578 | 1578 |
1579 | 1579 |
1580 #ifdef GENERATED_CODE_COVERAGE | 1580 #ifdef GENERATED_CODE_COVERAGE |
1581 #define CODE_COVERAGE_STRINGIFY(x) #x | 1581 #define CODE_COVERAGE_STRINGIFY(x) #x |
1582 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1582 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1583 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1583 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1584 #define ACCESS_MASM(masm) \ | 1584 #define ACCESS_MASM(masm) \ |
1585 masm->stop(__FILE_LINE__); \ | 1585 masm->stop(__FILE_LINE__); \ |
1586 masm-> | 1586 masm-> |
1587 #else | 1587 #else |
1588 #define ACCESS_MASM(masm) masm-> | 1588 #define ACCESS_MASM(masm) masm-> |
1589 #endif | 1589 #endif |
1590 } // namespace internal | 1590 } // namespace internal |
1591 } // namespace v8 | 1591 } // namespace v8 |
1592 | 1592 |
1593 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1593 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |