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

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

Issue 2189253002: DBC: Add single stepping check to fast Smi ops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/tests/vm/vm.status ('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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 // Declare bytecode handler for a smi operation (e.g. AddTOS) with the 792 // Declare bytecode handler for a smi operation (e.g. AddTOS) with the
793 // given result type and the given behavior specified as a function 793 // given result type and the given behavior specified as a function
794 // that takes left and right operands and result slot and returns 794 // that takes left and right operands and result slot and returns
795 // true if fast-path succeeds. 795 // true if fast-path succeeds.
796 #define SMI_FASTPATH_TOS(ResultT, Func) \ 796 #define SMI_FASTPATH_TOS(ResultT, Func) \
797 { \ 797 { \
798 const intptr_t lhs = reinterpret_cast<intptr_t>(SP[-1]); \ 798 const intptr_t lhs = reinterpret_cast<intptr_t>(SP[-1]); \
799 const intptr_t rhs = reinterpret_cast<intptr_t>(SP[-0]); \ 799 const intptr_t rhs = reinterpret_cast<intptr_t>(SP[-0]); \
800 ResultT* slot = reinterpret_cast<ResultT*>(SP - 1); \ 800 ResultT* slot = reinterpret_cast<ResultT*>(SP - 1); \
801 if (LIKELY(AreBothSmis(lhs, rhs) && !Func(lhs, rhs, slot))) { \ 801 if (LIKELY(!thread->isolate()->single_step()) && \
802 LIKELY(AreBothSmis(lhs, rhs) && \
803 !Func(lhs, rhs, slot))) { \
802 SMI_FASTPATH_ICDATA_INC; \ 804 SMI_FASTPATH_ICDATA_INC; \
803 /* Fast path succeeded. Skip the generic call that follows. */ \ 805 /* Fast path succeeded. Skip the generic call that follows. */ \
804 pc++; \ 806 pc++; \
805 /* We dropped 2 arguments and push result */ \ 807 /* We dropped 2 arguments and push result */ \
806 SP--; \ 808 SP--; \
807 } \ 809 } \
808 } 810 }
809 811
810 // Skip the next instruction if there is no overflow. 812 // Skip the next instruction if there is no overflow.
811 #define SMI_OP_CHECK(ResultT, Func) \ 813 #define SMI_OP_CHECK(ResultT, Func) \
(...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 pc_ = pc; 3028 pc_ = pc;
3027 special_[kExceptionSpecialIndex] = raw_exception; 3029 special_[kExceptionSpecialIndex] = raw_exception;
3028 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3030 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3029 buf->Longjmp(); 3031 buf->Longjmp();
3030 UNREACHABLE(); 3032 UNREACHABLE();
3031 } 3033 }
3032 3034
3033 } // namespace dart 3035 } // namespace dart
3034 3036
3035 #endif // defined TARGET_ARCH_DBC 3037 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698