| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 208 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { |
| 209 stream->Add("if "); | 209 stream->Add("if "); |
| 210 left()->PrintTo(stream); | 210 left()->PrintTo(stream); |
| 211 stream->Add(" %s ", Token::String(op())); | 211 stream->Add(" %s ", Token::String(op())); |
| 212 right()->PrintTo(stream); | 212 right()->PrintTo(stream); |
| 213 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 213 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 void LIsNilAndBranch::PrintDataTo(StringStream* stream) { | |
| 218 stream->Add("if "); | |
| 219 value()->PrintTo(stream); | |
| 220 stream->Add(kind() == kStrictEquality ? " === " : " == "); | |
| 221 stream->Add(nil() == kNullValue ? "null" : "undefined"); | |
| 222 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | |
| 223 } | |
| 224 | |
| 225 | |
| 226 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 217 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
| 227 stream->Add("if is_object("); | 218 stream->Add("if is_object("); |
| 228 value()->PrintTo(stream); | 219 value()->PrintTo(stream); |
| 229 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 220 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 230 } | 221 } |
| 231 | 222 |
| 232 | 223 |
| 233 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { | 224 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { |
| 234 stream->Add("if is_string("); | 225 stream->Add("if is_string("); |
| 235 value()->PrintTo(stream); | 226 value()->PrintTo(stream); |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 } | 1612 } |
| 1622 | 1613 |
| 1623 | 1614 |
| 1624 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( | 1615 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( |
| 1625 HCompareConstantEqAndBranch* instr) { | 1616 HCompareConstantEqAndBranch* instr) { |
| 1626 LOperand* value = UseRegisterAtStart(instr->value()); | 1617 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1627 return new(zone()) LCmpConstantEqAndBranch(value); | 1618 return new(zone()) LCmpConstantEqAndBranch(value); |
| 1628 } | 1619 } |
| 1629 | 1620 |
| 1630 | 1621 |
| 1631 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) { | |
| 1632 ASSERT(instr->value()->representation().IsTagged()); | |
| 1633 LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister(); | |
| 1634 return new(zone()) LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp); | |
| 1635 } | |
| 1636 | |
| 1637 | |
| 1638 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1622 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
| 1639 ASSERT(instr->value()->representation().IsTagged()); | 1623 ASSERT(instr->value()->representation().IsTagged()); |
| 1640 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); | 1624 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); |
| 1641 } | 1625 } |
| 1642 | 1626 |
| 1643 | 1627 |
| 1644 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | 1628 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { |
| 1645 ASSERT(instr->value()->representation().IsTagged()); | 1629 ASSERT(instr->value()->representation().IsTagged()); |
| 1646 LOperand* value = UseRegisterAtStart(instr->value()); | 1630 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1647 LOperand* temp = TempRegister(); | 1631 LOperand* temp = TempRegister(); |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2511 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2528 LOperand* object = UseRegister(instr->object()); | 2512 LOperand* object = UseRegister(instr->object()); |
| 2529 LOperand* index = UseTempRegister(instr->index()); | 2513 LOperand* index = UseTempRegister(instr->index()); |
| 2530 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2514 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2531 } | 2515 } |
| 2532 | 2516 |
| 2533 | 2517 |
| 2534 } } // namespace v8::internal | 2518 } } // namespace v8::internal |
| 2535 | 2519 |
| 2536 #endif // V8_TARGET_ARCH_X64 | 2520 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |