Skip to content

Commit a4ff25f

Browse files
alexmarkovCommit Queue
authored andcommitted
[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 <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]> Auto-Submit: Alexander Markov <[email protected]>
1 parent e673478 commit a4ff25f

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

runtime/vm/deopt_instructions.cc

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -314,32 +314,6 @@ void DeoptContext::FillDestFrame() {
314314
}
315315
}
316316

317-
const CatchEntryMoves* DeoptContext::ToCatchEntryMoves(intptr_t num_vars) {
318-
const Code& code = Code::Handle(code_);
319-
const TypedData& deopt_info = TypedData::Handle(deopt_info_);
320-
GrowableArray<DeoptInstr*> deopt_instructions;
321-
const Array& deopt_table = Array::Handle(code.deopt_info_array());
322-
ASSERT(!deopt_table.IsNull());
323-
DeoptInfo::Unpack(deopt_table, deopt_info, &deopt_instructions);
324-
325-
CatchEntryMoves* moves = CatchEntryMoves::Allocate(num_vars);
326-
327-
Function& function = Function::Handle(zone(), code.function());
328-
intptr_t params =
329-
function.MakesCopyOfParameters() ? 0 : function.num_fixed_parameters();
330-
for (intptr_t i = 0; i < num_vars; i++) {
331-
const intptr_t len = deopt_instructions.length();
332-
intptr_t slot = i < params ? i
333-
: i + kParamEndSlotFromFp -
334-
runtime_frame_layout.first_local_from_fp;
335-
DeoptInstr* instr = deopt_instructions[len - 1 - slot];
336-
intptr_t dest_index = i - params;
337-
moves->At(i) = instr->ToCatchEntryMove(this, dest_index);
338-
}
339-
340-
return moves;
341-
}
342-
343317
static void FillDeferredSlots(DeoptContext* deopt_context,
344318
DeferredSlot** slot_list) {
345319
DeferredSlot* slot = *slot_list;
@@ -477,11 +451,6 @@ class DeoptConstantInstr : public DeoptInstr {
477451
*reinterpret_cast<ObjectPtr*>(dest_addr) = obj.ptr();
478452
}
479453

480-
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
481-
intptr_t dest_slot) {
482-
return CatchEntryMove::FromConstant(object_table_index_, dest_slot);
483-
}
484-
485454
private:
486455
const intptr_t object_table_index_;
487456

@@ -509,13 +478,6 @@ class DeoptWordInstr : public DeoptInstr {
509478
*dest_addr = source_.Value<intptr_t>(deopt_context);
510479
}
511480

512-
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
513-
intptr_t dest_slot) {
514-
return CatchEntryMove::FromSlot(CatchEntryMove::SourceKind::kTaggedSlot,
515-
source_.StackSlot(deopt_context),
516-
dest_slot);
517-
}
518-
519481
private:
520482
const CpuRegisterSource source_;
521483

@@ -569,15 +531,6 @@ class DeoptMintPairInstr : public DeoptIntegerInstrBase {
569531
hi_.Value<int32_t>(deopt_context));
570532
}
571533

572-
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
573-
intptr_t dest_slot) {
574-
return CatchEntryMove::FromSlot(
575-
CatchEntryMove::SourceKind::kInt64PairSlot,
576-
CatchEntryMove::EncodePairSource(lo_.StackSlot(deopt_context),
577-
hi_.StackSlot(deopt_context)),
578-
dest_slot);
579-
}
580-
581534
private:
582535
static constexpr intptr_t kFieldWidth = kBitsPerWord / 2;
583536
using LoRegister = BitField<intptr_t, intptr_t, 0, kFieldWidth>;
@@ -608,12 +561,6 @@ class DeoptIntInstr : public DeoptIntegerInstrBase {
608561
return static_cast<int64_t>(source_.Value<T>(deopt_context));
609562
}
610563

611-
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
612-
intptr_t dest_slot) {
613-
return CatchEntryMove::FromSlot(slot_kind, source_.StackSlot(deopt_context),
614-
dest_slot);
615-
}
616-
617564
private:
618565
const CpuRegisterSource source_;
619566

@@ -654,12 +601,6 @@ class DeoptFpuInstr : public DeoptInstr {
654601
reinterpret_cast<PtrType*>(dest_addr));
655602
}
656603

657-
CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
658-
intptr_t dest_slot) {
659-
return CatchEntryMove::FromSlot(slot_kind, source_.StackSlot(deopt_context),
660-
dest_slot);
661-
}
662-
663604
private:
664605
const FpuRegisterSource source_;
665606

runtime/vm/deopt_instructions.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ class DeoptContext : public MallocAllocated {
147147
// objects.
148148
void FillDestFrame();
149149

150-
// Convert deoptimization instructions to a list of moves that need
151-
// to be executed when entering catch entry block from this deoptimization
152-
// point.
153-
const CatchEntryMoves* ToCatchEntryMoves(intptr_t num_vars);
154-
155150
// Materializes all deferred objects. Returns the total number of
156151
// artificial arguments used during deoptimization.
157152
intptr_t MaterializeDeferredObjects();
@@ -317,12 +312,6 @@ class DeoptInstr : public ZoneAllocated {
317312

318313
virtual void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) = 0;
319314

320-
virtual CatchEntryMove ToCatchEntryMove(DeoptContext* deopt_context,
321-
intptr_t dest_slot) {
322-
UNREACHABLE();
323-
return CatchEntryMove();
324-
}
325-
326315
virtual DeoptInstr::Kind kind() const = 0;
327316

328317
bool Equals(const DeoptInstr& other) const {

0 commit comments

Comments
 (0)