OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 void HPhi::AddInput(HValue* value) { | 926 void HPhi::AddInput(HValue* value) { |
927 inputs_.Add(NULL); | 927 inputs_.Add(NULL); |
928 SetOperandAt(OperandCount() - 1, value); | 928 SetOperandAt(OperandCount() - 1, value); |
929 // Mark phis that may have 'arguments' directly or indirectly as an operand. | 929 // Mark phis that may have 'arguments' directly or indirectly as an operand. |
930 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { | 930 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { |
931 SetFlag(kIsArguments); | 931 SetFlag(kIsArguments); |
932 } | 932 } |
933 } | 933 } |
934 | 934 |
935 | 935 |
| 936 bool HPhi::HasRealUses() { |
| 937 for (int i = 0; i < uses()->length(); i++) { |
| 938 if (!uses()->at(i)->IsPhi()) return true; |
| 939 } |
| 940 return false; |
| 941 } |
| 942 |
| 943 |
936 HValue* HPhi::GetRedundantReplacement() { | 944 HValue* HPhi::GetRedundantReplacement() { |
937 HValue* candidate = NULL; | 945 HValue* candidate = NULL; |
938 int count = OperandCount(); | 946 int count = OperandCount(); |
939 int position = 0; | 947 int position = 0; |
940 while (position < count && candidate == NULL) { | 948 while (position < count && candidate == NULL) { |
941 HValue* current = OperandAt(position++); | 949 HValue* current = OperandAt(position++); |
942 if (current != this) candidate = current; | 950 if (current != this) candidate = current; |
943 } | 951 } |
944 while (position < count) { | 952 while (position < count) { |
945 HValue* current = OperandAt(position++); | 953 HValue* current = OperandAt(position++); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 | 1510 |
1503 | 1511 |
1504 void HCheckPrototypeMaps::Verify() { | 1512 void HCheckPrototypeMaps::Verify() { |
1505 HInstruction::Verify(); | 1513 HInstruction::Verify(); |
1506 ASSERT(HasNoUses()); | 1514 ASSERT(HasNoUses()); |
1507 } | 1515 } |
1508 | 1516 |
1509 #endif | 1517 #endif |
1510 | 1518 |
1511 } } // namespace v8::internal | 1519 } } // namespace v8::internal |
OLD | NEW |