Commit b558a10c authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Optimize Integer32ToSmi.

Port r18084 (426bc19)

Original commit message:
Optimize register constraints and code generated for Integer32ToSmi Lithium
instruction.

TEST=none
BUG=
R=gergely@homejinni.com

Review URL: https://codereview.chromium.org/88623004

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c95173b2
......@@ -4633,10 +4633,13 @@ void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
LOperand* output = instr->result();
Register scratch = scratch0();
__ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch);
ASSERT(output->IsRegister());
if (!instr->hydrogen()->value()->HasRange() ||
!instr->hydrogen()->value()->range()->IsInSmiRange()) {
__ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch);
DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
} else {
__ SmiTag(ToRegister(output), ToRegister(input));
}
}
......
......@@ -1951,8 +1951,8 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
HValue* val = instr->value();
LOperand* value = UseRegister(val);
LInstruction* result = val->CheckFlag(HInstruction::kUint32)
? DefineSameAsFirst(new(zone()) LUint32ToSmi(value))
: DefineSameAsFirst(new(zone()) LInteger32ToSmi(value));
? DefineAsRegister(new(zone()) LUint32ToSmi(value))
: DefineAsRegister(new(zone()) LInteger32ToSmi(value));
if (val->HasRange() && val->range()->IsInSmiRange()) {
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment