OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 <math.h> // for isnan. | 5 #include <math.h> // for isnan. |
6 #include <setjmp.h> | 6 #include <setjmp.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #if defined(TARGET_ARCH_ARM) | 10 #if defined(TARGET_ARCH_ARM) |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 SimulatorLeafRuntimeCall target = | 1451 SimulatorLeafRuntimeCall target = |
1452 reinterpret_cast<SimulatorLeafRuntimeCall>(external); | 1452 reinterpret_cast<SimulatorLeafRuntimeCall>(external); |
1453 r0 = target(r0, r1, r2, r3); | 1453 r0 = target(r0, r1, r2, r3); |
1454 set_register(R0, r0); // Set returned result from function. | 1454 set_register(R0, r0); // Set returned result from function. |
1455 set_register(R1, icount_); // Zap unused result register. | 1455 set_register(R1, icount_); // Zap unused result register. |
1456 } else if (redirection->call_kind() == kLeafFloatRuntimeCall) { | 1456 } else if (redirection->call_kind() == kLeafFloatRuntimeCall) { |
1457 ASSERT((0 <= redirection->argument_count()) && | 1457 ASSERT((0 <= redirection->argument_count()) && |
1458 (redirection->argument_count() <= 2)); | 1458 (redirection->argument_count() <= 2)); |
1459 SimulatorLeafFloatRuntimeCall target = | 1459 SimulatorLeafFloatRuntimeCall target = |
1460 reinterpret_cast<SimulatorLeafFloatRuntimeCall>(external); | 1460 reinterpret_cast<SimulatorLeafFloatRuntimeCall>(external); |
1461 #if defined(ARM_FLOAT_ABI_HARD) | 1461 if (TargetCPUFeatures::hardfp_supported()) { |
1462 // If we're doing "hardfp", the double arguments are already in the | 1462 // If we're doing "hardfp", the double arguments are already in the |
1463 // floating point registers. | 1463 // floating point registers. |
1464 double d0 = get_dregister(D0); | 1464 double d0 = get_dregister(D0); |
1465 double d1 = get_dregister(D1); | 1465 double d1 = get_dregister(D1); |
1466 d0 = target(d0, d1); | 1466 d0 = target(d0, d1); |
1467 set_dregister(D0, d0); | 1467 set_dregister(D0, d0); |
1468 #else | 1468 } else { |
1469 // If we're not doing "hardfp", we must be doing "soft" or "softfp", | 1469 // If we're not doing "hardfp", we must be doing "soft" or "softfp", |
1470 // So take the double arguments from the integer registers. | 1470 // So take the double arguments from the integer registers. |
1471 uint32_t r0 = get_register(R0); | 1471 uint32_t r0 = get_register(R0); |
1472 int32_t r1 = get_register(R1); | 1472 int32_t r1 = get_register(R1); |
1473 uint32_t r2 = get_register(R2); | 1473 uint32_t r2 = get_register(R2); |
1474 int32_t r3 = get_register(R3); | 1474 int32_t r3 = get_register(R3); |
1475 int64_t a0 = Utils::LowHighTo64Bits(r0, r1); | 1475 int64_t a0 = Utils::LowHighTo64Bits(r0, r1); |
1476 int64_t a1 = Utils::LowHighTo64Bits(r2, r3); | 1476 int64_t a1 = Utils::LowHighTo64Bits(r2, r3); |
1477 double d0 = bit_cast<double, int64_t>(a0); | 1477 double d0 = bit_cast<double, int64_t>(a0); |
1478 double d1 = bit_cast<double, int64_t>(a1); | 1478 double d1 = bit_cast<double, int64_t>(a1); |
1479 d0 = target(d0, d1); | 1479 d0 = target(d0, d1); |
1480 a0 = bit_cast<int64_t, double>(d0); | 1480 a0 = bit_cast<int64_t, double>(d0); |
1481 r0 = Utils::Low32Bits(a0); | 1481 r0 = Utils::Low32Bits(a0); |
1482 r1 = Utils::High32Bits(a0); | 1482 r1 = Utils::High32Bits(a0); |
1483 set_register(R0, r0); | 1483 set_register(R0, r0); |
1484 set_register(R1, r1); | 1484 set_register(R1, r1); |
1485 #endif | 1485 } |
1486 } else if (redirection->call_kind() == kBootstrapNativeCall) { | 1486 } else if (redirection->call_kind() == kBootstrapNativeCall) { |
1487 NativeArguments* arguments; | 1487 NativeArguments* arguments; |
1488 arguments = reinterpret_cast<NativeArguments*>(get_register(R0)); | 1488 arguments = reinterpret_cast<NativeArguments*>(get_register(R0)); |
1489 SimulatorBootstrapNativeCall target = | 1489 SimulatorBootstrapNativeCall target = |
1490 reinterpret_cast<SimulatorBootstrapNativeCall>(external); | 1490 reinterpret_cast<SimulatorBootstrapNativeCall>(external); |
1491 target(arguments); | 1491 target(arguments); |
1492 set_register(R0, icount_); // Zap result register from void function. | 1492 set_register(R0, icount_); // Zap result register from void function. |
1493 } else { | 1493 } else { |
1494 ASSERT(redirection->call_kind() == kNativeCall); | 1494 ASSERT(redirection->call_kind() == kNativeCall); |
1495 NativeArguments* arguments; | 1495 NativeArguments* arguments; |
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3719 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3719 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3720 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3720 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3721 buf->Longjmp(); | 3721 buf->Longjmp(); |
3722 } | 3722 } |
3723 | 3723 |
3724 } // namespace dart | 3724 } // namespace dart |
3725 | 3725 |
3726 #endif // !defined(HOST_ARCH_ARM) | 3726 #endif // !defined(HOST_ARCH_ARM) |
3727 | 3727 |
3728 #endif // defined TARGET_ARCH_ARM | 3728 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |