OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #if defined(TARGET_ARCH_DBC) | 9 #if defined(TARGET_ARCH_DBC) |
10 | 10 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 RawObject** FP, | 245 RawObject** FP, |
246 RawObject** result) { | 246 RawObject** result) { |
247 RawObject** args = FrameArguments(FP, 1); | 247 RawObject** args = FrameArguments(FP, 1); |
248 RawDouble* d = static_cast<RawDouble*>(args[0]); | 248 RawDouble* d = static_cast<RawDouble*>(args[0]); |
249 *result = isnan(d->ptr()->value_) | 249 *result = isnan(d->ptr()->value_) |
250 ? Bool::True().raw() | 250 ? Bool::True().raw() |
251 : Bool::False().raw(); | 251 : Bool::False().raw(); |
252 return true; | 252 return true; |
253 } | 253 } |
254 | 254 |
| 255 static bool Double_getIsInfinite(Thread* thread, |
| 256 RawObject** FP, |
| 257 RawObject** result) { |
| 258 RawObject** args = FrameArguments(FP, 1); |
| 259 RawDouble* d = static_cast<RawDouble*>(args[0]); |
| 260 *result = isinf(d->ptr()->value_) |
| 261 ? Bool::True().raw() |
| 262 : Bool::False().raw(); |
| 263 return true; |
| 264 } |
| 265 |
255 static bool ObjectEquals(Thread* thread, | 266 static bool ObjectEquals(Thread* thread, |
256 RawObject** FP, | 267 RawObject** FP, |
257 RawObject** result) { | 268 RawObject** result) { |
258 RawObject** args = FrameArguments(FP, 2); | 269 RawObject** args = FrameArguments(FP, 2); |
259 *result = args[0] == args[1] ? Bool::True().raw() : Bool::False().raw(); | 270 *result = args[0] == args[1] ? Bool::True().raw() : Bool::False().raw(); |
260 return true; | 271 return true; |
261 } | 272 } |
262 | 273 |
263 static bool ObjectRuntimeType(Thread* thread, | 274 static bool ObjectRuntimeType(Thread* thread, |
264 RawObject** FP, | 275 RawObject** FP, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 SimulatorHelpers::GrowableArraySetIndexed; | 488 SimulatorHelpers::GrowableArraySetIndexed; |
478 intrinsics_[kGrowableArrayGetIndexedIntrinsic] = | 489 intrinsics_[kGrowableArrayGetIndexedIntrinsic] = |
479 SimulatorHelpers::GrowableArrayGetIndexed; | 490 SimulatorHelpers::GrowableArrayGetIndexed; |
480 intrinsics_[kObjectEqualsIntrinsic] = | 491 intrinsics_[kObjectEqualsIntrinsic] = |
481 SimulatorHelpers::ObjectEquals; | 492 SimulatorHelpers::ObjectEquals; |
482 intrinsics_[kObjectRuntimeTypeIntrinsic] = | 493 intrinsics_[kObjectRuntimeTypeIntrinsic] = |
483 SimulatorHelpers::ObjectRuntimeType; | 494 SimulatorHelpers::ObjectRuntimeType; |
484 | 495 |
485 intrinsics_[kDouble_getIsNaNIntrinsic] = | 496 intrinsics_[kDouble_getIsNaNIntrinsic] = |
486 SimulatorHelpers::Double_getIsNan; | 497 SimulatorHelpers::Double_getIsNan; |
| 498 intrinsics_[kDouble_getIsInfiniteIntrinsic] = |
| 499 SimulatorHelpers::Double_getIsInfinite; |
487 intrinsics_[kDouble_addIntrinsic] = | 500 intrinsics_[kDouble_addIntrinsic] = |
488 SimulatorHelpers::Double_add; | 501 SimulatorHelpers::Double_add; |
489 intrinsics_[kDouble_mulIntrinsic] = | 502 intrinsics_[kDouble_mulIntrinsic] = |
490 SimulatorHelpers::Double_mul; | 503 SimulatorHelpers::Double_mul; |
491 intrinsics_[kDouble_subIntrinsic] = | 504 intrinsics_[kDouble_subIntrinsic] = |
492 SimulatorHelpers::Double_sub; | 505 SimulatorHelpers::Double_sub; |
493 intrinsics_[kDouble_divIntrinsic] = | 506 intrinsics_[kDouble_divIntrinsic] = |
494 SimulatorHelpers::Double_div; | 507 SimulatorHelpers::Double_div; |
495 intrinsics_[kDouble_greaterThanIntrinsic] = | 508 intrinsics_[kDouble_greaterThanIntrinsic] = |
496 SimulatorHelpers::Double_greaterThan; | 509 SimulatorHelpers::Double_greaterThan; |
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2209 | 2222 |
2210 { | 2223 { |
2211 BYTECODE(FloatToDouble, A_D); | 2224 BYTECODE(FloatToDouble, A_D); |
2212 const float valuef = *reinterpret_cast<float*>(&FP[rD]); | 2225 const float valuef = *reinterpret_cast<float*>(&FP[rD]); |
2213 const double value = static_cast<double>(valuef); | 2226 const double value = static_cast<double>(valuef); |
2214 FP[rA] = bit_cast<RawObject*, double>(value); | 2227 FP[rA] = bit_cast<RawObject*, double>(value); |
2215 DISPATCH(); | 2228 DISPATCH(); |
2216 } | 2229 } |
2217 | 2230 |
2218 { | 2231 { |
| 2232 BYTECODE(DoubleIsNaN, A_D); |
| 2233 const double v = bit_cast<double, RawObject*>(FP[rD]); |
| 2234 FP[rA] = isnan(v) ? true_value : false_value; |
| 2235 DISPATCH(); |
| 2236 } |
| 2237 |
| 2238 { |
| 2239 BYTECODE(DoubleIsInfinite, A_D); |
| 2240 const double v = bit_cast<double, RawObject*>(FP[rD]); |
| 2241 FP[rA] = isinf(v) ? true_value : false_value; |
| 2242 DISPATCH(); |
| 2243 } |
| 2244 |
| 2245 { |
2219 BYTECODE(LoadIndexedFloat32, A_B_C); | 2246 BYTECODE(LoadIndexedFloat32, A_B_C); |
2220 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]); | 2247 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]); |
2221 const uint32_t value = *reinterpret_cast<uint32_t*>(data); | 2248 const uint32_t value = *reinterpret_cast<uint32_t*>(data); |
2222 const uint64_t value64 = value; | 2249 const uint64_t value64 = value; |
2223 FP[rA] = reinterpret_cast<RawObject*>(value64); | 2250 FP[rA] = reinterpret_cast<RawObject*>(value64); |
2224 DISPATCH(); | 2251 DISPATCH(); |
2225 } | 2252 } |
2226 | 2253 |
2227 { | 2254 { |
2228 BYTECODE(LoadIndexed4Float32, A_B_C); | 2255 BYTECODE(LoadIndexed4Float32, A_B_C); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2440 DISPATCH(); | 2467 DISPATCH(); |
2441 } | 2468 } |
2442 | 2469 |
2443 { | 2470 { |
2444 BYTECODE(FloatToDouble, A_D); | 2471 BYTECODE(FloatToDouble, A_D); |
2445 UNREACHABLE(); | 2472 UNREACHABLE(); |
2446 DISPATCH(); | 2473 DISPATCH(); |
2447 } | 2474 } |
2448 | 2475 |
2449 { | 2476 { |
| 2477 BYTECODE(DoubleIsNaN, A_D); |
| 2478 UNREACHABLE(); |
| 2479 DISPATCH(); |
| 2480 } |
| 2481 |
| 2482 { |
| 2483 BYTECODE(DoubleIsInfinite, A_D); |
| 2484 UNREACHABLE(); |
| 2485 DISPATCH(); |
| 2486 } |
| 2487 |
| 2488 { |
2450 BYTECODE(LoadIndexedFloat32, A_B_C); | 2489 BYTECODE(LoadIndexedFloat32, A_B_C); |
2451 UNREACHABLE(); | 2490 UNREACHABLE(); |
2452 DISPATCH(); | 2491 DISPATCH(); |
2453 } | 2492 } |
2454 | 2493 |
2455 { | 2494 { |
2456 BYTECODE(LoadIndexed4Float32, A_B_C); | 2495 BYTECODE(LoadIndexed4Float32, A_B_C); |
2457 UNREACHABLE(); | 2496 UNREACHABLE(); |
2458 DISPATCH(); | 2497 DISPATCH(); |
2459 } | 2498 } |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3699 pc_ = pc; | 3738 pc_ = pc; |
3700 special_[kExceptionSpecialIndex] = raw_exception; | 3739 special_[kExceptionSpecialIndex] = raw_exception; |
3701 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 3740 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
3702 buf->Longjmp(); | 3741 buf->Longjmp(); |
3703 UNREACHABLE(); | 3742 UNREACHABLE(); |
3704 } | 3743 } |
3705 | 3744 |
3706 } // namespace dart | 3745 } // namespace dart |
3707 | 3746 |
3708 #endif // defined TARGET_ARCH_DBC | 3747 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |