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_X87_MACRO_ASSEMBLER_X87_H_ | 5 #ifndef V8_X87_MACRO_ASSEMBLER_X87_H_ |
6 #define V8_X87_MACRO_ASSEMBLER_X87_H_ | 6 #define V8_X87_MACRO_ASSEMBLER_X87_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 Register reg6 = no_reg, Register reg7 = no_reg, | 53 Register reg6 = no_reg, Register reg7 = no_reg, |
54 Register reg8 = no_reg); | 54 Register reg8 = no_reg); |
55 #endif | 55 #endif |
56 | 56 |
57 // MacroAssembler implements a collection of frequently used macros. | 57 // MacroAssembler implements a collection of frequently used macros. |
58 class MacroAssembler: public Assembler { | 58 class MacroAssembler: public Assembler { |
59 public: | 59 public: |
60 MacroAssembler(Isolate* isolate, void* buffer, int size, | 60 MacroAssembler(Isolate* isolate, void* buffer, int size, |
61 CodeObjectRequired create_code_object); | 61 CodeObjectRequired create_code_object); |
62 | 62 |
| 63 Isolate* isolate() const { return isolate_; } |
| 64 |
63 void Load(Register dst, const Operand& src, Representation r); | 65 void Load(Register dst, const Operand& src, Representation r); |
64 void Store(Register src, const Operand& dst, Representation r); | 66 void Store(Register src, const Operand& dst, Representation r); |
65 | 67 |
66 // Load a register with a long value as efficiently as possible. | 68 // Load a register with a long value as efficiently as possible. |
67 void Set(Register dst, int32_t x) { | 69 void Set(Register dst, int32_t x) { |
68 if (x == 0) { | 70 if (x == 0) { |
69 xor_(dst, dst); | 71 xor_(dst, dst); |
70 } else { | 72 } else { |
71 mov(dst, Immediate(x)); | 73 mov(dst, Immediate(x)); |
72 } | 74 } |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 // On entry, receiver_reg should point to the array object. | 855 // On entry, receiver_reg should point to the array object. |
854 // scratch_reg gets clobbered. | 856 // scratch_reg gets clobbered. |
855 // If allocation info is present, conditional code is set to equal. | 857 // If allocation info is present, conditional code is set to equal. |
856 void TestJSArrayForAllocationMemento(Register receiver_reg, | 858 void TestJSArrayForAllocationMemento(Register receiver_reg, |
857 Register scratch_reg, | 859 Register scratch_reg, |
858 Label* no_memento_found); | 860 Label* no_memento_found); |
859 | 861 |
860 private: | 862 private: |
861 bool generating_stub_; | 863 bool generating_stub_; |
862 bool has_frame_; | 864 bool has_frame_; |
| 865 Isolate* isolate_; |
863 // This handle will be patched with the code object on installation. | 866 // This handle will be patched with the code object on installation. |
864 Handle<Object> code_object_; | 867 Handle<Object> code_object_; |
865 | 868 |
866 // Helper functions for generating invokes. | 869 // Helper functions for generating invokes. |
867 void InvokePrologue(const ParameterCount& expected, | 870 void InvokePrologue(const ParameterCount& expected, |
868 const ParameterCount& actual, Label* done, | 871 const ParameterCount& actual, Label* done, |
869 bool* definitely_mismatches, InvokeFlag flag, | 872 bool* definitely_mismatches, InvokeFlag flag, |
870 Label::Distance done_distance, | 873 Label::Distance done_distance, |
871 const CallWrapper& call_wrapper); | 874 const CallWrapper& call_wrapper); |
872 | 875 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 inline Operand NativeContextOperand() { | 956 inline Operand NativeContextOperand() { |
954 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); | 957 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); |
955 } | 958 } |
956 | 959 |
957 #define ACCESS_MASM(masm) masm-> | 960 #define ACCESS_MASM(masm) masm-> |
958 | 961 |
959 } // namespace internal | 962 } // namespace internal |
960 } // namespace v8 | 963 } // namespace v8 |
961 | 964 |
962 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ | 965 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ |
OLD | NEW |