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)) { |
867 ASSERT(!instr->HasObservableSideEffects()); | 868 ASSERT(!instr->HasObservableSideEffects()); |
868 HInstruction* other = map->Lookup(instr); | 869 HInstruction* other = map->Lookup(instr); |
869 if (other != NULL) { | 870 if (other != NULL) { |
870 ASSERT(instr->Equals(other) && other->Equals(instr)); | 871 ASSERT(instr->Equals(other) && other->Equals(instr)); |
871 TRACE_GVN_4("Replacing instruction i%d (%s) with i%d (%s)\n", | 872 TRACE_GVN_4("Replacing instruction i%d (%s) with i%d (%s)\n", |
872 instr->id(), | 873 instr->id(), |
873 instr->Mnemonic(), | 874 instr->Mnemonic(), |
874 other->id(), | 875 other->id(), |
875 other->Mnemonic()); | 876 other->Mnemonic()); |
876 if (instr->HasSideEffects()) removed_side_effects_ = true; | 877 if (instr->HasSideEffects()) removed_side_effects_ = true; |
(...skipping 27 matching lines...) Expand all Loading... |
904 dominated); | 905 dominated); |
905 successor_map->Kill(side_effects_on_all_paths); | 906 successor_map->Kill(side_effects_on_all_paths); |
906 successor_dominators->Kill(side_effects_on_all_paths); | 907 successor_dominators->Kill(side_effects_on_all_paths); |
907 } | 908 } |
908 } | 909 } |
909 current = next; | 910 current = next; |
910 } | 911 } |
911 } | 912 } |
912 | 913 |
913 } } // namespace v8::internal | 914 } } // namespace v8::internal |
OLD | NEW |