6#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
15class PoolPointerCall :
public ValueObject {
17 PoolPointerCall(
uword pc,
const Code&
code)
18 : end_(pc), object_pool_(ObjectPool::Handle(
code.GetObjectPool())) {
19 ASSERT(*
reinterpret_cast<uint16_t*
>(end_ - 2) == 0x9082);
20 uint32_t load_entry =
LoadUnaligned(
reinterpret_cast<uint32_t*
>(end_ - 6));
22 ASSERT((load_entry == 0x00362083) ||
23 (load_entry == 0x00b62083));
25 ASSERT((load_entry == 0x00763083) ||
26 (load_entry = 0x01763083));
31 intptr_t pp_index()
const {
return index_; }
34 return static_cast<CodePtr
>(object_pool_.ObjectAt(pp_index()));
37 void SetTarget(
const Code&
target)
const {
38 object_pool_.SetObjectAt(pp_index(),
target);
44 const ObjectPool& object_pool_;
52 ASSERT(
code.ContainsInstructionAt(return_address));
53 PoolPointerCall
call(return_address,
code);
59 const Code& new_target) {
65 const Code& new_target) {
66 ASSERT(
code.ContainsInstructionAt(return_address));
67 PoolPointerCall
call(return_address,
code);
68 call.SetTarget(new_target);
76 const Code& caller_code,
78 ASSERT(caller_code.ContainsInstructionAt(return_address));
79 ICCallPattern
call(return_address, caller_code);
80 if (
data !=
nullptr) {
83 return call.TargetCode();
87 const Code& caller_code,
91 thread->isolate_group()->RunWithStoppedMutators([&]() {
100 const Code& caller_code,
103 ASSERT(caller_code.ContainsInstructionAt(return_address));
104 ICCallPattern
call(return_address, caller_code);
111 ICData* ic_data_result) {
112 ASSERT(
code.ContainsInstructionAt(return_address));
113 ICCallPattern static_call(return_address,
code);
115 ic_data ^= static_call.Data();
116 if (ic_data_result !=
nullptr) {
117 *ic_data_result = ic_data.ptr();
119 return ic_data.GetTargetAt(0);
123 const Code& caller_code,
128 thread->isolate_group()->RunWithStoppedMutators([&]() {
136 uword return_address,
137 const Code& caller_code,
140 if (FLAG_precompiled_mode) {
141 BareSwitchableCallPattern
call(return_address);
145 SwitchableCallPattern
call(return_address, caller_code);
152 const Code& caller_code) {
153 if (FLAG_precompiled_mode) {
154 BareSwitchableCallPattern
call(return_address);
155 return call.target_entry();
157 SwitchableCallPattern
call(return_address, caller_code);
158 return call.target_entry();
163 const Code& caller_code) {
164 if (FLAG_precompiled_mode) {
165 BareSwitchableCallPattern
call(return_address);
168 SwitchableCallPattern
call(return_address, caller_code);
174 const Code& caller_code,
176 const Code& trampoline) {
178 ASSERT(caller_code.ContainsInstructionAt(return_address));
179 NativeCallPattern
call(return_address, caller_code);
180 call.set_target(trampoline);
186 const Code& caller_code,
188 ASSERT(caller_code.ContainsInstructionAt(return_address));
189 NativeCallPattern
call(return_address, caller_code);
191 return call.target();
static void PatchInstanceCallAt(uword return_address, const Code &caller_code, const Object &data, const Code &target)
static void PatchPoolPointerCallAt(uword return_address, const Code &code, const Code &new_target)
static CodePtr GetStaticCallTargetAt(uword return_address, const Code &code)
static void PatchSwitchableCallAtWithMutatorsStopped(Thread *thread, uword return_address, const Code &caller_code, const Object &data, const Code &target)
static void PatchInstanceCallAtWithMutatorsStopped(Thread *thread, uword return_address, const Code &caller_code, const Object &data, const Code &target)
static void PatchSwitchableCallAt(uword return_address, const Code &caller_code, const Object &data, const Code &target)
static FunctionPtr GetUnoptimizedStaticCallAt(uword return_address, const Code &code, ICData *ic_data)
static uword GetSwitchableCallTargetEntryAt(uword return_address, const Code &caller_code)
static ObjectPtr GetSwitchableCallDataAt(uword return_address, const Code &caller_code)
static void InsertDeoptimizationCallAt(uword start)
static CodePtr GetInstanceCallAt(uword return_address, const Code &caller_code, Object *data)
static CodePtr GetNativeCallAt(uword return_address, const Code &caller_code, NativeFunction *target)
static void PatchStaticCallAt(uword return_address, const Code &code, const Code &new_target)
static void PatchNativeCallAt(uword return_address, const Code &caller_code, NativeFunction target, const Code &trampoline)
static uword DecodeLoadWordFromPool(uword end, Register *reg, intptr_t *index)
void RunWithStoppedMutators(T single_current_mutator, S otherwise, bool use_force_growth_in_otherwise=false)
static Thread * Current()
IsolateGroup * isolate_group() const
static T LoadUnaligned(const T *ptr)
static int8_t data[kExtLength]
void(* NativeFunction)(NativeArguments *arguments)