OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. | 244 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. |
245 bool CompilationInfo::ShouldSelfOptimize() { | 245 bool CompilationInfo::ShouldSelfOptimize() { |
246 return FLAG_crankshaft && !function()->flags()->Contains(kDontSelfOptimize) && | 246 return FLAG_crankshaft && !function()->flags()->Contains(kDontSelfOptimize) && |
247 !function()->dont_optimize() && | 247 !function()->dont_optimize() && |
248 function()->scope()->AllowsLazyCompilation() && | 248 function()->scope()->AllowsLazyCompilation() && |
249 (!has_shared_info() || !shared_info()->optimization_disabled()); | 249 (!has_shared_info() || !shared_info()->optimization_disabled()); |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 void CompilationInfo::EnsureFeedbackVector() { | 253 void CompilationInfo::EnsureFeedbackVector() { |
254 if (feedback_vector_.is_null()) { | 254 if (feedback_vector_.is_null() || |
| 255 feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec())) { |
255 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( | 256 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( |
256 function()->feedback_vector_spec()); | 257 function()->feedback_vector_spec()); |
257 } | 258 } |
258 } | 259 } |
259 | 260 |
260 | 261 |
261 bool CompilationInfo::is_simple_parameter_list() { | 262 bool CompilationInfo::is_simple_parameter_list() { |
262 return scope()->is_simple_parameter_list(); | 263 return scope()->is_simple_parameter_list(); |
263 } | 264 } |
264 | 265 |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 } | 1591 } |
1591 | 1592 |
1592 | 1593 |
1593 #if DEBUG | 1594 #if DEBUG |
1594 void CompilationInfo::PrintAstForTesting() { | 1595 void CompilationInfo::PrintAstForTesting() { |
1595 PrintF("--- Source from AST ---\n%s\n", | 1596 PrintF("--- Source from AST ---\n%s\n", |
1596 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1597 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1597 } | 1598 } |
1598 #endif | 1599 #endif |
1599 } } // namespace v8::internal | 1600 } } // namespace v8::internal |
OLD | NEW |