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 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 void HPhi::DeleteFromGraph() { | 1951 void HPhi::DeleteFromGraph() { |
1952 ASSERT(block() != NULL); | 1952 ASSERT(block() != NULL); |
1953 block()->RemovePhi(this); | 1953 block()->RemovePhi(this); |
1954 ASSERT(block() == NULL); | 1954 ASSERT(block() == NULL); |
1955 } | 1955 } |
1956 | 1956 |
1957 | 1957 |
1958 void HPhi::InitRealUses(int phi_id) { | 1958 void HPhi::InitRealUses(int phi_id) { |
1959 // Initialize real uses. | 1959 // Initialize real uses. |
1960 phi_id_ = phi_id; | 1960 phi_id_ = phi_id; |
| 1961 // Compute a conservative approximation of truncating uses before inferring |
| 1962 // representations. The proper, exact computation will be done later, when |
| 1963 // inserting representation changes. |
| 1964 SetFlag(kTruncatingToInt32); |
1961 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { | 1965 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { |
1962 HValue* value = it.value(); | 1966 HValue* value = it.value(); |
1963 if (!value->IsPhi()) { | 1967 if (!value->IsPhi()) { |
1964 Representation rep = value->observed_input_representation(it.index()); | 1968 Representation rep = value->observed_input_representation(it.index()); |
1965 non_phi_uses_[rep.kind()] += value->LoopWeight(); | 1969 non_phi_uses_[rep.kind()] += value->LoopWeight(); |
1966 if (FLAG_trace_representation) { | 1970 if (FLAG_trace_representation) { |
1967 PrintF("#%d Phi is used by real #%d %s as %s\n", | 1971 PrintF("#%d Phi is used by real #%d %s as %s\n", |
1968 id(), value->id(), value->Mnemonic(), rep.Mnemonic()); | 1972 id(), value->id(), value->Mnemonic(), rep.Mnemonic()); |
1969 } | 1973 } |
| 1974 if (!value->IsSimulate() && !value->CheckFlag(kTruncatingToInt32)) { |
| 1975 ClearFlag(kTruncatingToInt32); |
| 1976 } |
1970 } | 1977 } |
1971 } | 1978 } |
1972 } | 1979 } |
1973 | 1980 |
1974 | 1981 |
1975 void HPhi::AddNonPhiUsesFrom(HPhi* other) { | 1982 void HPhi::AddNonPhiUsesFrom(HPhi* other) { |
1976 if (FLAG_trace_representation) { | 1983 if (FLAG_trace_representation) { |
1977 PrintF("adding to #%d Phi uses of #%d Phi: i%d d%d t%d\n", | 1984 PrintF("adding to #%d Phi uses of #%d Phi: i%d d%d t%d\n", |
1978 id(), other->id(), | 1985 id(), other->id(), |
1979 other->non_phi_uses_[Representation::kInteger32], | 1986 other->non_phi_uses_[Representation::kInteger32], |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3627 | 3634 |
3628 | 3635 |
3629 void HCheckFunction::Verify() { | 3636 void HCheckFunction::Verify() { |
3630 HInstruction::Verify(); | 3637 HInstruction::Verify(); |
3631 ASSERT(HasNoUses()); | 3638 ASSERT(HasNoUses()); |
3632 } | 3639 } |
3633 | 3640 |
3634 #endif | 3641 #endif |
3635 | 3642 |
3636 } } // namespace v8::internal | 3643 } } // namespace v8::internal |
OLD | NEW |