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

Unified Diff: runtime/vm/object.cc

Issue 22640019: Fix for running with --throw_on_javascript_int_overflow: recognize pattern (a << b) & mask and test… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 26120)
+++ runtime/vm/object.cc (working copy)
@@ -11516,11 +11516,13 @@
}
-RawInteger* Integer::New(int64_t value, Heap::Space space) {
+RawInteger* Integer::New(int64_t value, Heap::Space space, const bool silent) {
if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) {
return Smi::New(value);
}
- if (FLAG_throw_on_javascript_int_overflow && !IsJavascriptInt(value)) {
+ if (!silent &&
+ FLAG_throw_on_javascript_int_overflow &&
+ !IsJavascriptInt(value)) {
const Integer &i = Integer::Handle(Mint::New(value));
ThrowJavascriptIntegerOverflow(i);
}
@@ -11763,7 +11765,9 @@
// TODO(srdjan): Clarify handling of negative right operand in a shift op.
-RawInteger* Smi::ShiftOp(Token::Kind kind, const Smi& other) const {
+RawInteger* Smi::ShiftOp(Token::Kind kind,
+ const Smi& other,
+ const bool silent) const {
intptr_t result = 0;
const intptr_t left_value = Value();
const intptr_t right_value = other.Value();
@@ -11782,7 +11786,7 @@
right_value);
} else {
int64_t left_64 = left_value;
- return Integer::New(left_64 << right_value);
+ return Integer::New(left_64 << right_value, Heap::kNew, silent);
}
}
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698