OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 ? instr->FirstSuccessor() | 1040 ? instr->FirstSuccessor() |
1041 : instr->SecondSuccessor(); | 1041 : instr->SecondSuccessor(); |
1042 return new LGoto(successor->block_id()); | 1042 return new LGoto(successor->block_id()); |
1043 } | 1043 } |
1044 ToBooleanStub::Types expected = instr->expected_input_types(); | 1044 ToBooleanStub::Types expected = instr->expected_input_types(); |
1045 // We need a temporary register when we have to access the map *or* we have | 1045 // We need a temporary register when we have to access the map *or* we have |
1046 // no type info yet, in which case we handle all cases (including the ones | 1046 // no type info yet, in which case we handle all cases (including the ones |
1047 // involving maps). | 1047 // involving maps). |
1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); | 1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); |
1049 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1049 LOperand* temp = needs_temp ? TempRegister() : NULL; |
1050 LInstruction* branch = new LBranch(UseRegister(v), temp); | 1050 return AssignEnvironment(new LBranch(UseRegister(v), temp)); |
1051 // When we handle all cases, we never deopt, so we don't need to assign the | |
1052 // environment then. | |
1053 return expected.IsAll() ? branch : AssignEnvironment(branch); | |
1054 } | 1051 } |
1055 | 1052 |
1056 | 1053 |
1057 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1054 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
1058 ASSERT(instr->value()->representation().IsTagged()); | 1055 ASSERT(instr->value()->representation().IsTagged()); |
1059 LOperand* value = UseRegisterAtStart(instr->value()); | 1056 LOperand* value = UseRegisterAtStart(instr->value()); |
1060 return new LCmpMapAndBranch(value); | 1057 return new LCmpMapAndBranch(value); |
1061 } | 1058 } |
1062 | 1059 |
1063 | 1060 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 TempRegister()); | 1531 TempRegister()); |
1535 } | 1532 } |
1536 | 1533 |
1537 | 1534 |
1538 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { | 1535 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
1539 LOperand* array = UseRegisterAtStart(instr->value()); | 1536 LOperand* array = UseRegisterAtStart(instr->value()); |
1540 return DefineAsRegister(new LJSArrayLength(array)); | 1537 return DefineAsRegister(new LJSArrayLength(array)); |
1541 } | 1538 } |
1542 | 1539 |
1543 | 1540 |
1544 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { | 1541 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( |
| 1542 HFixedArrayBaseLength* instr) { |
1545 LOperand* array = UseRegisterAtStart(instr->value()); | 1543 LOperand* array = UseRegisterAtStart(instr->value()); |
1546 return DefineAsRegister(new LFixedArrayLength(array)); | 1544 return DefineAsRegister(new LFixedArrayBaseLength(array)); |
1547 } | |
1548 | |
1549 | |
1550 LInstruction* LChunkBuilder::DoExternalArrayLength( | |
1551 HExternalArrayLength* instr) { | |
1552 LOperand* array = UseRegisterAtStart(instr->value()); | |
1553 return DefineAsRegister(new LExternalArrayLength(array)); | |
1554 } | 1545 } |
1555 | 1546 |
1556 | 1547 |
1557 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { | 1548 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { |
1558 LOperand* object = UseRegisterAtStart(instr->value()); | 1549 LOperand* object = UseRegisterAtStart(instr->value()); |
1559 return DefineAsRegister(new LElementsKind(object)); | 1550 return DefineAsRegister(new LElementsKind(object)); |
1560 } | 1551 } |
1561 | 1552 |
1562 | 1553 |
1563 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { | 1554 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 LOperand* key = UseOrConstantAtStart(instr->key()); | 2256 LOperand* key = UseOrConstantAtStart(instr->key()); |
2266 LOperand* object = UseOrConstantAtStart(instr->object()); | 2257 LOperand* object = UseOrConstantAtStart(instr->object()); |
2267 LIn* result = new LIn(context, key, object); | 2258 LIn* result = new LIn(context, key, object); |
2268 return MarkAsCall(DefineFixed(result, eax), instr); | 2259 return MarkAsCall(DefineFixed(result, eax), instr); |
2269 } | 2260 } |
2270 | 2261 |
2271 | 2262 |
2272 } } // namespace v8::internal | 2263 } } // namespace v8::internal |
2273 | 2264 |
2274 #endif // V8_TARGET_ARCH_IA32 | 2265 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |