Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 2408423004: DBC: Fix CheckCids instruction (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after
2874 const bool may_be_smi = (rB == 1); 2874 const bool may_be_smi = (rB == 1);
2875 const intptr_t cids_length = rC; 2875 const intptr_t cids_length = rC;
2876 if (LIKELY(!is_smi)) { 2876 if (LIKELY(!is_smi)) {
2877 const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]); 2877 const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]);
2878 for (intptr_t i = 0; i < cids_length; i++) { 2878 for (intptr_t i = 0; i < cids_length; i++) {
2879 const intptr_t desired_cid = Bytecode::DecodeD(*(pc + i)); 2879 const intptr_t desired_cid = Bytecode::DecodeD(*(pc + i));
2880 if (cid == desired_cid) { 2880 if (cid == desired_cid) {
2881 pc++; 2881 pc++;
2882 break; 2882 break;
2883 } 2883 }
2884 // The cids are sorted. 2884 // The cids are sorted in descending order.
2885 if (cid < desired_cid) { 2885 if (cid > desired_cid) {
2886 break; 2886 break;
2887 } 2887 }
2888 } 2888 }
2889 pc += cids_length; 2889 pc += cids_length;
2890 } else { 2890 } else {
2891 pc += cids_length; 2891 pc += cids_length;
2892 pc += (may_be_smi ? 1 : 0); 2892 pc += (may_be_smi ? 1 : 0);
2893 } 2893 }
2894 DISPATCH(); 2894 DISPATCH();
2895 } 2895 }
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 pc_ = pc; 3493 pc_ = pc;
3494 special_[kExceptionSpecialIndex] = raw_exception; 3494 special_[kExceptionSpecialIndex] = raw_exception;
3495 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3495 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3496 buf->Longjmp(); 3496 buf->Longjmp();
3497 UNREACHABLE(); 3497 UNREACHABLE();
3498 } 3498 }
3499 3499
3500 } // namespace dart 3500 } // namespace dart
3501 3501
3502 #endif // defined TARGET_ARCH_DBC 3502 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698