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 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 BYTECODE(TestSmi, A_D); | 2051 BYTECODE(TestSmi, A_D); |
2052 intptr_t left = reinterpret_cast<intptr_t>(RAW_CAST(Smi, FP[rA])); | 2052 intptr_t left = reinterpret_cast<intptr_t>(RAW_CAST(Smi, FP[rA])); |
2053 intptr_t right = reinterpret_cast<intptr_t>(RAW_CAST(Smi, FP[rD])); | 2053 intptr_t right = reinterpret_cast<intptr_t>(RAW_CAST(Smi, FP[rD])); |
2054 if ((left & right) != 0) { | 2054 if ((left & right) != 0) { |
2055 pc++; | 2055 pc++; |
2056 } | 2056 } |
2057 DISPATCH(); | 2057 DISPATCH(); |
2058 } | 2058 } |
2059 | 2059 |
2060 { | 2060 { |
| 2061 BYTECODE(TestCids, A_D); |
| 2062 const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]); |
| 2063 const intptr_t num_cases = rD; |
| 2064 for (intptr_t i = 0; i < num_cases; i++) { |
| 2065 ASSERT(Bytecode::DecodeOpcode(pc[i]) == Bytecode::kNop); |
| 2066 intptr_t test_target = Bytecode::DecodeA(pc[i]); |
| 2067 intptr_t test_cid = Bytecode::DecodeD(pc[i]); |
| 2068 if (cid == test_cid) { |
| 2069 if (test_target != 0) { |
| 2070 pc += 1; // Match true. |
| 2071 } else { |
| 2072 pc += 2; // Match false. |
| 2073 } |
| 2074 break; |
| 2075 } |
| 2076 } |
| 2077 pc += num_cases; |
| 2078 DISPATCH(); |
| 2079 } |
| 2080 |
| 2081 { |
2061 BYTECODE(CheckSmi, 0); | 2082 BYTECODE(CheckSmi, 0); |
2062 intptr_t obj = reinterpret_cast<intptr_t>(FP[rA]); | 2083 intptr_t obj = reinterpret_cast<intptr_t>(FP[rA]); |
2063 if ((obj & kSmiTagMask) == kSmiTag) { | 2084 if ((obj & kSmiTagMask) == kSmiTag) { |
2064 pc++; | 2085 pc++; |
2065 } | 2086 } |
2066 DISPATCH(); | 2087 DISPATCH(); |
2067 } | 2088 } |
2068 | 2089 |
2069 { | 2090 { |
2070 BYTECODE(CheckClassId, A_D); | 2091 BYTECODE(CheckClassId, A_D); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2454 special_[kExceptionSpecialIndex] = raw_exception; | 2475 special_[kExceptionSpecialIndex] = raw_exception; |
2455 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 2476 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
2456 buf->Longjmp(); | 2477 buf->Longjmp(); |
2457 UNREACHABLE(); | 2478 UNREACHABLE(); |
2458 } | 2479 } |
2459 | 2480 |
2460 } // namespace dart | 2481 } // namespace dart |
2461 | 2482 |
2462 | 2483 |
2463 #endif // defined TARGET_ARCH_DBC | 2484 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |