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 "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void Visit##type(type* node) override { \ | 107 void Visit##type(type* node) override { \ |
108 HOptimizedGraphBuilder::Visit##type(node); \ | 108 HOptimizedGraphBuilder::Visit##type(node); \ |
109 } | 109 } |
110 DECLARATION_NODE_LIST(DEF_VISIT) | 110 DECLARATION_NODE_LIST(DEF_VISIT) |
111 #undef DEF_VISIT | 111 #undef DEF_VISIT |
112 }; | 112 }; |
113 | 113 |
114 HCompilationJob::Status HCompilationJob::CreateGraphImpl() { | 114 HCompilationJob::Status HCompilationJob::CreateGraphImpl() { |
115 bool dont_crankshaft = info()->shared_info()->dont_crankshaft(); | 115 bool dont_crankshaft = info()->shared_info()->dont_crankshaft(); |
116 | 116 |
| 117 // Optimization requires a version of fullcode with deoptimization support. |
| 118 // Recompile the unoptimized version of the code if the current version |
| 119 // doesn't have deoptimization support already. |
| 120 // Otherwise, if we are gathering compilation time and space statistics |
| 121 // for hydrogen, gather baseline statistics for a fullcode compilation. |
| 122 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); |
| 123 if (should_recompile || FLAG_hydrogen_stats) { |
| 124 base::ElapsedTimer timer; |
| 125 if (FLAG_hydrogen_stats) { |
| 126 timer.Start(); |
| 127 } |
| 128 if (!Compiler::EnsureDeoptimizationSupport(info())) { |
| 129 return FAILED; |
| 130 } |
| 131 if (FLAG_hydrogen_stats) { |
| 132 isolate()->GetHStatistics()->IncrementFullCodeGen(timer.Elapsed()); |
| 133 } |
| 134 } |
| 135 DCHECK(info()->shared_info()->has_deoptimization_support()); |
| 136 DCHECK(!info()->shared_info()->never_compiled()); |
| 137 |
117 if (!isolate()->use_crankshaft() || dont_crankshaft) { | 138 if (!isolate()->use_crankshaft() || dont_crankshaft) { |
118 // Crankshaft is entirely disabled. | 139 // Crankshaft is entirely disabled. |
119 return FAILED; | 140 return FAILED; |
120 } | 141 } |
121 | 142 |
122 // Check the whitelist for Crankshaft. | 143 // Check the whitelist for Crankshaft. |
123 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { | 144 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { |
124 return AbortOptimization(kHydrogenFilter); | 145 return AbortOptimization(kHydrogenFilter); |
125 } | 146 } |
126 | 147 |
(...skipping 13587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13714 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13735 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13715 } | 13736 } |
13716 | 13737 |
13717 #ifdef DEBUG | 13738 #ifdef DEBUG |
13718 graph_->Verify(false); // No full verify. | 13739 graph_->Verify(false); // No full verify. |
13719 #endif | 13740 #endif |
13720 } | 13741 } |
13721 | 13742 |
13722 } // namespace internal | 13743 } // namespace internal |
13723 } // namespace v8 | 13744 } // namespace v8 |
OLD | NEW |