5 #ifndef V8_MACRO_ASSEMBLER_H_ 6 #define V8_MACRO_ASSEMBLER_H_ 8 #include "src/frames.h" 9 #include "src/heap/heap.h" 10 #include "src/turbo-assembler.h" 20 enum AllocationFlags {
22 NO_ALLOCATION_FLAGS = 0,
25 RESULT_CONTAINS_TOP = 1 << 0,
28 SIZE_IN_WORDS = 1 << 1,
30 DOUBLE_ALIGNMENT = 1 << 2,
36 #define INCLUDED_FROM_MACRO_ASSEMBLER_H 37 #if V8_TARGET_ARCH_IA32 38 #include "src/ia32/macro-assembler-ia32.h" 39 #elif V8_TARGET_ARCH_X64 40 #include "src/x64/macro-assembler-x64.h" 41 #elif V8_TARGET_ARCH_ARM64 42 #include "src/arm64/constants-arm64.h" 43 #include "src/arm64/macro-assembler-arm64.h" 44 #elif V8_TARGET_ARCH_ARM 45 #include "src/arm/constants-arm.h" 46 #include "src/arm/macro-assembler-arm.h" 47 #elif V8_TARGET_ARCH_PPC 48 #include "src/ppc/constants-ppc.h" 49 #include "src/ppc/macro-assembler-ppc.h" 50 #elif V8_TARGET_ARCH_MIPS 51 #include "src/mips/constants-mips.h" 52 #include "src/mips/macro-assembler-mips.h" 53 #elif V8_TARGET_ARCH_MIPS64 54 #include "src/mips64/constants-mips64.h" 55 #include "src/mips64/macro-assembler-mips64.h" 56 #elif V8_TARGET_ARCH_S390 57 #include "src/s390/constants-s390.h" 58 #include "src/s390/macro-assembler-s390.h" 60 #error Unsupported target architecture. 62 #undef INCLUDED_FROM_MACRO_ASSEMBLER_H 68 static constexpr
int kMaxCParameters = 9;
73 : tasm_(tasm), type_(
type), old_has_frame_(tasm->has_frame()) {
74 tasm->set_has_frame(
true);
75 if (
type != StackFrame::MANUAL && type_ != StackFrame::NONE) {
76 tasm->EnterFrame(
type);
81 if (type_ != StackFrame::MANUAL && type_ != StackFrame::NONE) {
82 tasm_->LeaveFrame(type_);
84 tasm_->set_has_frame(old_has_frame_);
92 void GenerateLeaveFrame() {
93 DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE);
94 tasm_->LeaveFrame(type_);
99 StackFrame::Type type_;
108 old_has_frame_(masm->has_frame()),
109 old_constant_pool_available_(FLAG_enable_embedded_constant_pool &&
110 masm->is_constant_pool_available()) {
111 masm->set_has_frame(
true);
112 if (FLAG_enable_embedded_constant_pool) {
113 masm->set_constant_pool_available(
true);
115 if (type_ != StackFrame::MANUAL && type_ != StackFrame::NONE) {
116 masm->EnterFrame(
type, !old_constant_pool_available_);
121 masm_->LeaveFrame(type_);
122 masm_->set_has_frame(old_has_frame_);
123 if (FLAG_enable_embedded_constant_pool) {
124 masm_->set_constant_pool_available(old_constant_pool_available_);
133 void GenerateLeaveFrame() {
134 DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE);
135 masm_->LeaveFrame(type_);
140 StackFrame::Type type_;
142 bool old_constant_pool_available_;
151 : assembler_(assembler),
152 old_constant_pool_available_(FLAG_enable_embedded_constant_pool &&
153 assembler->is_constant_pool_available()) {
154 if (FLAG_enable_embedded_constant_pool) {
155 assembler->set_constant_pool_available(
false);
159 if (FLAG_enable_embedded_constant_pool) {
160 assembler_->set_constant_pool_available(old_constant_pool_available_);
166 int old_constant_pool_available_;
182 : masm_(masm), saved_(masm->has_frame()) {
183 masm->set_has_frame(
false);
187 masm_->set_has_frame(saved_);
200 : masm_(masm), old_value_(masm->root_array_available()) {
201 masm->set_root_array_available(
false);
218 explicit ParameterCount(uint16_t imm) : reg_(no_reg), immediate_(imm) {}
220 bool is_reg()
const {
return reg_.is_valid(); }
221 bool is_immediate()
const {
return !is_reg(); }
227 uint16_t immediate()
const {
228 DCHECK(is_immediate());
234 const uint16_t immediate_;
242 #endif // V8_MACRO_ASSEMBLER_H_