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
This commit is contained in:
m.m.capewell@googlemail.com 2013-11-26 16:34:13 +00:00
parent ab96631177
commit f6a5a262d0
2 changed files with 6 additions and 3 deletions

View File

@ -2031,8 +2031,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;
}

View File

@ -4695,10 +4695,13 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
LOperand* input = instr->value();
LOperand* output = instr->result();
__ SmiTag(ToRegister(output), ToRegister(input), SetCC);
ASSERT(output->IsRegister());
if (!instr->hydrogen()->value()->HasRange() ||
!instr->hydrogen()->value()->range()->IsInSmiRange()) {
__ SmiTag(ToRegister(output), ToRegister(input), SetCC);
DeoptimizeIf(vs, instr->environment());
} else {
__ SmiTag(ToRegister(output), ToRegister(input));
}
}