| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 #undef STR | 498 #undef STR |
| 499 #undef XSTR | 499 #undef XSTR |
| 500 } | 500 } |
| 501 | 501 |
| 502 | 502 |
| 503 char* SimulatorDebugger::ReadLine(const char* prompt) { | 503 char* SimulatorDebugger::ReadLine(const char* prompt) { |
| 504 char* result = NULL; | 504 char* result = NULL; |
| 505 char line_buf[256]; | 505 char line_buf[256]; |
| 506 int offset = 0; | 506 int offset = 0; |
| 507 bool keep_going = true; | 507 bool keep_going = true; |
| 508 fprintf(stdout, "%s", prompt); | 508 OS::Print("%s", prompt); |
| 509 fflush(stdout); | |
| 510 while (keep_going) { | 509 while (keep_going) { |
| 511 if (fgets(line_buf, sizeof(line_buf), stdin) == NULL) { | 510 if (fgets(line_buf, sizeof(line_buf), stdin) == NULL) { |
| 512 // fgets got an error. Just give up. | 511 // fgets got an error. Just give up. |
| 513 if (result != NULL) { | 512 if (result != NULL) { |
| 514 delete[] result; | 513 delete[] result; |
| 515 } | 514 } |
| 516 return NULL; | 515 return NULL; |
| 517 } | 516 } |
| 518 int len = strlen(line_buf); | 517 int len = strlen(line_buf); |
| 519 if (len > 1 && | 518 if (len > 1 && |
| (...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 if (lo_res != 0) { | 1548 if (lo_res != 0) { |
| 1550 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works. | 1549 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works. |
| 1551 hi_res |= 1; | 1550 hi_res |= 1; |
| 1552 } | 1551 } |
| 1553 ASSERT((result == 0) == (hi_res == 0)); // Z bit | 1552 ASSERT((result == 0) == (hi_res == 0)); // Z bit |
| 1554 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit | 1553 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit |
| 1555 SetNZFlags(hi_res); | 1554 SetNZFlags(hi_res); |
| 1556 } | 1555 } |
| 1557 break; | 1556 break; |
| 1558 } | 1557 } |
| 1558 case 6: { |
| 1559 // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs. |
| 1560 // Format(instr, "smull'cond's 'rd, 'rn, 'rm, 'rs"); |
| 1561 int64_t left_op = static_cast<int32_t>(rm_val); |
| 1562 int64_t right_op = static_cast<int32_t>(rs_val); |
| 1563 int64_t result = left_op * right_op; |
| 1564 int32_t hi_res = Utils::High32Bits(result); |
| 1565 int32_t lo_res = Utils::Low32Bits(result); |
| 1566 set_register(rd, lo_res); |
| 1567 set_register(rn, hi_res); |
| 1568 if (instr->HasS()) { |
| 1569 if (lo_res != 0) { |
| 1570 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works. |
| 1571 hi_res |= 1; |
| 1572 } |
| 1573 ASSERT((result == 0) == (hi_res == 0)); // Z bit |
| 1574 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit |
| 1575 SetNZFlags(hi_res); |
| 1576 } |
| 1577 break; |
| 1578 } |
| 1559 default: { | 1579 default: { |
| 1560 UnimplementedInstruction(instr); | 1580 UnimplementedInstruction(instr); |
| 1561 break; | 1581 break; |
| 1562 } | 1582 } |
| 1563 } | 1583 } |
| 1564 } else { | 1584 } else { |
| 1565 // synchronization primitives | 1585 // synchronization primitives |
| 1566 Register rd = instr->RdField(); | 1586 Register rd = instr->RdField(); |
| 1567 Register rn = instr->RnField(); | 1587 Register rn = instr->RnField(); |
| 1568 uword addr = get_register(rn); | 1588 uword addr = get_register(rn); |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2902 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2922 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 2903 } | 2923 } |
| 2904 buf->Longjmp(); | 2924 buf->Longjmp(); |
| 2905 } | 2925 } |
| 2906 | 2926 |
| 2907 } // namespace dart | 2927 } // namespace dart |
| 2908 | 2928 |
| 2909 #endif // !defined(HOST_ARCH_ARM) | 2929 #endif // !defined(HOST_ARCH_ARM) |
| 2910 | 2930 |
| 2911 #endif // defined TARGET_ARCH_ARM | 2931 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |