OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1830 (comp->env_use_list() == NULL)) { | 1830 (comp->env_use_list() == NULL)) { |
1831 comp->RemoveFromGraph(); | 1831 comp->RemoveFromGraph(); |
1832 // It is safe to pass a NULL iterator because we're replacing the | 1832 // It is safe to pass a NULL iterator because we're replacing the |
1833 // comparison wrapped in a BranchInstr which does not modify the | 1833 // comparison wrapped in a BranchInstr which does not modify the |
1834 // linked list of instructions. | 1834 // linked list of instructions. |
1835 ReplaceWith(comp, NULL /* ignored */); | 1835 ReplaceWith(comp, NULL /* ignored */); |
1836 for (intptr_t i = 0; i < comp->InputCount(); ++i) { | 1836 for (intptr_t i = 0; i < comp->InputCount(); ++i) { |
1837 Value* operand = comp->InputAt(i); | 1837 Value* operand = comp->InputAt(i); |
1838 operand->set_instruction(this); | 1838 operand->set_instruction(this); |
1839 } | 1839 } |
1840 | |
1841 // If comparison has an environment then steal it. | |
1842 ASSERT(env() == NULL); // StrictCompare can't deoptimize. | |
1843 if (comp->env() != NULL) { | |
1844 set_env(comp->env()); | |
1845 comp->set_env(NULL); | |
Florian Schneider
2013/02/13 11:22:11
You may also need to set a new deopt id on the env
| |
1846 | |
1847 for (Environment::DeepIterator it(env()); !it.Done(); it.Advance()) { | |
1848 Value* value = it.CurrentValue(); | |
1849 value->set_instruction(this); | |
1850 } | |
1851 } | |
1852 | |
1840 if (FLAG_trace_optimization) { | 1853 if (FLAG_trace_optimization) { |
1841 OS::Print("Merging comparison v%"Pd"\n", comp->ssa_temp_index()); | 1854 OS::Print("Merging comparison v%"Pd"\n", comp->ssa_temp_index()); |
1842 } | 1855 } |
1843 // Clear the comparison's use list, temp index and ssa temp index since | 1856 // Clear the comparison's use list, temp index and ssa temp index since |
1844 // the value of the comparison is not used outside the branch anymore. | 1857 // the value of the comparison is not used outside the branch anymore. |
1845 comp->set_input_use_list(NULL); | 1858 comp->set_input_use_list(NULL); |
1846 comp->ClearSSATempIndex(); | 1859 comp->ClearSSATempIndex(); |
1847 comp->ClearTempIndex(); | 1860 comp->ClearTempIndex(); |
1848 } | 1861 } |
1849 } | 1862 } |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2868 default: | 2881 default: |
2869 UNREACHABLE(); | 2882 UNREACHABLE(); |
2870 } | 2883 } |
2871 return kPowRuntimeEntry; | 2884 return kPowRuntimeEntry; |
2872 } | 2885 } |
2873 | 2886 |
2874 | 2887 |
2875 #undef __ | 2888 #undef __ |
2876 | 2889 |
2877 } // namespace dart | 2890 } // namespace dart |
OLD | NEW |