| 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 static const int kNoRedefinedOperand = -1; | 812 static const int kNoRedefinedOperand = -1; |
| 813 virtual int RedefinedOperandIndex() { return kNoRedefinedOperand; } | 813 virtual int RedefinedOperandIndex() { return kNoRedefinedOperand; } |
| 814 bool IsInformativeDefinition() { | 814 bool IsInformativeDefinition() { |
| 815 return RedefinedOperandIndex() != kNoRedefinedOperand; | 815 return RedefinedOperandIndex() != kNoRedefinedOperand; |
| 816 } | 816 } |
| 817 HValue* RedefinedOperand() { | 817 HValue* RedefinedOperand() { |
| 818 return IsInformativeDefinition() ? OperandAt(RedefinedOperandIndex()) | 818 return IsInformativeDefinition() ? OperandAt(RedefinedOperandIndex()) |
| 819 : NULL; | 819 : NULL; |
| 820 } | 820 } |
| 821 | 821 |
| 822 // A purely informative definition is an idef that will not emit code and |
| 823 // should therefore be removed from the graph in the RestoreActualValues |
| 824 // phase (so that live ranges will be shorter). |
| 825 virtual bool IsPurelyInformativeDefinition() { return false; } |
| 826 |
| 822 // This method must always return the original HValue SSA definition | 827 // This method must always return the original HValue SSA definition |
| 823 // (regardless of any iDef of this value). | 828 // (regardless of any iDef of this value). |
| 824 HValue* ActualValue() { | 829 HValue* ActualValue() { |
| 825 return IsInformativeDefinition() ? RedefinedOperand()->ActualValue() | 830 return IsInformativeDefinition() ? RedefinedOperand()->ActualValue() |
| 826 : this; | 831 : this; |
| 827 } | 832 } |
| 828 | 833 |
| 829 virtual void AddInformativeDefinitions() {} | 834 virtual void AddInformativeDefinitions() {} |
| 830 | 835 |
| 831 void UpdateRedefinedUsesWhileSettingUpInformativeDefinitions() { | 836 void UpdateRedefinedUsesWhileSettingUpInformativeDefinitions() { |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 static HNumericConstraint* AddToGraph(HValue* constrained_value, | 1284 static HNumericConstraint* AddToGraph(HValue* constrained_value, |
| 1280 NumericRelation relation, | 1285 NumericRelation relation, |
| 1281 HValue* related_value, | 1286 HValue* related_value, |
| 1282 HInstruction* insertion_point = NULL); | 1287 HInstruction* insertion_point = NULL); |
| 1283 | 1288 |
| 1284 HValue* constrained_value() { return OperandAt(0); } | 1289 HValue* constrained_value() { return OperandAt(0); } |
| 1285 HValue* related_value() { return OperandAt(1); } | 1290 HValue* related_value() { return OperandAt(1); } |
| 1286 NumericRelation relation() { return relation_; } | 1291 NumericRelation relation() { return relation_; } |
| 1287 | 1292 |
| 1288 virtual int RedefinedOperandIndex() { return 0; } | 1293 virtual int RedefinedOperandIndex() { return 0; } |
| 1294 virtual bool IsPurelyInformativeDefinition() { return true; } |
| 1289 | 1295 |
| 1290 virtual Representation RequiredInputRepresentation(int index) { | 1296 virtual Representation RequiredInputRepresentation(int index) { |
| 1291 return representation(); | 1297 return representation(); |
| 1292 } | 1298 } |
| 1293 | 1299 |
| 1294 virtual void PrintDataTo(StringStream* stream); | 1300 virtual void PrintDataTo(StringStream* stream); |
| 1295 | 1301 |
| 1296 virtual bool IsRelationTrueInternal(NumericRelation other_relation, | 1302 virtual bool IsRelationTrueInternal(NumericRelation other_relation, |
| 1297 HValue* other_related_value) { | 1303 HValue* other_related_value) { |
| 1298 if (related_value() == other_related_value) { | 1304 if (related_value() == other_related_value) { |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3352 virtual bool IsRelationTrueInternal(NumericRelation relation, | 3358 virtual bool IsRelationTrueInternal(NumericRelation relation, |
| 3353 HValue* related_value); | 3359 HValue* related_value); |
| 3354 | 3360 |
| 3355 virtual void PrintDataTo(StringStream* stream); | 3361 virtual void PrintDataTo(StringStream* stream); |
| 3356 virtual void InferRepresentation(HInferRepresentation* h_infer); | 3362 virtual void InferRepresentation(HInferRepresentation* h_infer); |
| 3357 | 3363 |
| 3358 HValue* index() { return OperandAt(0); } | 3364 HValue* index() { return OperandAt(0); } |
| 3359 HValue* length() { return OperandAt(1); } | 3365 HValue* length() { return OperandAt(1); } |
| 3360 | 3366 |
| 3361 virtual int RedefinedOperandIndex() { return 0; } | 3367 virtual int RedefinedOperandIndex() { return 0; } |
| 3368 virtual bool IsPurelyInformativeDefinition() { return skip_check(); } |
| 3362 virtual void AddInformativeDefinitions(); | 3369 virtual void AddInformativeDefinitions(); |
| 3363 | 3370 |
| 3364 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck) | 3371 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck) |
| 3365 | 3372 |
| 3366 protected: | 3373 protected: |
| 3367 virtual bool DataEquals(HValue* other) { return true; } | 3374 virtual bool DataEquals(HValue* other) { return true; } |
| 3368 BoundsCheckKeyMode key_mode_; | 3375 BoundsCheckKeyMode key_mode_; |
| 3369 bool skip_check_; | 3376 bool skip_check_; |
| 3370 }; | 3377 }; |
| 3371 | 3378 |
| (...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6014 virtual bool IsDeletable() const { return true; } | 6021 virtual bool IsDeletable() const { return true; } |
| 6015 }; | 6022 }; |
| 6016 | 6023 |
| 6017 | 6024 |
| 6018 #undef DECLARE_INSTRUCTION | 6025 #undef DECLARE_INSTRUCTION |
| 6019 #undef DECLARE_CONCRETE_INSTRUCTION | 6026 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6020 | 6027 |
| 6021 } } // namespace v8::internal | 6028 } } // namespace v8::internal |
| 6022 | 6029 |
| 6023 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6030 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |