Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
| index bac1db4de3f0e09760ec109b86cb912a49c049e7..9670bbb9fb1a1325da72d6d6ce780860d410ee7a 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -2114,7 +2114,28 @@ void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
| void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
| - Abort("DoCheckInstanceType unimplemented."); |
| + Register input = ToRegister(instr->input()); |
| + Register scratch = scratch0(); |
|
Søren Thygesen Gjesse
2011/01/05 20:52:36
It is convenient to use ip as an intermediate regi
Karl Klose
2011/01/06 12:47:14
I remove the second temporary and use only scratch
|
| + Register type = ip; |
| + InstanceType first = instr->hydrogen()->first(); |
| + InstanceType last = instr->hydrogen()->last(); |
| + |
| + __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
|
Søren Thygesen Gjesse
2011/01/05 20:52:36
Can't you just replace type with scratch here?
Karl Klose
2011/01/06 12:47:14
Done.
|
| + __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
| + __ cmp(type, Operand(first)); |
| + |
| + // If there is only one type in the interval check for equality. |
| + if (first == last) { |
| + DeoptimizeIf(ne, instr->environment()); |
| + } else { |
| + DeoptimizeIf(lo, instr->environment()); |
| + // Omit check for the last type. |
| + if (last != LAST_TYPE) { |
|
Søren Thygesen Gjesse
2011/01/05 20:52:36
No need to reload type - can stay in scratch.
Karl Klose
2011/01/06 12:47:14
Done.
|
| + __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
| + __ cmp(type, Operand(last)); |
| + DeoptimizeIf(hi, instr->environment()); |
| + } |
| + } |
| } |