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

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

Issue 2474103003: DBC: Fix smi shl with large (>word-size) shift counts (Closed)
Patch Set: update co19 test status Created 4 years, 1 month 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 | « no previous file | tests/co19/co19-runtime.status » ('j') | 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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 *reinterpret_cast<intptr_t*>(&FP[rA]) = 1976 *reinterpret_cast<intptr_t*>(&FP[rA]) =
1977 (res < 0) ? ((rhs < 0) ? (res - rhs) : (res + rhs)) : res; 1977 (res < 0) ? ((rhs < 0) ? (res - rhs) : (res + rhs)) : res;
1978 pc++; 1978 pc++;
1979 } 1979 }
1980 DISPATCH(); 1980 DISPATCH();
1981 } 1981 }
1982 1982
1983 { 1983 {
1984 BYTECODE(Shl, A_B_C); 1984 BYTECODE(Shl, A_B_C);
1985 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]) >> kSmiTagSize; 1985 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]) >> kSmiTagSize;
1986 if (rhs >= 0) { 1986 if (static_cast<uintptr_t>(rhs) < kBitsPerWord) {
1987 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]); 1987 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
1988 const intptr_t res = lhs << rhs; 1988 const intptr_t res = lhs << rhs;
1989 if (lhs == (res >> rhs)) { 1989 if (lhs == (res >> rhs)) {
1990 *reinterpret_cast<intptr_t*>(&FP[rA]) = res; 1990 *reinterpret_cast<intptr_t*>(&FP[rA]) = res;
1991 pc++; 1991 pc++;
1992 } 1992 }
1993 } 1993 }
1994 DISPATCH(); 1994 DISPATCH();
1995 } 1995 }
1996 1996
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after
3754 pc_ = pc; 3754 pc_ = pc;
3755 special_[kExceptionSpecialIndex] = raw_exception; 3755 special_[kExceptionSpecialIndex] = raw_exception;
3756 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3756 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3757 buf->Longjmp(); 3757 buf->Longjmp();
3758 UNREACHABLE(); 3758 UNREACHABLE();
3759 } 3759 }
3760 3760
3761 } // namespace dart 3761 } // namespace dart
3762 3762
3763 #endif // defined TARGET_ARCH_DBC 3763 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698