From b6f82c734c7523fd6d4f69c7a266336b8bee73b5 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Mon, 6 Oct 2014 13:15:23 +0000 Subject: [PATCH] Remove FLAG_opt_safe_uint32_operations. It has been turned on by default for a long time, and hydrogenized BinaryOpStubs actually depend on it being turned on. BUG=v8:3487 LOG=n R=ishell@chromium.org Review URL: https://codereview.chromium.org/630023002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-arm.cc | 6 +----- src/arm64/lithium-arm64.cc | 6 +----- src/flag-definitions.h | 3 --- src/hydrogen.cc | 10 ++++------ src/ia32/lithium-ia32.cc | 6 +----- src/mips/lithium-mips.cc | 6 +----- src/mips64/lithium-mips64.cc | 6 +----- src/x64/lithium-x64.cc | 6 +----- src/x87/lithium-x87.cc | 6 +----- test/mjsunit/compiler/shift-shr.js | 2 +- test/mjsunit/mjsunit.status | 4 ---- 11 files changed, 12 insertions(+), 49 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index c9462b4..46897a3 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -699,11 +699,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift // by 0 and the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc index 83cf52b..241bc4b 100644 --- a/src/arm64/lithium-arm64.cc +++ b/src/arm64/lithium-arm64.cc @@ -2236,11 +2236,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, (JSShiftAmountFromHConstant(instr->right()) == 0); bool can_deopt = false; if ((op == Token::SHR) && right_can_be_zero) { - if (FLAG_opt_safe_uint32_operations) { - can_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - can_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + can_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result; diff --git a/src/flag-definitions.h b/src/flag-definitions.h index bfa2dca..6fd33a5 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -307,9 +307,6 @@ DEFINE_INT(escape_analysis_iterations, 2, "maximum number of escape analysis fix-point iterations") DEFINE_BOOL(optimize_for_in, true, "optimize functions containing for-in loops") -DEFINE_BOOL(opt_safe_uint32_operations, true, - "allow uint32 values on optimize frames if they are used only in " - "safe operations") DEFINE_BOOL(concurrent_recompilation, true, "optimizing hot functions asynchronously on a separate thread") diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 54adfea..2c4435c 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -2686,9 +2686,8 @@ HInstruction* HGraphBuilder::AddElementAccess( DCHECK(val == NULL); HLoadKeyed* load = Add( elements, checked_key, dependency, elements_kind, load_mode); - if (FLAG_opt_safe_uint32_operations && - (elements_kind == EXTERNAL_UINT32_ELEMENTS || - elements_kind == UINT32_ELEMENTS)) { + if (elements_kind == EXTERNAL_UINT32_ELEMENTS || + elements_kind == UINT32_ELEMENTS) { graph()->RecordUint32Instruction(load); } return load; @@ -4400,7 +4399,7 @@ bool HGraph::Optimize(BailoutReason* bailout_reason) { // Must be performed before canonicalization to ensure that Canonicalize // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with // zero. - if (FLAG_opt_safe_uint32_operations) Run(); + Run(); if (FLAG_use_canonicalizing) Run(); @@ -10456,8 +10455,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( break; case Token::SHR: instr = AddUncasted(left, right); - if (FLAG_opt_safe_uint32_operations && instr->IsShr() && - CanBeZero(right)) { + if (instr->IsShr() && CanBeZero(right)) { graph()->RecordUint32Instruction(instr); } break; diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index c9a23fd..8b20e86 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -739,11 +739,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift by 0 and // the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 7002ca4..c7f3517 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -706,11 +706,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift // by 0 and the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/src/mips64/lithium-mips64.cc b/src/mips64/lithium-mips64.cc index 9ebe74e..664fdd0 100644 --- a/src/mips64/lithium-mips64.cc +++ b/src/mips64/lithium-mips64.cc @@ -706,11 +706,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift // by 0 and the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 9572a33..541d37a 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -722,11 +722,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift by 0 and // the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc index 3169a86..c23bce4 100644 --- a/src/x87/lithium-x87.cc +++ b/src/x87/lithium-x87.cc @@ -736,11 +736,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Shift operations can only deoptimize if we do a logical shift by 0 and // the result cannot be truncated to int32. if (op == Token::SHR && constant_value == 0) { - if (FLAG_opt_safe_uint32_operations) { - does_deopt = !instr->CheckFlag(HInstruction::kUint32); - } else { - does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); - } + does_deopt = !instr->CheckFlag(HInstruction::kUint32); } LInstruction* result = diff --git a/test/mjsunit/compiler/shift-shr.js b/test/mjsunit/compiler/shift-shr.js index a300b2a..52cd370 100644 --- a/test/mjsunit/compiler/shift-shr.js +++ b/test/mjsunit/compiler/shift-shr.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --allow-natives-syntax --noopt-safe-uint32-operations +// Flags: --allow-natives-syntax // Check the results of `left >>> right`. The result is always unsigned (and // therefore positive). diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index aad4573..4a10f82 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -51,10 +51,6 @@ # Issue 3389: deopt_every_n_garbage_collections is unsafe 'regress/regress-2653': [SKIP], - # This test relies on --noopt-safe-uint32-operations, which is broken. See - # issue 3487 for details. - 'compiler/shift-shr': [SKIP], - ############################################################################## # TurboFan compiler failures. -- 2.7.4