| 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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 1029 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
| 1030 HValue* v = instr->value(); | 1030 HValue* v = instr->value(); |
| 1031 if (v->EmitAtUses()) { | 1031 if (v->EmitAtUses()) { |
| 1032 ASSERT(v->IsConstant()); | 1032 ASSERT(v->IsConstant()); |
| 1033 ASSERT(!v->representation().IsDouble()); | 1033 ASSERT(!v->representation().IsDouble()); |
| 1034 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() | 1034 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() |
| 1035 ? instr->FirstSuccessor() | 1035 ? instr->FirstSuccessor() |
| 1036 : instr->SecondSuccessor(); | 1036 : instr->SecondSuccessor(); |
| 1037 return new LGoto(successor->block_id()); | 1037 return new LGoto(successor->block_id()); |
| 1038 } | 1038 } |
| 1039 LInstruction* branch = new LBranch(UseRegister(v)); | 1039 return AssignEnvironment(new LBranch(UseRegister(v))); |
| 1040 // When we handle all cases, we never deopt, so we don't need to assign the | |
| 1041 // environment then. | |
| 1042 bool all_cases_handled = instr->expected_input_types().IsAll(); | |
| 1043 return all_cases_handled ? branch : AssignEnvironment(branch); | |
| 1044 } | 1040 } |
| 1045 | 1041 |
| 1046 | 1042 |
| 1047 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1043 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
| 1048 ASSERT(instr->value()->representation().IsTagged()); | 1044 ASSERT(instr->value()->representation().IsTagged()); |
| 1049 LOperand* value = UseRegisterAtStart(instr->value()); | 1045 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1050 return new LCmpMapAndBranch(value); | 1046 return new LCmpMapAndBranch(value); |
| 1051 } | 1047 } |
| 1052 | 1048 |
| 1053 | 1049 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 TempRegister()); | 1491 TempRegister()); |
| 1496 } | 1492 } |
| 1497 | 1493 |
| 1498 | 1494 |
| 1499 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { | 1495 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
| 1500 LOperand* array = UseRegisterAtStart(instr->value()); | 1496 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1501 return DefineAsRegister(new LJSArrayLength(array)); | 1497 return DefineAsRegister(new LJSArrayLength(array)); |
| 1502 } | 1498 } |
| 1503 | 1499 |
| 1504 | 1500 |
| 1505 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { | 1501 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( |
| 1502 HFixedArrayBaseLength* instr) { |
| 1506 LOperand* array = UseRegisterAtStart(instr->value()); | 1503 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1507 return DefineAsRegister(new LFixedArrayLength(array)); | 1504 return DefineAsRegister(new LFixedArrayBaseLength(array)); |
| 1508 } | |
| 1509 | |
| 1510 | |
| 1511 LInstruction* LChunkBuilder::DoExternalArrayLength( | |
| 1512 HExternalArrayLength* instr) { | |
| 1513 LOperand* array = UseRegisterAtStart(instr->value()); | |
| 1514 return DefineAsRegister(new LExternalArrayLength(array)); | |
| 1515 } | 1505 } |
| 1516 | 1506 |
| 1517 | 1507 |
| 1518 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { | 1508 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { |
| 1519 LOperand* object = UseRegisterAtStart(instr->value()); | 1509 LOperand* object = UseRegisterAtStart(instr->value()); |
| 1520 return DefineAsRegister(new LElementsKind(object)); | 1510 return DefineAsRegister(new LElementsKind(object)); |
| 1521 } | 1511 } |
| 1522 | 1512 |
| 1523 | 1513 |
| 1524 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { | 1514 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2177 LOperand* key = UseOrConstantAtStart(instr->key()); | 2167 LOperand* key = UseOrConstantAtStart(instr->key()); |
| 2178 LOperand* object = UseOrConstantAtStart(instr->object()); | 2168 LOperand* object = UseOrConstantAtStart(instr->object()); |
| 2179 LIn* result = new LIn(key, object); | 2169 LIn* result = new LIn(key, object); |
| 2180 return MarkAsCall(DefineFixed(result, rax), instr); | 2170 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2181 } | 2171 } |
| 2182 | 2172 |
| 2183 | 2173 |
| 2184 } } // namespace v8::internal | 2174 } } // namespace v8::internal |
| 2185 | 2175 |
| 2186 #endif // V8_TARGET_ARCH_X64 | 2176 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |