5 #ifndef V8_TURBO_ASSEMBLER_H_ 6 #define V8_TURBO_ASSEMBLER_H_ 8 #include "src/assembler-arch.h" 9 #include "src/base/template-utils.h" 10 #include "src/builtins/builtins.h" 20 DCHECK(!options().v8_agnostic_code);
25 DCHECK(!code_object_.is_null());
29 bool root_array_available()
const {
return root_array_available_; }
30 void set_root_array_available(
bool v) { root_array_available_ = v; }
32 bool trap_on_abort()
const {
return trap_on_abort_; }
34 bool should_abort_hard()
const {
return hard_abort_; }
35 void set_abort_hard(
bool v) { hard_abort_ = v; }
37 void set_builtin_index(
int i) { maybe_builtin_index_ =
i; }
39 void set_has_frame(
bool v) { has_frame_ = v; }
40 bool has_frame()
const {
return has_frame_; }
45 void IndirectLoadExternalReference(
Register destination,
48 virtual void LoadFromConstantsTable(
Register destination,
49 int constant_index) = 0;
52 virtual void LoadRootRegisterOffset(
Register destination,
56 virtual void LoadRootRelative(
Register destination, int32_t offset) = 0;
58 virtual void LoadRoot(
Register destination, RootIndex index) = 0;
60 static int32_t RootRegisterOffsetForRootIndex(RootIndex root_index);
61 static int32_t RootRegisterOffsetForBuiltinIndex(
int builtin_index);
64 static intptr_t RootRegisterOffsetForExternalReference(
69 static int32_t RootRegisterOffsetForExternalReferenceTableEntry(
74 static bool IsAddressableThroughRootRegister(
81 buffer_size, CodeObjectRequired::kNo) {}
84 void* buffer,
int buffer_size,
85 CodeObjectRequired create_code_object);
87 void RecordCommentForOffHeapTrampoline(
int builtin_index);
89 Isolate*
const isolate_ =
nullptr;
95 bool root_array_available_ =
true;
98 bool trap_on_abort_ = FLAG_trap_on_abort;
101 bool hard_abort_ =
false;
104 int maybe_builtin_index_ = Builtins::kNoBuiltinId;
106 bool has_frame_ =
false;
117 : assembler_(assembler), old_value_(assembler->should_abort_hard()) {
118 assembler_->set_abort_hard(
true);
131 enum class StubCallMode { kCallOnHeapBuiltin, kCallWasmRuntimeStub };
134 template <
typename RegType,
typename... RegTypes,
136 typename =
typename std::enable_if<
139 inline bool AreAliased(RegType first_reg, RegTypes... regs) {
140 int num_different_regs = NumRegs(RegType::ListOf(first_reg, regs...));
141 int num_given_regs =
sizeof...(regs) + 1;
142 return num_different_regs < num_given_regs;
149 #endif // V8_TURBO_ASSEMBLER_H_