| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 | 200 |
| 201 void LIsNullAndBranch::PrintDataTo(StringStream* stream) const { | 201 void LIsNullAndBranch::PrintDataTo(StringStream* stream) const { |
| 202 stream->Add("if "); | 202 stream->Add("if "); |
| 203 input()->PrintTo(stream); | 203 input()->PrintTo(stream); |
| 204 stream->Add(is_strict() ? " === null" : " == null"); | 204 stream->Add(is_strict() ? " === null" : " == null"); |
| 205 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 205 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 | 208 |
| 209 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) const { |
| 210 stream->Add("if is_object("); |
| 211 input()->PrintTo(stream); |
| 212 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 213 } |
| 214 |
| 215 |
| 209 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) const { | 216 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) const { |
| 210 stream->Add("if is_smi("); | 217 stream->Add("if is_smi("); |
| 211 input()->PrintTo(stream); | 218 input()->PrintTo(stream); |
| 212 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 219 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 213 } | 220 } |
| 214 | 221 |
| 215 | 222 |
| 216 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) const { | 223 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) const { |
| 217 stream->Add("if has_instance_type("); | 224 stream->Add("if has_instance_type("); |
| 218 input()->PrintTo(stream); | 225 input()->PrintTo(stream); |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 HIsNull* compare = HIsNull::cast(v); | 1251 HIsNull* compare = HIsNull::cast(v); |
| 1245 ASSERT(compare->value()->representation().IsTagged()); | 1252 ASSERT(compare->value()->representation().IsTagged()); |
| 1246 | 1253 |
| 1247 // We only need a temp register for non-strict compare. | 1254 // We only need a temp register for non-strict compare. |
| 1248 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); | 1255 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); |
| 1249 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), | 1256 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), |
| 1250 compare->is_strict(), | 1257 compare->is_strict(), |
| 1251 temp, | 1258 temp, |
| 1252 first_id, | 1259 first_id, |
| 1253 second_id); | 1260 second_id); |
| 1261 } else if (v->IsIsObject()) { |
| 1262 HIsObject* compare = HIsObject::cast(v); |
| 1263 ASSERT(compare->value()->representation().IsTagged()); |
| 1264 |
| 1265 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), |
| 1266 TempRegister(), |
| 1267 TempRegister(), |
| 1268 first_id, |
| 1269 second_id); |
| 1254 } else if (v->IsCompareJSObjectEq()) { | 1270 } else if (v->IsCompareJSObjectEq()) { |
| 1255 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); | 1271 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); |
| 1256 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), | 1272 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), |
| 1257 UseRegisterAtStart(compare->right()), | 1273 UseRegisterAtStart(compare->right()), |
| 1258 first_id, | 1274 first_id, |
| 1259 second_id); | 1275 second_id); |
| 1260 } else if (v->IsInstanceOf()) { | 1276 } else if (v->IsInstanceOf()) { |
| 1261 HInstanceOf* instance_of = HInstanceOf::cast(v); | 1277 HInstanceOf* instance_of = HInstanceOf::cast(v); |
| 1262 LInstruction* result = | 1278 LInstruction* result = |
| 1263 new LInstanceOfAndBranch(Use(instance_of->left()), | 1279 new LInstanceOfAndBranch(Use(instance_of->left()), |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 | 1633 |
| 1618 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { | 1634 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { |
| 1619 ASSERT(instr->value()->representation().IsTagged()); | 1635 ASSERT(instr->value()->representation().IsTagged()); |
| 1620 LOperand* value = UseRegisterAtStart(instr->value()); | 1636 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1621 | 1637 |
| 1622 return DefineAsRegister(new LIsNull(value, | 1638 return DefineAsRegister(new LIsNull(value, |
| 1623 instr->is_strict())); | 1639 instr->is_strict())); |
| 1624 } | 1640 } |
| 1625 | 1641 |
| 1626 | 1642 |
| 1643 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { |
| 1644 ASSERT(instr->value()->representation().IsTagged()); |
| 1645 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1646 |
| 1647 return DefineAsRegister(new LIsObject(value, TempRegister())); |
| 1648 } |
| 1649 |
| 1650 |
| 1627 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { | 1651 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { |
| 1628 ASSERT(instr->value()->representation().IsTagged()); | 1652 ASSERT(instr->value()->representation().IsTagged()); |
| 1629 LOperand* value = UseAtStart(instr->value()); | 1653 LOperand* value = UseAtStart(instr->value()); |
| 1630 | 1654 |
| 1631 return DefineAsRegister(new LIsSmi(value)); | 1655 return DefineAsRegister(new LIsSmi(value)); |
| 1632 } | 1656 } |
| 1633 | 1657 |
| 1634 | 1658 |
| 1635 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { | 1659 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { |
| 1636 ASSERT(instr->value()->representation().IsTagged()); | 1660 ASSERT(instr->value()->representation().IsTagged()); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2099 void LPointerMap::PrintTo(StringStream* stream) const { | 2123 void LPointerMap::PrintTo(StringStream* stream) const { |
| 2100 stream->Add("{"); | 2124 stream->Add("{"); |
| 2101 for (int i = 0; i < pointer_operands_.length(); ++i) { | 2125 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 2102 if (i != 0) stream->Add(";"); | 2126 if (i != 0) stream->Add(";"); |
| 2103 pointer_operands_[i]->PrintTo(stream); | 2127 pointer_operands_[i]->PrintTo(stream); |
| 2104 } | 2128 } |
| 2105 stream->Add("} @%d", position()); | 2129 stream->Add("} @%d", position()); |
| 2106 } | 2130 } |
| 2107 | 2131 |
| 2108 } } // namespace v8::internal | 2132 } } // namespace v8::internal |
| OLD | NEW |