Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 2432903002: Revert "Add DoubleTestOp instruction" (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
266 static bool ObjectEquals(Thread* thread, 255 static bool ObjectEquals(Thread* thread,
267 RawObject** FP, 256 RawObject** FP,
268 RawObject** result) { 257 RawObject** result) {
269 RawObject** args = FrameArguments(FP, 2); 258 RawObject** args = FrameArguments(FP, 2);
270 *result = args[0] == args[1] ? Bool::True().raw() : Bool::False().raw(); 259 *result = args[0] == args[1] ? Bool::True().raw() : Bool::False().raw();
271 return true; 260 return true;
272 } 261 }
273 262
274 static bool ObjectRuntimeType(Thread* thread, 263 static bool ObjectRuntimeType(Thread* thread,
275 RawObject** FP, 264 RawObject** FP,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 SimulatorHelpers::GrowableArraySetIndexed; 477 SimulatorHelpers::GrowableArraySetIndexed;
489 intrinsics_[kGrowableArrayGetIndexedIntrinsic] = 478 intrinsics_[kGrowableArrayGetIndexedIntrinsic] =
490 SimulatorHelpers::GrowableArrayGetIndexed; 479 SimulatorHelpers::GrowableArrayGetIndexed;
491 intrinsics_[kObjectEqualsIntrinsic] = 480 intrinsics_[kObjectEqualsIntrinsic] =
492 SimulatorHelpers::ObjectEquals; 481 SimulatorHelpers::ObjectEquals;
493 intrinsics_[kObjectRuntimeTypeIntrinsic] = 482 intrinsics_[kObjectRuntimeTypeIntrinsic] =
494 SimulatorHelpers::ObjectRuntimeType; 483 SimulatorHelpers::ObjectRuntimeType;
495 484
496 intrinsics_[kDouble_getIsNaNIntrinsic] = 485 intrinsics_[kDouble_getIsNaNIntrinsic] =
497 SimulatorHelpers::Double_getIsNan; 486 SimulatorHelpers::Double_getIsNan;
498 intrinsics_[kDouble_getIsInfiniteIntrinsic] =
499 SimulatorHelpers::Double_getIsInfinite;
500 intrinsics_[kDouble_addIntrinsic] = 487 intrinsics_[kDouble_addIntrinsic] =
501 SimulatorHelpers::Double_add; 488 SimulatorHelpers::Double_add;
502 intrinsics_[kDouble_mulIntrinsic] = 489 intrinsics_[kDouble_mulIntrinsic] =
503 SimulatorHelpers::Double_mul; 490 SimulatorHelpers::Double_mul;
504 intrinsics_[kDouble_subIntrinsic] = 491 intrinsics_[kDouble_subIntrinsic] =
505 SimulatorHelpers::Double_sub; 492 SimulatorHelpers::Double_sub;
506 intrinsics_[kDouble_divIntrinsic] = 493 intrinsics_[kDouble_divIntrinsic] =
507 SimulatorHelpers::Double_div; 494 SimulatorHelpers::Double_div;
508 intrinsics_[kDouble_greaterThanIntrinsic] = 495 intrinsics_[kDouble_greaterThanIntrinsic] =
509 SimulatorHelpers::Double_greaterThan; 496 SimulatorHelpers::Double_greaterThan;
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 2209
2223 { 2210 {
2224 BYTECODE(FloatToDouble, A_D); 2211 BYTECODE(FloatToDouble, A_D);
2225 const float valuef = *reinterpret_cast<float*>(&FP[rD]); 2212 const float valuef = *reinterpret_cast<float*>(&FP[rD]);
2226 const double value = static_cast<double>(valuef); 2213 const double value = static_cast<double>(valuef);
2227 FP[rA] = bit_cast<RawObject*, double>(value); 2214 FP[rA] = bit_cast<RawObject*, double>(value);
2228 DISPATCH(); 2215 DISPATCH();
2229 } 2216 }
2230 2217
2231 { 2218 {
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 {
2246 BYTECODE(LoadIndexedFloat32, A_B_C); 2219 BYTECODE(LoadIndexedFloat32, A_B_C);
2247 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]); 2220 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]);
2248 const uint32_t value = *reinterpret_cast<uint32_t*>(data); 2221 const uint32_t value = *reinterpret_cast<uint32_t*>(data);
2249 const uint64_t value64 = value; 2222 const uint64_t value64 = value;
2250 FP[rA] = reinterpret_cast<RawObject*>(value64); 2223 FP[rA] = reinterpret_cast<RawObject*>(value64);
2251 DISPATCH(); 2224 DISPATCH();
2252 } 2225 }
2253 2226
2254 { 2227 {
2255 BYTECODE(LoadIndexed4Float32, A_B_C); 2228 BYTECODE(LoadIndexed4Float32, A_B_C);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 DISPATCH(); 2440 DISPATCH();
2468 } 2441 }
2469 2442
2470 { 2443 {
2471 BYTECODE(FloatToDouble, A_D); 2444 BYTECODE(FloatToDouble, A_D);
2472 UNREACHABLE(); 2445 UNREACHABLE();
2473 DISPATCH(); 2446 DISPATCH();
2474 } 2447 }
2475 2448
2476 { 2449 {
2477 BYTECODE(DoubleIsNaN, A_D);
2478 UNREACHABLE();
2479 DISPATCH();
2480 }
2481
2482 {
2483 BYTECODE(DoubleIsInfinite, A_D);
2484 UNREACHABLE();
2485 DISPATCH();
2486 }
2487
2488 {
2489 BYTECODE(LoadIndexedFloat32, A_B_C); 2450 BYTECODE(LoadIndexedFloat32, A_B_C);
2490 UNREACHABLE(); 2451 UNREACHABLE();
2491 DISPATCH(); 2452 DISPATCH();
2492 } 2453 }
2493 2454
2494 { 2455 {
2495 BYTECODE(LoadIndexed4Float32, A_B_C); 2456 BYTECODE(LoadIndexed4Float32, A_B_C);
2496 UNREACHABLE(); 2457 UNREACHABLE();
2497 DISPATCH(); 2458 DISPATCH();
2498 } 2459 }
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 pc_ = pc; 3699 pc_ = pc;
3739 special_[kExceptionSpecialIndex] = raw_exception; 3700 special_[kExceptionSpecialIndex] = raw_exception;
3740 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3701 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3741 buf->Longjmp(); 3702 buf->Longjmp();
3742 UNREACHABLE(); 3703 UNREACHABLE();
3743 } 3704 }
3744 3705
3745 } // namespace dart 3706 } // namespace dart
3746 3707
3747 #endif // defined TARGET_ARCH_DBC 3708 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698