| 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 3236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3247 { | 3247 { |
| 3248 BYTECODE(CheckClassId, A_D); | 3248 BYTECODE(CheckClassId, A_D); |
| 3249 const intptr_t actual_cid = | 3249 const intptr_t actual_cid = |
| 3250 reinterpret_cast<intptr_t>(FP[rA]) >> kSmiTagSize; | 3250 reinterpret_cast<intptr_t>(FP[rA]) >> kSmiTagSize; |
| 3251 const intptr_t desired_cid = rD; | 3251 const intptr_t desired_cid = rD; |
| 3252 pc += (actual_cid == desired_cid) ? 1 : 0; | 3252 pc += (actual_cid == desired_cid) ? 1 : 0; |
| 3253 DISPATCH(); | 3253 DISPATCH(); |
| 3254 } | 3254 } |
| 3255 | 3255 |
| 3256 { | 3256 { |
| 3257 BYTECODE(CheckDenseSwitch, A_D); | 3257 BYTECODE(CheckBitTest, A_D); |
| 3258 const intptr_t raw_value = reinterpret_cast<intptr_t>(FP[rA]); | 3258 const intptr_t raw_value = reinterpret_cast<intptr_t>(FP[rA]); |
| 3259 const bool is_smi = ((raw_value & kSmiTagMask) == kSmiTag); | 3259 const bool is_smi = ((raw_value & kSmiTagMask) == kSmiTag); |
| 3260 const intptr_t cid_min = Bytecode::DecodeD(*pc); | 3260 const intptr_t cid_min = Bytecode::DecodeD(*pc); |
| 3261 const intptr_t cid_mask = | 3261 const intptr_t cid_mask = |
| 3262 Smi::Value(RAW_CAST(Smi, LOAD_CONSTANT(Bytecode::DecodeD(*(pc + 1))))); | 3262 Smi::Value(RAW_CAST(Smi, LOAD_CONSTANT(Bytecode::DecodeD(*(pc + 1))))); |
| 3263 if (LIKELY(!is_smi)) { | 3263 if (LIKELY(!is_smi)) { |
| 3264 const intptr_t cid_max = Utils::HighestBit(cid_mask) + cid_min; | 3264 const intptr_t cid_max = Utils::HighestBit(cid_mask) + cid_min; |
| 3265 const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]); | 3265 const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]); |
| 3266 // The cid is in-bounds, and the bit is set in the mask. | 3266 // The cid is in-bounds, and the bit is set in the mask. |
| 3267 if ((cid >= cid_min) && (cid <= cid_max) && | 3267 if ((cid >= cid_min) && (cid <= cid_max) && |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3883 pc_ = pc; | 3883 pc_ = pc; |
| 3884 } | 3884 } |
| 3885 | 3885 |
| 3886 buf->Longjmp(); | 3886 buf->Longjmp(); |
| 3887 UNREACHABLE(); | 3887 UNREACHABLE(); |
| 3888 } | 3888 } |
| 3889 | 3889 |
| 3890 } // namespace dart | 3890 } // namespace dart |
| 3891 | 3891 |
| 3892 #endif // defined TARGET_ARCH_DBC | 3892 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |