Revert "Smi-support for HSar."

Reverting https://chromiumcodereview.appspot.com/21049003

R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/21076003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15939 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2013-07-29 17:17:19 +00:00
parent 480729ff79
commit 4ab26b7ed4
6 changed files with 6 additions and 21 deletions

View File

@ -733,9 +733,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
constant_value = constant->Integer32Value() & 0x1f; constant_value = constant->Integer32Value() & 0x1f;
// Left shifts can deoptimize if we shift by > 0 and the result cannot be // Left shifts can deoptimize if we shift by > 0 and the result cannot be
// truncated to smi. // truncated to smi.
if (instr->representation().IsSmi() && if (instr->representation().IsSmi() && constant_value > 0) {
op == Token::SHL &&
constant_value > 0) {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
does_deopt = true; does_deopt = true;
@ -754,8 +752,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
does_deopt = !instr->CheckFlag(HInstruction::kUint32); does_deopt = !instr->CheckFlag(HInstruction::kUint32);
} else { } else {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) && if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
does_deopt = true; does_deopt = true;
break; break;
} }

View File

@ -1725,9 +1725,6 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
case Token::SAR: case Token::SAR:
if (shift_count != 0) { if (shift_count != 0) {
__ mov(result, Operand(left, ASR, shift_count)); __ mov(result, Operand(left, ASR, shift_count));
if (instr->hydrogen_value()->representation().IsSmi()) {
__ and_(result, result, Operand(~kSmiTagMask));
}
} else { } else {
__ Move(result, left); __ Move(result, left);
} }

View File

@ -4964,9 +4964,7 @@ class HShr: public HBitwiseBinaryOperation {
virtual void UpdateRepresentation(Representation new_rep, virtual void UpdateRepresentation(Representation new_rep,
HInferRepresentationPhase* h_infer, HInferRepresentationPhase* h_infer,
const char* reason) { const char* reason) {
if (new_rep.IsSmi() && !right()->IsConstant()) { if (new_rep.IsSmi()) new_rep = Representation::Integer32();
new_rep = Representation::Integer32();
}
HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason);
} }

View File

@ -1757,9 +1757,6 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
case Token::SAR: case Token::SAR:
if (shift_count != 0) { if (shift_count != 0) {
__ sar(ToRegister(left), shift_count); __ sar(ToRegister(left), shift_count);
if (instr->hydrogen_value()->representation().IsSmi()) {
__ and_(ToRegister(left), ~kSmiTagMask);
}
} }
break; break;
case Token::SHR: case Token::SHR:

View File

@ -787,9 +787,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
constant_value = constant->Integer32Value() & 0x1f; constant_value = constant->Integer32Value() & 0x1f;
// Left shifts can deoptimize if we shift by > 0 and the result cannot be // Left shifts can deoptimize if we shift by > 0 and the result cannot be
// truncated to smi. // truncated to smi.
if (instr->representation().IsSmi() && if (instr->representation().IsSmi() && constant_value > 0) {
op == Token::SHL &&
constant_value > 0) {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
does_deopt = true; does_deopt = true;
@ -808,8 +806,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
does_deopt = !instr->CheckFlag(HInstruction::kUint32); does_deopt = !instr->CheckFlag(HInstruction::kUint32);
} else { } else {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) && if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
does_deopt = true; does_deopt = true;
break; break;
} }

View File

@ -751,8 +751,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
does_deopt = !instr->CheckFlag(HInstruction::kUint32); does_deopt = !instr->CheckFlag(HInstruction::kUint32);
} else { } else {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) && if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
does_deopt = true; does_deopt = true;
break; break;
} }