OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2107 | 2107 |
2108 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { | 2108 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
2109 LOperand* input = instr->input(); | 2109 LOperand* input = instr->input(); |
2110 ASSERT(input->IsRegister()); | 2110 ASSERT(input->IsRegister()); |
2111 __ tst(ToRegister(input), Operand(kSmiTagMask)); | 2111 __ tst(ToRegister(input), Operand(kSmiTagMask)); |
2112 DeoptimizeIf(instr->condition(), instr->environment()); | 2112 DeoptimizeIf(instr->condition(), instr->environment()); |
2113 } | 2113 } |
2114 | 2114 |
2115 | 2115 |
2116 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { | 2116 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
2117 Abort("DoCheckInstanceType unimplemented."); | 2117 Register input = ToRegister(instr->input()); |
2118 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
| |
2119 Register type = ip; | |
2120 InstanceType first = instr->hydrogen()->first(); | |
2121 InstanceType last = instr->hydrogen()->last(); | |
2122 | |
2123 __ 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.
| |
2124 __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | |
2125 __ cmp(type, Operand(first)); | |
2126 | |
2127 // If there is only one type in the interval check for equality. | |
2128 if (first == last) { | |
2129 DeoptimizeIf(ne, instr->environment()); | |
2130 } else { | |
2131 DeoptimizeIf(lo, instr->environment()); | |
2132 // Omit check for the last type. | |
2133 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.
| |
2134 __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | |
2135 __ cmp(type, Operand(last)); | |
2136 DeoptimizeIf(hi, instr->environment()); | |
2137 } | |
2138 } | |
2118 } | 2139 } |
2119 | 2140 |
2120 | 2141 |
2121 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { | 2142 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { |
2122 ASSERT(instr->input()->IsRegister()); | 2143 ASSERT(instr->input()->IsRegister()); |
2123 Register reg = ToRegister(instr->input()); | 2144 Register reg = ToRegister(instr->input()); |
2124 __ cmp(reg, Operand(instr->hydrogen()->target())); | 2145 __ cmp(reg, Operand(instr->hydrogen()->target())); |
2125 DeoptimizeIf(ne, instr->environment()); | 2146 DeoptimizeIf(ne, instr->environment()); |
2126 } | 2147 } |
2127 | 2148 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2370 | 2391 |
2371 | 2392 |
2372 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2393 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2373 Abort("DoOsrEntry unimplemented."); | 2394 Abort("DoOsrEntry unimplemented."); |
2374 } | 2395 } |
2375 | 2396 |
2376 | 2397 |
2377 #undef __ | 2398 #undef __ |
2378 | 2399 |
2379 } } // namespace v8::internal | 2400 } } // namespace v8::internal |
OLD | NEW |