Index: runtime/vm/simulator_dbc.cc |
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
index 4d271556cb8565e27004c91dbf31aef8b8ace001..c3998aff11a6ba832c47f211676d9cb4c8b44108 100644 |
--- a/runtime/vm/simulator_dbc.cc |
+++ b/runtime/vm/simulator_dbc.cc |
@@ -252,6 +252,17 @@ class SimulatorHelpers { |
return true; |
} |
+ static bool Double_getIsInfinite(Thread* thread, |
+ RawObject** FP, |
+ RawObject** result) { |
+ RawObject** args = FrameArguments(FP, 1); |
+ RawDouble* d = static_cast<RawDouble*>(args[0]); |
+ *result = isinf(d->ptr()->value_) |
+ ? Bool::True().raw() |
+ : Bool::False().raw(); |
+ return true; |
+ } |
+ |
static bool ObjectEquals(Thread* thread, |
RawObject** FP, |
RawObject** result) { |
@@ -484,6 +495,8 @@ void Simulator::InitOnce() { |
intrinsics_[kDouble_getIsNaNIntrinsic] = |
SimulatorHelpers::Double_getIsNan; |
+ intrinsics_[kDouble_getIsInfiniteIntrinsic] = |
+ SimulatorHelpers::Double_getIsInfinite; |
intrinsics_[kDouble_addIntrinsic] = |
SimulatorHelpers::Double_add; |
intrinsics_[kDouble_mulIntrinsic] = |
@@ -2216,6 +2229,20 @@ RawObject* Simulator::Call(const Code& code, |
} |
{ |
+ BYTECODE(DoubleIsNaN, A_D); |
+ const double v = bit_cast<double, RawObject*>(FP[rD]); |
+ FP[rA] = isnan(v) ? true_value : false_value; |
+ DISPATCH(); |
+ } |
+ |
+ { |
+ BYTECODE(DoubleIsInfinite, A_D); |
+ const double v = bit_cast<double, RawObject*>(FP[rD]); |
+ FP[rA] = isinf(v) ? true_value : false_value; |
+ DISPATCH(); |
+ } |
+ |
+ { |
BYTECODE(LoadIndexedFloat32, A_B_C); |
uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]); |
const uint32_t value = *reinterpret_cast<uint32_t*>(data); |
@@ -2447,6 +2474,18 @@ RawObject* Simulator::Call(const Code& code, |
} |
{ |
+ BYTECODE(DoubleIsNaN, A_D); |
+ UNREACHABLE(); |
+ DISPATCH(); |
+ } |
+ |
+ { |
+ BYTECODE(DoubleIsInfinite, A_D); |
+ UNREACHABLE(); |
+ DISPATCH(); |
+ } |
+ |
+ { |
BYTECODE(LoadIndexedFloat32, A_B_C); |
UNREACHABLE(); |
DISPATCH(); |