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_ARM_MACRO_ASSEMBLER_ARM_H_ | 5 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
6 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 6 #define V8_ARM_MACRO_ASSEMBLER_ARM_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 590 matching lines...) Loading... |
601 // remove in a register (or no_reg, if there is nothing to remove). | 601 // remove in a register (or no_reg, if there is nothing to remove). |
602 void LeaveExitFrame(bool save_doubles, Register argument_count, | 602 void LeaveExitFrame(bool save_doubles, Register argument_count, |
603 bool restore_context, | 603 bool restore_context, |
604 bool argument_count_is_length = false); | 604 bool argument_count_is_length = false); |
605 | 605 |
606 // Get the actual activation frame alignment for target environment. | 606 // Get the actual activation frame alignment for target environment. |
607 static int ActivationFrameAlignment(); | 607 static int ActivationFrameAlignment(); |
608 | 608 |
609 void LoadContext(Register dst, int context_chain_length); | 609 void LoadContext(Register dst, int context_chain_length); |
610 | 610 |
| 611 // Load the global object from the current context. |
| 612 void LoadGlobalObject(Register dst) { |
| 613 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
| 614 } |
| 615 |
611 // Load the global proxy from the current context. | 616 // Load the global proxy from the current context. |
612 void LoadGlobalProxy(Register dst); | 617 void LoadGlobalProxy(Register dst) { |
| 618 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
| 619 } |
613 | 620 |
614 // Conditionally load the cached Array transitioned map of type | 621 // Conditionally load the cached Array transitioned map of type |
615 // transitioned_kind from the native context if the map in register | 622 // transitioned_kind from the native context if the map in register |
616 // map_in_out is the cached Array map in the native context of | 623 // map_in_out is the cached Array map in the native context of |
617 // expected_kind. | 624 // expected_kind. |
618 void LoadTransitionedArrayMapConditional( | 625 void LoadTransitionedArrayMapConditional( |
619 ElementsKind expected_kind, | 626 ElementsKind expected_kind, |
620 ElementsKind transitioned_kind, | 627 ElementsKind transitioned_kind, |
621 Register map_in_out, | 628 Register map_in_out, |
622 Register scratch, | 629 Register scratch, |
623 Label* no_map_match); | 630 Label* no_map_match); |
624 | 631 |
625 void LoadGlobalFunction(int index, Register function); | 632 void LoadNativeContextSlot(int index, Register dst); |
626 | 633 |
627 // Load the initial map from the global function. The registers | 634 // Load the initial map from the global function. The registers |
628 // function and map can be the same, function is then overwritten. | 635 // function and map can be the same, function is then overwritten. |
629 void LoadGlobalFunctionInitialMap(Register function, | 636 void LoadGlobalFunctionInitialMap(Register function, |
630 Register map, | 637 Register map, |
631 Register scratch); | 638 Register scratch); |
632 | 639 |
633 void InitializeRootRegister() { | 640 void InitializeRootRegister() { |
634 ExternalReference roots_array_start = | 641 ExternalReference roots_array_start = |
635 ExternalReference::roots_array_start(isolate()); | 642 ExternalReference::roots_array_start(isolate()); |
(...skipping 502 matching lines...) Loading... |
1138 void MovFromFloatParameter(DwVfpRegister dst); | 1145 void MovFromFloatParameter(DwVfpRegister dst); |
1139 void MovFromFloatResult(DwVfpRegister dst); | 1146 void MovFromFloatResult(DwVfpRegister dst); |
1140 | 1147 |
1141 // Jump to a runtime routine. | 1148 // Jump to a runtime routine. |
1142 void JumpToExternalReference(const ExternalReference& builtin); | 1149 void JumpToExternalReference(const ExternalReference& builtin); |
1143 | 1150 |
1144 // Invoke specified builtin JavaScript function. | 1151 // Invoke specified builtin JavaScript function. |
1145 void InvokeBuiltin(int native_context_index, InvokeFlag flag, | 1152 void InvokeBuiltin(int native_context_index, InvokeFlag flag, |
1146 const CallWrapper& call_wrapper = NullCallWrapper()); | 1153 const CallWrapper& call_wrapper = NullCallWrapper()); |
1147 | 1154 |
1148 // Store the code object for the given builtin in the target register and | |
1149 // setup the function in r1. | |
1150 void GetBuiltinEntry(Register target, int native_context_index); | |
1151 | |
1152 // Store the function for the given builtin in the target register. | |
1153 void GetBuiltinFunction(Register target, int native_context_index); | |
1154 | |
1155 Handle<Object> CodeObject() { | 1155 Handle<Object> CodeObject() { |
1156 DCHECK(!code_object_.is_null()); | 1156 DCHECK(!code_object_.is_null()); |
1157 return code_object_; | 1157 return code_object_; |
1158 } | 1158 } |
1159 | 1159 |
1160 | 1160 |
1161 // Emit code for a truncating division by a constant. The dividend register is | 1161 // Emit code for a truncating division by a constant. The dividend register is |
1162 // unchanged and ip gets clobbered. Dividend and result must be different. | 1162 // unchanged and ip gets clobbered. Dividend and result must be different. |
1163 void TruncatingDiv(Register result, Register dividend, int32_t divisor); | 1163 void TruncatingDiv(Register result, Register dividend, int32_t divisor); |
1164 | 1164 |
(...skipping 361 matching lines...) Loading... |
1526 byte* address_; // The address of the code being patched. | 1526 byte* address_; // The address of the code being patched. |
1527 int size_; // Number of bytes of the expected patch size. | 1527 int size_; // Number of bytes of the expected patch size. |
1528 MacroAssembler masm_; // Macro assembler used to generate the code. | 1528 MacroAssembler masm_; // Macro assembler used to generate the code. |
1529 FlushICache flush_cache_; // Whether to flush the I cache after patching. | 1529 FlushICache flush_cache_; // Whether to flush the I cache after patching. |
1530 }; | 1530 }; |
1531 | 1531 |
1532 | 1532 |
1533 // ----------------------------------------------------------------------------- | 1533 // ----------------------------------------------------------------------------- |
1534 // Static helper functions. | 1534 // Static helper functions. |
1535 | 1535 |
1536 inline MemOperand ContextOperand(Register context, int index = 0) { | 1536 inline MemOperand ContextMemOperand(Register context, int index = 0) { |
1537 return MemOperand(context, Context::SlotOffset(index)); | 1537 return MemOperand(context, Context::SlotOffset(index)); |
1538 } | 1538 } |
1539 | 1539 |
1540 | 1540 |
1541 inline MemOperand GlobalObjectOperand() { | 1541 inline MemOperand NativeContextMemOperand() { |
1542 return ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX); | 1542 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
1543 } | 1543 } |
1544 | 1544 |
1545 | 1545 |
1546 #ifdef GENERATED_CODE_COVERAGE | 1546 #ifdef GENERATED_CODE_COVERAGE |
1547 #define CODE_COVERAGE_STRINGIFY(x) #x | 1547 #define CODE_COVERAGE_STRINGIFY(x) #x |
1548 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1548 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1549 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1549 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1550 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1550 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1551 #else | 1551 #else |
1552 #define ACCESS_MASM(masm) masm-> | 1552 #define ACCESS_MASM(masm) masm-> |
1553 #endif | 1553 #endif |
1554 | 1554 |
1555 | 1555 |
1556 } // namespace internal | 1556 } // namespace internal |
1557 } // namespace v8 | 1557 } // namespace v8 |
1558 | 1558 |
1559 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1559 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |