Skip to content

Commit 84adfa2

Browse files
author
drizzle9
committed
remove EncodeSpillFillData
1 parent e6b9fa4 commit 84adfa2

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

astgen.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,28 +133,6 @@ void AstGen::EmitJump(const BasicBlock *bb)
133133
}
134134

135135

136-
void AstGen::EncodeSpillFillData(const compiler::SpillFillData &sf)
137-
{
138-
if (sf.SrcType() != compiler::LocationType::REGISTER || sf.DstType() != compiler::LocationType::REGISTER) {
139-
LOG(ERROR, BYTECODE_OPTIMIZER) << "EncodeSpillFillData with unknown move type, src_type: "
140-
<< static_cast<int>(sf.SrcType())
141-
<< " dst_type: " << static_cast<int>(sf.DstType());
142-
success_ = false;
143-
std::cout << "S2" << std::endl;
144-
UNREACHABLE();
145-
return;
146-
}
147-
ASSERT(sf.GetType() != compiler::DataType::NO_TYPE);
148-
ASSERT(sf.SrcValue() != compiler::INVALID_REG && sf.DstValue() != compiler::INVALID_REG);
149-
150-
if (sf.SrcValue() == sf.DstValue()) {
151-
return;
152-
}
153-
154-
pandasm::Ins move;
155-
result_.emplace_back(pandasm::Create_MOV(sf.DstValue(), sf.SrcValue()));
156-
return;
157-
}
158136

159137
void AstGen::VisitSpillFill(GraphVisitor *visitor, Inst *inst)
160138
{

astgen.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ class AstGen : public compiler::Optimization, public compiler::GraphVisitor {
9898

9999
void EmitJump(const BasicBlock *bb);
100100

101-
void EncodeSpillFillData(const compiler::SpillFillData &sf);
102-
103101
const ArenaVector<BasicBlock *> &GetBlocksToVisit() const override
104102
{
105103
return GetGraph()->GetBlocksRPO();

astgen_auxiins.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ void AstGen::VisitPhi(GraphVisitor* v, Inst* inst_base) {
55
[[maybe_unused]] auto inst = inst_base->CastToPhi();
66
std::cout << "[-] VisitPhi <<<<<<<<<<<<<<<" << std::endl;
77
}
8-
void AstGen::VisitTry(GraphVisitor* v, Inst* inst_base) {
9-
std::cout << "[+] VisitTry >>>>>>>>>>>>>>>>>" << std::endl;
10-
pandasm::Ins ins;
11-
[[maybe_unused]] auto enc = static_cast<AstGen*>(v);
12-
[[maybe_unused]] auto inst = inst_base->CastToTry();
13-
std::cout << "[-] VisitTry >>>>>>>>>>>>>>>>>" << std::endl;
14-
}
8+
159
void AstGen::VisitSaveState(GraphVisitor* v, Inst* inst_base) {
1610
std::cout << "[+] VisitSaveState >>>>>>>>>>>>>>>>>" << std::endl;
1711
pandasm::Ins ins;
@@ -31,3 +25,11 @@ void AstGen::VisitParameter(GraphVisitor* v, Inst* inst_base) {
3125

3226
std::cout << "[-] VisitParameter >>>>>>>>>>>>>>>>>" << std::endl;
3327
}
28+
29+
void AstGen::VisitTry(GraphVisitor* v, Inst* inst_base) {
30+
std::cout << "[+] VisitTry >>>>>>>>>>>>>>>>>" << std::endl;
31+
pandasm::Ins ins;
32+
[[maybe_unused]] auto enc = static_cast<AstGen*>(v);
33+
[[maybe_unused]] auto inst = inst_base->CastToTry();
34+
std::cout << "[-] VisitTry >>>>>>>>>>>>>>>>>" << std::endl;
35+
}

0 commit comments

Comments
 (0)