| Index: runtime/vm/intermediate_language_x64.cc
|
| diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
|
| index 1f840fd9211b9782ca373355fee1977cb67668cf..c10b0a1650fb6d2d6a331d2c8cbaa31803496870 100644
|
| --- a/runtime/vm/intermediate_language_x64.cc
|
| +++ b/runtime/vm/intermediate_language_x64.cc
|
| @@ -26,7 +26,6 @@ namespace dart {
|
| DECLARE_FLAG(bool, allow_absolute_addresses);
|
| DECLARE_FLAG(bool, emit_edge_counters);
|
| DECLARE_FLAG(int, optimization_counter_threshold);
|
| -DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
|
| DECLARE_FLAG(bool, use_osr);
|
| DECLARE_FLAG(bool, precompilation);
|
|
|
| @@ -2687,22 +2686,6 @@ void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -static void EmitJavascriptOverflowCheck(FlowGraphCompiler* compiler,
|
| - Range* range,
|
| - Label* overflow,
|
| - Register result) {
|
| - if (!RangeUtils::IsWithin(range, -0x20000000000000LL, 0x20000000000000LL)) {
|
| - ASSERT(overflow != NULL);
|
| - // TODO(zra): This can be tightened to one compare/branch using:
|
| - // overflow = (result + 2^52) > 2^53 with an unsigned comparison.
|
| - __ CompareImmediate(result, Immediate(-0x20000000000000LL));
|
| - __ j(LESS, overflow);
|
| - __ CompareImmediate(result, Immediate(0x20000000000000LL));
|
| - __ j(GREATER, overflow);
|
| - }
|
| -}
|
| -
|
| -
|
| static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
|
| BinarySmiOpInstr* shift_left) {
|
| const LocationSummary& locs = *shift_left->locs();
|
| @@ -2730,9 +2713,6 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
|
| }
|
| // Shift for result now we know there is no overflow.
|
| __ shlq(left, Immediate(value));
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result);
|
| - }
|
| return;
|
| }
|
|
|
| @@ -2761,9 +2741,6 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
|
| __ SmiUntag(right);
|
| __ shlq(left, right);
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result);
|
| - }
|
| return;
|
| }
|
|
|
| @@ -2813,9 +2790,6 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
|
| // Shift for result now we know there is no overflow.
|
| __ shlq(left, right);
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result);
|
| - }
|
| }
|
|
|
|
|
| @@ -2996,9 +2970,6 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| UNREACHABLE();
|
| break;
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, result);
|
| - }
|
| return;
|
| } // locs()->in(1).IsConstant().
|
|
|
| @@ -3041,9 +3012,6 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| UNREACHABLE();
|
| break;
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, result);
|
| - }
|
| return;
|
| } // locs()->in(1).IsStackSlot().
|
|
|
| @@ -3240,9 +3208,6 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| UNREACHABLE();
|
| break;
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, result);
|
| - }
|
| }
|
|
|
|
|
| @@ -4732,9 +4697,6 @@ void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp);
|
| __ negq(value);
|
| __ j(OVERFLOW, deopt);
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, value);
|
| - }
|
| break;
|
| }
|
| case Token::kBIT_NOT:
|
| @@ -4938,9 +4900,6 @@ void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ shlq(temp, Immediate(1));
|
| __ j(OVERFLOW, &do_call, Assembler::kNearJump);
|
| __ SmiTag(result);
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), &do_call, result);
|
| - }
|
| __ jmp(&done);
|
| __ Bind(&do_call);
|
| ASSERT(instance_call()->HasICData());
|
| @@ -4988,9 +4947,6 @@ void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ shlq(temp, Immediate(1));
|
| __ j(OVERFLOW, deopt);
|
| __ SmiTag(result);
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, result);
|
| - }
|
| }
|
|
|
|
|
| @@ -5423,7 +5379,6 @@ void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|
|
| __ SmiTag(RAX);
|
| __ SmiTag(RDX);
|
| - // FLAG_throw_on_javascript_int_overflow: not needed.
|
| // Note that the result of an integer division/modulo of two
|
| // in-range arguments, cannot create out-of-range result.
|
| return;
|
| @@ -5728,10 +5683,6 @@ void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
| EmitInt64Arithmetic(compiler, op_kind(), left, right, deopt);
|
| -
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, out);
|
| - }
|
| }
|
|
|
|
|
| @@ -5752,17 +5703,7 @@ void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| const Register left = locs()->in(0).reg();
|
| const Register out = locs()->out(0).reg();
|
| ASSERT(out == left);
|
| -
|
| - Label* deopt = NULL;
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryMintOp);
|
| - }
|
| -
|
| __ notq(left);
|
| -
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, out);
|
| - }
|
| }
|
|
|
|
|
| @@ -5859,9 +5800,6 @@ void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| UNREACHABLE();
|
| }
|
| }
|
| - if (FLAG_throw_on_javascript_int_overflow) {
|
| - EmitJavascriptOverflowCheck(compiler, range(), deopt, out);
|
| - }
|
| }
|
|
|
|
|
|
|