| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "hydrogen.h" | 5 #include "hydrogen.h" |
| 6 #include "hydrogen-gvn.h" | 6 #include "hydrogen-gvn.h" |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 dominators->Store(changes, instr); | 856 dominators->Store(changes, instr); |
| 857 if (FLAG_trace_gvn) { | 857 if (FLAG_trace_gvn) { |
| 858 HeapStringAllocator allocator; | 858 HeapStringAllocator allocator; |
| 859 StringStream stream(&allocator); | 859 StringStream stream(&allocator); |
| 860 stream.Add("Instruction i%d changes ", instr->id()); | 860 stream.Add("Instruction i%d changes ", instr->id()); |
| 861 side_effects_tracker_.PrintSideEffectsTo(&stream, changes); | 861 side_effects_tracker_.PrintSideEffectsTo(&stream, changes); |
| 862 stream.Add("\n"); | 862 stream.Add("\n"); |
| 863 stream.OutputToStdOut(); | 863 stream.OutputToStdOut(); |
| 864 } | 864 } |
| 865 } | 865 } |
| 866 if (instr->CheckFlag(HValue::kUseGVN) && | 866 if (instr->CheckFlag(HValue::kUseGVN)) { |
| 867 !instr->CheckFlag(HValue::kCantBeReplaced)) { | |
| 868 ASSERT(!instr->HasObservableSideEffects()); | 867 ASSERT(!instr->HasObservableSideEffects()); |
| 869 HInstruction* other = map->Lookup(instr); | 868 HInstruction* other = map->Lookup(instr); |
| 870 if (other != NULL) { | 869 if (other != NULL) { |
| 871 ASSERT(instr->Equals(other) && other->Equals(instr)); | 870 ASSERT(instr->Equals(other) && other->Equals(instr)); |
| 872 TRACE_GVN_4("Replacing instruction i%d (%s) with i%d (%s)\n", | 871 TRACE_GVN_4("Replacing instruction i%d (%s) with i%d (%s)\n", |
| 873 instr->id(), | 872 instr->id(), |
| 874 instr->Mnemonic(), | 873 instr->Mnemonic(), |
| 875 other->id(), | 874 other->id(), |
| 876 other->Mnemonic()); | 875 other->Mnemonic()); |
| 877 if (instr->HasSideEffects()) removed_side_effects_ = true; | 876 if (instr->HasSideEffects()) removed_side_effects_ = true; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 905 dominated); | 904 dominated); |
| 906 successor_map->Kill(side_effects_on_all_paths); | 905 successor_map->Kill(side_effects_on_all_paths); |
| 907 successor_dominators->Kill(side_effects_on_all_paths); | 906 successor_dominators->Kill(side_effects_on_all_paths); |
| 908 } | 907 } |
| 909 } | 908 } |
| 910 current = next; | 909 current = next; |
| 911 } | 910 } |
| 912 } | 911 } |
| 913 | 912 |
| 914 } } // namespace v8::internal | 913 } } // namespace v8::internal |
| OLD | NEW |