ARM: Optimize Integer32ToSmi

Optimize register constraints and code generated for Integer32ToSmi Lithium
instruction.

TEST=none
BUG=
R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18084 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ab966311
...@@ -2031,8 +2031,8 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { ...@@ -2031,8 +2031,8 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
HValue* val = instr->value(); HValue* val = instr->value();
LOperand* value = UseRegister(val); LOperand* value = UseRegister(val);
LInstruction* result = val->CheckFlag(HInstruction::kUint32) LInstruction* result = val->CheckFlag(HInstruction::kUint32)
? DefineSameAsFirst(new(zone()) LUint32ToSmi(value)) ? DefineAsRegister(new(zone()) LUint32ToSmi(value))
: DefineSameAsFirst(new(zone()) LInteger32ToSmi(value)); : DefineAsRegister(new(zone()) LInteger32ToSmi(value));
if (val->HasRange() && val->range()->IsInSmiRange()) { if (val->HasRange() && val->range()->IsInSmiRange()) {
return result; return result;
} }
......
...@@ -4695,10 +4695,13 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { ...@@ -4695,10 +4695,13 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
LOperand* input = instr->value(); LOperand* input = instr->value();
LOperand* output = instr->result(); LOperand* output = instr->result();
__ SmiTag(ToRegister(output), ToRegister(input), SetCC); ASSERT(output->IsRegister());
if (!instr->hydrogen()->value()->HasRange() || if (!instr->hydrogen()->value()->HasRange() ||
!instr->hydrogen()->value()->range()->IsInSmiRange()) { !instr->hydrogen()->value()->range()->IsInSmiRange()) {
__ SmiTag(ToRegister(output), ToRegister(input), SetCC);
DeoptimizeIf(vs, instr->environment()); DeoptimizeIf(vs, instr->environment());
} else {
__ SmiTag(ToRegister(output), ToRegister(input));
} }
} }
......
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