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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 } | 1487 } |
1488 set_top_exit_frame_info(0); | 1488 set_top_exit_frame_info(0); |
1489 | 1489 |
1490 // Zap caller-saved registers, since the actual runtime call could have | 1490 // Zap caller-saved registers, since the actual runtime call could have |
1491 // used them. | 1491 // used them. |
1492 set_register(R1, icount_); | 1492 set_register(R1, icount_); |
1493 set_register(R2, icount_); | 1493 set_register(R2, icount_); |
1494 set_register(R3, icount_); | 1494 set_register(R3, icount_); |
1495 set_register(IP, icount_); | 1495 set_register(IP, icount_); |
1496 set_register(LR, icount_); | 1496 set_register(LR, icount_); |
1497 float zap_fvalue = static_cast<float>(icount_); | 1497 double zap_dvalue = static_cast<double>(icount_); |
1498 for (int i = S0; i <= S15; i++) { | 1498 for (int i = D0; i <= D7; i++) { |
1499 set_sregister(static_cast<SRegister>(i), zap_fvalue); | 1499 set_dregister(static_cast<DRegister>(i), zap_dvalue); |
1500 } | 1500 } |
| 1501 // The above loop also zaps overlapping registers S0-S15. |
| 1502 // Registers D8-D15 (overlapping with S16-S31) are preserved. |
1501 #ifdef VFPv3_D32 | 1503 #ifdef VFPv3_D32 |
1502 double zap_dvalue = static_cast<double>(icount_); | |
1503 for (int i = D16; i <= D31; i++) { | 1504 for (int i = D16; i <= D31; i++) { |
1504 set_dregister(static_cast<DRegister>(i), zap_dvalue); | 1505 set_dregister(static_cast<DRegister>(i), zap_dvalue); |
1505 } | 1506 } |
1506 #endif // VFPv3_D32 | 1507 #endif // VFPv3_D32 |
1507 | 1508 |
1508 // Return. | 1509 // Return. |
1509 set_pc(saved_lr); | 1510 set_pc(saved_lr); |
1510 } else { | 1511 } else { |
1511 // Coming via long jump from a throw. Continue to exception handler. | 1512 // Coming via long jump from a throw. Continue to exception handler. |
1512 set_top_exit_frame_info(0); | 1513 set_top_exit_frame_info(0); |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3049 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3049 } | 3050 } |
3050 buf->Longjmp(); | 3051 buf->Longjmp(); |
3051 } | 3052 } |
3052 | 3053 |
3053 } // namespace dart | 3054 } // namespace dart |
3054 | 3055 |
3055 #endif // !defined(HOST_ARCH_ARM) | 3056 #endif // !defined(HOST_ARCH_ARM) |
3056 | 3057 |
3057 #endif // defined TARGET_ARCH_ARM | 3058 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |