[vm] Cleanup conversion of deopt info to catch entry moves
Follow-up to https://dart-review.googlesource.com/c/sdk/+/395344. TEST=ci Change-Id: Ic1b23a83f053ee57c3c2432b562dc7db4546aee7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395581 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Alexander Aprelev <aam@google.com> Auto-Submit: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
committed by
Commit Queue
parent
e673478afd
commit
a4ff25fe66
@@ -314,32 +314,6 @@ void DeoptContext::FillDestFrame() {
|
||||
}
|
||||
}
|
||||
|
||||
const CatchEntryMoves* DeoptContext::ToCatchEntryMoves(intptr_t num_vars) {
|
||||
const Code& code = Code::Handle(code_);
|
||||
const TypedData& deopt_info = TypedData::Handle(deopt_info_);
|
||||
GrowableArray<DeoptInstr*> deopt_instructions;
|
||||
const Array& deopt_table = Array::Handle(code.deopt_info_array());
|
||||
ASSERT(!deopt_table.IsNull());
|
||||
DeoptInfo::Unpack(deopt_table, deopt_info, &deopt_instructions);
|
||||
|
||||
CatchEntryMoves* moves = CatchEntryMoves::Allocate(num_vars);
|
||||
|
||||
Function& function = Function::Handle(zone(), code.function());
|
||||
intptr_t params =
|
||||
function.MakesCopyOfParameters() ? 0 : function.num_fixed_parameters();
|
||||
for (intptr_t i = 0; i < num_vars; i++) {
|
||||
const intptr_t len = deopt_instructions.length();
|
||||
intptr_t slot = i < params ? i
|
||||
: i + kParamEndSlotFromFp -
|
||||
runtime_frame_layout.first_local_from_fp;
|
||||
DeoptInstr* instr = deopt_instructions[len - 1 - slot];
|
||||
intptr_t dest_index = i - params;
|
||||
moves->At(i) = instr->ToCatchEntryMove(this, dest_index);
|
||||
}
|
||||
|
||||
return moves;
|
||||
}
|
||||
|
||||
static void FillDeferredSlots(DeoptContext* deopt_context,
|
||||
DeferredSlot** slot_list) {
|
||||
DeferredSlot* slot = *slot_list;
|
||||
@@ -477,11 +451,6 @@ class DeoptConstantInstr : public DeoptInstr {
|
||||
*reinterpret_cast<ObjectPtr*>(dest_addr) = obj.ptr();
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
return CatchEntryMove::FromConstant(object_table_index_, dest_slot);
|
||||
}
|
||||
|
||||
private:
|
||||
const intptr_t object_table_index_;
|
||||
|
||||
@@ -509,13 +478,6 @@ class DeoptWordInstr : public DeoptInstr {
|
||||
*dest_addr = source_.Value<intptr_t>(deopt_context);
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
return CatchEntryMove::FromSlot(CatchEntryMove::SourceKind::kTaggedSlot,
|
||||
source_.StackSlot(deopt_context),
|
||||
dest_slot);
|
||||
}
|
||||
|
||||
private:
|
||||
const CpuRegisterSource source_;
|
||||
|
||||
@@ -569,15 +531,6 @@ class DeoptMintPairInstr : public DeoptIntegerInstrBase {
|
||||
hi_.Value<int32_t>(deopt_context));
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
return CatchEntryMove::FromSlot(
|
||||
CatchEntryMove::SourceKind::kInt64PairSlot,
|
||||
CatchEntryMove::EncodePairSource(lo_.StackSlot(deopt_context),
|
||||
hi_.StackSlot(deopt_context)),
|
||||
dest_slot);
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr intptr_t kFieldWidth = kBitsPerWord / 2;
|
||||
using LoRegister = BitField<intptr_t, intptr_t, 0, kFieldWidth>;
|
||||
@@ -608,12 +561,6 @@ class DeoptIntInstr : public DeoptIntegerInstrBase {
|
||||
return static_cast<int64_t>(source_.Value<T>(deopt_context));
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
return CatchEntryMove::FromSlot(slot_kind, source_.StackSlot(deopt_context),
|
||||
dest_slot);
|
||||
}
|
||||
|
||||
private:
|
||||
const CpuRegisterSource source_;
|
||||
|
||||
@@ -654,12 +601,6 @@ class DeoptFpuInstr : public DeoptInstr {
|
||||
reinterpret_cast<PtrType*>(dest_addr));
|
||||
}
|
||||
|
||||
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
return CatchEntryMove::FromSlot(slot_kind, source_.StackSlot(deopt_context),
|
||||
dest_slot);
|
||||
}
|
||||
|
||||
private:
|
||||
const FpuRegisterSource source_;
|
||||
|
||||
|
||||
@@ -147,11 +147,6 @@ class DeoptContext : public MallocAllocated {
|
||||
// objects.
|
||||
void FillDestFrame();
|
||||
|
||||
// Convert deoptimization instructions to a list of moves that need
|
||||
// to be executed when entering catch entry block from this deoptimization
|
||||
// point.
|
||||
const CatchEntryMoves* ToCatchEntryMoves(intptr_t num_vars);
|
||||
|
||||
// Materializes all deferred objects. Returns the total number of
|
||||
// artificial arguments used during deoptimization.
|
||||
intptr_t MaterializeDeferredObjects();
|
||||
@@ -317,12 +312,6 @@ class DeoptInstr : public ZoneAllocated {
|
||||
|
||||
virtual void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) = 0;
|
||||
|
||||
virtual CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
|
||||
intptr_t dest_slot) {
|
||||
UNREACHABLE();
|
||||
return CatchEntryMove();
|
||||
}
|
||||
|
||||
virtual DeoptInstr::Kind kind() const = 0;
|
||||
|
||||
bool Equals(const DeoptInstr& other) const {
|
||||
|
||||
Reference in New Issue
Block a user