| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 206 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { |
| 207 stream->Add("if "); | 207 stream->Add("if "); |
| 208 left()->PrintTo(stream); | 208 left()->PrintTo(stream); |
| 209 stream->Add(" %s ", Token::String(op())); | 209 stream->Add(" %s ", Token::String(op())); |
| 210 right()->PrintTo(stream); | 210 right()->PrintTo(stream); |
| 211 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 211 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
| 212 } | 212 } |
| 213 | 213 |
| 214 | 214 |
| 215 void LIsNilAndBranch::PrintDataTo(StringStream* stream) { | |
| 216 stream->Add("if "); | |
| 217 value()->PrintTo(stream); | |
| 218 stream->Add(kind() == kStrictEquality ? " === " : " == "); | |
| 219 stream->Add(nil() == kNullValue ? "null" : "undefined"); | |
| 220 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | |
| 221 } | |
| 222 | |
| 223 | |
| 224 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 215 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
| 225 stream->Add("if is_object("); | 216 stream->Add("if is_object("); |
| 226 value()->PrintTo(stream); | 217 value()->PrintTo(stream); |
| 227 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 218 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 228 } | 219 } |
| 229 | 220 |
| 230 | 221 |
| 231 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { | 222 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { |
| 232 stream->Add("if is_string("); | 223 stream->Add("if is_string("); |
| 233 value()->PrintTo(stream); | 224 value()->PrintTo(stream); |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 } | 1692 } |
| 1702 | 1693 |
| 1703 | 1694 |
| 1704 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( | 1695 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( |
| 1705 HCompareConstantEqAndBranch* instr) { | 1696 HCompareConstantEqAndBranch* instr) { |
| 1706 LOperand* value = UseRegisterAtStart(instr->value()); | 1697 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1707 return new(zone()) LCmpConstantEqAndBranch(value); | 1698 return new(zone()) LCmpConstantEqAndBranch(value); |
| 1708 } | 1699 } |
| 1709 | 1700 |
| 1710 | 1701 |
| 1711 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) { | |
| 1712 ASSERT(instr->value()->representation().IsTagged()); | |
| 1713 return new(zone()) LIsNilAndBranch(UseRegisterAtStart(instr->value())); | |
| 1714 } | |
| 1715 | |
| 1716 | |
| 1717 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1702 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
| 1718 ASSERT(instr->value()->representation().IsTagged()); | 1703 ASSERT(instr->value()->representation().IsTagged()); |
| 1719 LOperand* value = UseRegisterAtStart(instr->value()); | 1704 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1720 LOperand* temp = TempRegister(); | 1705 LOperand* temp = TempRegister(); |
| 1721 return new(zone()) LIsObjectAndBranch(value, temp); | 1706 return new(zone()) LIsObjectAndBranch(value, temp); |
| 1722 } | 1707 } |
| 1723 | 1708 |
| 1724 | 1709 |
| 1725 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | 1710 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { |
| 1726 ASSERT(instr->value()->representation().IsTagged()); | 1711 ASSERT(instr->value()->representation().IsTagged()); |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2601 | 2586 |
| 2602 | 2587 |
| 2603 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2588 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2604 LOperand* object = UseRegister(instr->object()); | 2589 LOperand* object = UseRegister(instr->object()); |
| 2605 LOperand* index = UseRegister(instr->index()); | 2590 LOperand* index = UseRegister(instr->index()); |
| 2606 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2591 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2607 } | 2592 } |
| 2608 | 2593 |
| 2609 | 2594 |
| 2610 } } // namespace v8::internal | 2595 } } // namespace v8::internal |
| OLD | NEW |