| 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 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 virtual HSourcePosition operand_position(int index) const V8_OVERRIDE { | 1256 virtual HSourcePosition operand_position(int index) const V8_OVERRIDE { |
| 1257 const HSourcePosition pos = position_.operand_position(index); | 1257 const HSourcePosition pos = position_.operand_position(index); |
| 1258 return pos.IsUnknown() ? position() : pos; | 1258 return pos.IsUnknown() ? position() : pos; |
| 1259 } | 1259 } |
| 1260 void set_operand_position(Zone* zone, int index, HSourcePosition pos) { | 1260 void set_operand_position(Zone* zone, int index, HSourcePosition pos) { |
| 1261 ASSERT(0 <= index && index < OperandCount()); | 1261 ASSERT(0 <= index && index < OperandCount()); |
| 1262 position_.ensure_storage_for_operand_positions(zone, OperandCount()); | 1262 position_.ensure_storage_for_operand_positions(zone, OperandCount()); |
| 1263 position_.set_operand_position(index, pos); | 1263 position_.set_operand_position(index, pos); |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 bool CanTruncateToSmi() const { return CheckFlag(kTruncatingToSmi); } |
| 1266 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } | 1267 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } |
| 1267 | 1268 |
| 1268 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; | 1269 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; |
| 1269 | 1270 |
| 1270 #ifdef DEBUG | 1271 #ifdef DEBUG |
| 1271 virtual void Verify() V8_OVERRIDE; | 1272 virtual void Verify() V8_OVERRIDE; |
| 1272 #endif | 1273 #endif |
| 1273 | 1274 |
| 1274 bool CanDeoptimize(); | 1275 bool CanDeoptimize(); |
| 1275 | 1276 |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 Representation to, | 1727 Representation to, |
| 1727 bool is_truncating_to_smi, | 1728 bool is_truncating_to_smi, |
| 1728 bool is_truncating_to_int32) | 1729 bool is_truncating_to_int32) |
| 1729 : HUnaryOperation(value) { | 1730 : HUnaryOperation(value) { |
| 1730 ASSERT(!value->representation().IsNone()); | 1731 ASSERT(!value->representation().IsNone()); |
| 1731 ASSERT(!to.IsNone()); | 1732 ASSERT(!to.IsNone()); |
| 1732 ASSERT(!value->representation().Equals(to)); | 1733 ASSERT(!value->representation().Equals(to)); |
| 1733 set_representation(to); | 1734 set_representation(to); |
| 1734 SetFlag(kUseGVN); | 1735 SetFlag(kUseGVN); |
| 1735 SetFlag(kCanOverflow); | 1736 SetFlag(kCanOverflow); |
| 1736 if (is_truncating_to_smi) { | 1737 if (is_truncating_to_smi && to.IsSmi()) { |
| 1737 SetFlag(kTruncatingToSmi); | 1738 SetFlag(kTruncatingToSmi); |
| 1738 SetFlag(kTruncatingToInt32); | 1739 SetFlag(kTruncatingToInt32); |
| 1739 } | 1740 } |
| 1740 if (is_truncating_to_int32) SetFlag(kTruncatingToInt32); | 1741 if (is_truncating_to_int32) SetFlag(kTruncatingToInt32); |
| 1741 if (value->representation().IsSmi() || value->type().IsSmi()) { | 1742 if (value->representation().IsSmi() || value->type().IsSmi()) { |
| 1742 set_type(HType::Smi()); | 1743 set_type(HType::Smi()); |
| 1743 } else { | 1744 } else { |
| 1744 set_type(HType::TaggedNumber()); | 1745 set_type(HType::TaggedNumber()); |
| 1745 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); | 1746 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); |
| 1746 } | 1747 } |
| (...skipping 5779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7526 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7527 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7527 }; | 7528 }; |
| 7528 | 7529 |
| 7529 | 7530 |
| 7530 #undef DECLARE_INSTRUCTION | 7531 #undef DECLARE_INSTRUCTION |
| 7531 #undef DECLARE_CONCRETE_INSTRUCTION | 7532 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7532 | 7533 |
| 7533 } } // namespace v8::internal | 7534 } } // namespace v8::internal |
| 7534 | 7535 |
| 7535 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7536 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |