Skip to content

Commit d3ecb22

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm,compiler] Cleanup UnboxedConstantInstr::constant_address_
TEST=ci Change-Id: Idfedcef88b1f9c32c32cd1a483300204972e8de6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401900 Commit-Queue: Alexander Markov <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 5fd11d3 commit d3ecb22

File tree

4 files changed

+9
-37
lines changed

4 files changed

+9
-37
lines changed

runtime/vm/compiler/backend/il.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,14 +1175,7 @@ bool ConstantInstr::AttributesEqual(const Instruction& other) const {
11751175

11761176
UnboxedConstantInstr::UnboxedConstantInstr(const Object& value,
11771177
Representation representation)
1178-
: ConstantInstr(value),
1179-
representation_(representation),
1180-
constant_address_(0) {
1181-
if (representation_ == kUnboxedDouble) {
1182-
ASSERT(value.IsDouble());
1183-
constant_address_ = FindDoubleConstant(Double::Cast(value).value());
1184-
}
1185-
}
1178+
: ConstantInstr(value), representation_(representation) {}
11861179

11871180
// Returns true if the value represents a constant.
11881181
bool Value::BindsToConstant() const {

runtime/vm/compiler/backend/il.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4409,20 +4409,19 @@ class UnboxedConstantInstr : public ConstantInstr {
44094409

44104410
virtual Representation representation() const { return representation_; }
44114411

4412-
// Either nullptr or the address of the unboxed constant.
4413-
uword constant_address() const { return constant_address_; }
4414-
44154412
DECLARE_INSTRUCTION(UnboxedConstant)
4416-
DECLARE_CUSTOM_SERIALIZATION(UnboxedConstantInstr)
44174413

44184414
DECLARE_ATTRIBUTES_NAMED(("value", "representation"),
44194415
(&value(), representation()))
44204416

4421-
private:
4422-
const Representation representation_;
4423-
uword
4424-
constant_address_; // Either nullptr or points to the untagged constant.
4417+
#define FIELD_LIST(F) F(const Representation, representation_)
44254418

4419+
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(UnboxedConstantInstr,
4420+
ConstantInstr,
4421+
FIELD_LIST)
4422+
#undef FIELD_LIST
4423+
4424+
private:
44264425
DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr);
44274426
};
44284427

runtime/vm/compiler/backend/il_ia32.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,7 @@ LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
581581
ASSERT(!is_unboxed_int || RepresentationUtils::ValueSize(representation()) <=
582582
compiler::target::kWordSize);
583583
const intptr_t kNumInputs = 0;
584-
const intptr_t kNumTemps =
585-
(constant_address() == 0) && !is_unboxed_int ? 1 : 0;
584+
const intptr_t kNumTemps = 0;
586585
LocationSummary* locs = new (zone)
587586
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
588587
if (representation() == kUnboxedDouble) {
@@ -591,9 +590,6 @@ LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
591590
ASSERT(is_unboxed_int);
592591
locs->set_out(0, Location::RequiresRegister());
593592
}
594-
if (kNumTemps == 1) {
595-
locs->set_temp(0, Location::RequiresRegister());
596-
}
597593
return locs;
598594
}
599595

runtime/vm/compiler/backend/il_serializer.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,22 +2636,6 @@ uint64_t FlowGraphDeserializer::ReadTrait<uint64_t>::Read(
26362636
return static_cast<uint64_t>(d->stream()->Read<int64_t>());
26372637
}
26382638

2639-
void UnboxedConstantInstr::WriteTo(FlowGraphSerializer* s) {
2640-
ConstantInstr::WriteTo(s);
2641-
s->Write<Representation>(representation_);
2642-
// constant_address_ is not written - it is restored when reading.
2643-
}
2644-
2645-
UnboxedConstantInstr::UnboxedConstantInstr(FlowGraphDeserializer* d)
2646-
: ConstantInstr(d),
2647-
representation_(d->Read<Representation>()),
2648-
constant_address_(0) {
2649-
if (representation_ == kUnboxedDouble) {
2650-
ASSERT(value().IsDouble());
2651-
constant_address_ = FindDoubleConstant(Double::Cast(value()).value());
2652-
}
2653-
}
2654-
26552639
template <>
26562640
void FlowGraphSerializer::WriteTrait<Value*>::Write(FlowGraphSerializer* s,
26572641
Value* x) {

0 commit comments

Comments
 (0)