Index: runtime/vm/simulator_dbc.cc |
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
index 3ac7d2bdca7a75c2ce21188017cb300da3ec96c7..f26212218837da45ce7f18bcac4a9e77c6ee544e 100644 |
--- a/runtime/vm/simulator_dbc.cc |
+++ b/runtime/vm/simulator_dbc.cc |
@@ -250,6 +250,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) { |
@@ -451,6 +462,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] = |
@@ -2186,6 +2199,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); |
@@ -2417,6 +2444,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(); |