From 09668ec3f69140c520fddd78b599128c40850a3f Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 21 Aug 2013 08:28:59 +0000 Subject: [PATCH] Use CheckUsesForFlag to check flag in uses list BUG= R=yangguo@chromium.org Review URL: https://codereview.chromium.org/22862009 Patch from Weiliang Lin . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-arm.cc | 14 ++------------ src/ia32/lithium-ia32.cc | 14 ++------------ src/mips/lithium-mips.cc | 14 ++------------ src/x64/lithium-x64.cc | 7 +------ 4 files changed, 7 insertions(+), 42 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 998b73b..12a6290 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -718,12 +718,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Left shifts can deoptimize if we shift by > 0 and the result cannot be // truncated to smi. if (instr->representation().IsSmi() && constant_value > 0) { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToSmi); } } else { right = UseRegisterAtStart(right_value); @@ -735,12 +730,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); } else { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); } } diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index b315868..2c4799e 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -772,12 +772,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Left shifts can deoptimize if we shift by > 0 and the result cannot be // truncated to smi. if (instr->representation().IsSmi() && constant_value > 0) { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToSmi); } } else { right = UseFixed(right_value, ecx); @@ -789,12 +784,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); } else { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); } } diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 861e65d..907c5b6 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -723,12 +723,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, // Left shifts can deoptimize if we shift by > 0 and the result cannot be // truncated to smi. if (instr->representation().IsSmi() && constant_value > 0) { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToSmi); } } else { right = UseRegisterAtStart(right_value); @@ -740,12 +735,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); } else { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); } } diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index c058b0d..a449d8e 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -734,12 +734,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); } else { - for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { - if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { - does_deopt = true; - break; - } - } + does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); } } -- 2.7.4