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_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; | 38 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
39 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; | 39 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
40 enum PointersToHereCheck { | 40 enum PointersToHereCheck { |
41 kPointersToHereMaybeInteresting, | 41 kPointersToHereMaybeInteresting, |
42 kPointersToHereAreAlwaysInteresting | 42 kPointersToHereAreAlwaysInteresting |
43 }; | 43 }; |
44 | 44 |
45 enum RegisterValueType { REGISTER_VALUE_IS_SMI, REGISTER_VALUE_IS_INT32 }; | 45 enum RegisterValueType { REGISTER_VALUE_IS_SMI, REGISTER_VALUE_IS_INT32 }; |
46 | 46 |
| 47 enum class ReturnAddressState { kOnStack, kNotOnStack }; |
| 48 |
47 #ifdef DEBUG | 49 #ifdef DEBUG |
48 bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg, | 50 bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg, |
49 Register reg4 = no_reg, Register reg5 = no_reg, | 51 Register reg4 = no_reg, Register reg5 = no_reg, |
50 Register reg6 = no_reg, Register reg7 = no_reg, | 52 Register reg6 = no_reg, Register reg7 = no_reg, |
51 Register reg8 = no_reg); | 53 Register reg8 = no_reg); |
52 #endif | 54 #endif |
53 | 55 |
54 // MacroAssembler implements a collection of frequently used macros. | 56 // MacroAssembler implements a collection of frequently used macros. |
55 class MacroAssembler: public Assembler { | 57 class MacroAssembler: public Assembler { |
56 public: | 58 public: |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 318 |
317 void GetWeakValue(Register value, Handle<WeakCell> cell); | 319 void GetWeakValue(Register value, Handle<WeakCell> cell); |
318 | 320 |
319 // Load the value of the weak cell in the value register. Branch to the given | 321 // Load the value of the weak cell in the value register. Branch to the given |
320 // miss label if the weak cell was cleared. | 322 // miss label if the weak cell was cleared. |
321 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); | 323 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); |
322 | 324 |
323 // --------------------------------------------------------------------------- | 325 // --------------------------------------------------------------------------- |
324 // JavaScript invokes | 326 // JavaScript invokes |
325 | 327 |
| 328 // Removes current frame and its arguments from the stack preserving |
| 329 // the arguments and a return address pushed to the stack for the next call. |
| 330 // |ra_state| defines whether return address is already pushed to stack or |
| 331 // not. Both |callee_args_count| and |caller_args_count_reg| do not include |
| 332 // receiver. |callee_args_count| is not modified, |caller_args_count_reg| |
| 333 // is trashed. |
| 334 void PrepareForTailCall(const ParameterCount& callee_args_count, |
| 335 Register caller_args_count_reg, Register scratch0, |
| 336 Register scratch1, ReturnAddressState ra_state); |
| 337 |
326 // Invoke the JavaScript function code by either calling or jumping. | 338 // Invoke the JavaScript function code by either calling or jumping. |
327 | 339 |
328 void InvokeFunctionCode(Register function, Register new_target, | 340 void InvokeFunctionCode(Register function, Register new_target, |
329 const ParameterCount& expected, | 341 const ParameterCount& expected, |
330 const ParameterCount& actual, InvokeFlag flag, | 342 const ParameterCount& actual, InvokeFlag flag, |
331 const CallWrapper& call_wrapper); | 343 const CallWrapper& call_wrapper); |
332 | 344 |
333 void FloodFunctionIfStepping(Register fun, Register new_target, | 345 void FloodFunctionIfStepping(Register fun, Register new_target, |
334 const ParameterCount& expected, | 346 const ParameterCount& expected, |
335 const ParameterCount& actual); | 347 const ParameterCount& actual); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 782 |
771 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); } | 783 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); } |
772 void Lzcnt(Register dst, const Operand& src); | 784 void Lzcnt(Register dst, const Operand& src); |
773 | 785 |
774 void Tzcnt(Register dst, Register src) { Tzcnt(dst, Operand(src)); } | 786 void Tzcnt(Register dst, Register src) { Tzcnt(dst, Operand(src)); } |
775 void Tzcnt(Register dst, const Operand& src); | 787 void Tzcnt(Register dst, const Operand& src); |
776 | 788 |
777 void Popcnt(Register dst, Register src) { Popcnt(dst, Operand(src)); } | 789 void Popcnt(Register dst, Register src) { Popcnt(dst, Operand(src)); } |
778 void Popcnt(Register dst, const Operand& src); | 790 void Popcnt(Register dst, const Operand& src); |
779 | 791 |
780 // Emit call to the code we are currently generating. | |
781 void CallSelf() { | |
782 Handle<Code> self(reinterpret_cast<Code**>(CodeObject().location())); | |
783 call(self, RelocInfo::CODE_TARGET); | |
784 } | |
785 | |
786 // Move if the registers are not identical. | 792 // Move if the registers are not identical. |
787 void Move(Register target, Register source); | 793 void Move(Register target, Register source); |
788 | 794 |
789 // Move a constant into a destination using the most efficient encoding. | 795 // Move a constant into a destination using the most efficient encoding. |
790 void Move(Register dst, const Immediate& x); | 796 void Move(Register dst, const Immediate& x); |
791 void Move(const Operand& dst, const Immediate& x); | 797 void Move(const Operand& dst, const Immediate& x); |
792 | 798 |
793 // Move an immediate into an XMM register. | 799 // Move an immediate into an XMM register. |
794 void Move(XMMRegister dst, uint32_t src); | 800 void Move(XMMRegister dst, uint32_t src); |
795 void Move(XMMRegister dst, uint64_t src); | 801 void Move(XMMRegister dst, uint64_t src); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 } \ | 1035 } \ |
1030 masm-> | 1036 masm-> |
1031 #else | 1037 #else |
1032 #define ACCESS_MASM(masm) masm-> | 1038 #define ACCESS_MASM(masm) masm-> |
1033 #endif | 1039 #endif |
1034 | 1040 |
1035 } // namespace internal | 1041 } // namespace internal |
1036 } // namespace v8 | 1042 } // namespace v8 |
1037 | 1043 |
1038 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1044 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |