| Index: src/compiler/instruction.h
|
| diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
|
| index e63ceda14846cf1ecd65c44eb41a7f9247b04b94..1655ea92170545f8b4268922b7e575f9c43ec778 100644
|
| --- a/src/compiler/instruction.h
|
| +++ b/src/compiler/instruction.h
|
| @@ -1069,12 +1069,23 @@ class V8_EXPORT_PRIVATE Constant final {
|
| return bit_cast<float>(static_cast<int32_t>(value_));
|
| }
|
|
|
| + int32_t ToFloat32AsInt() const {
|
| + DCHECK_EQ(kFloat32, type());
|
| + return static_cast<int32_t>(value_);
|
| + }
|
| +
|
| double ToFloat64() const {
|
| if (type() == kInt32) return ToInt32();
|
| DCHECK_EQ(kFloat64, type());
|
| return bit_cast<double>(value_);
|
| }
|
|
|
| + int64_t ToFloat64AsInt() const {
|
| + if (type() == kInt32) return ToInt32();
|
| + DCHECK_EQ(kFloat64, type());
|
| + return value_;
|
| + }
|
| +
|
| ExternalReference ToExternalReference() const {
|
| DCHECK_EQ(kExternalReference, type());
|
| return bit_cast<ExternalReference>(static_cast<intptr_t>(value_));
|
|
|