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/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 return AbortOptimization(kFunctionBeingDebugged); | 320 return AbortOptimization(kFunctionBeingDebugged); |
321 } | 321 } |
322 | 322 |
323 // Limit the number of times we try to optimize functions. | 323 // Limit the number of times we try to optimize functions. |
324 const int kMaxOptCount = | 324 const int kMaxOptCount = |
325 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 325 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
326 if (info()->shared_info()->opt_count() > kMaxOptCount) { | 326 if (info()->shared_info()->opt_count() > kMaxOptCount) { |
327 return AbortOptimization(kOptimizedTooManyTimes); | 327 return AbortOptimization(kOptimizedTooManyTimes); |
328 } | 328 } |
329 | 329 |
330 // Check the whitelist for Crankshaft. | |
331 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { | |
332 return AbortOptimization(kHydrogenFilter); | |
333 } | |
334 | |
335 // Optimization requires a version of fullcode with deoptimization support. | 330 // Optimization requires a version of fullcode with deoptimization support. |
336 // Recompile the unoptimized version of the code if the current version | 331 // Recompile the unoptimized version of the code if the current version |
337 // doesn't have deoptimization support already. | 332 // doesn't have deoptimization support already. |
338 // Otherwise, if we are gathering compilation time and space statistics | 333 // Otherwise, if we are gathering compilation time and space statistics |
339 // for hydrogen, gather baseline statistics for a fullcode compilation. | 334 // for hydrogen, gather baseline statistics for a fullcode compilation. |
340 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); | 335 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); |
341 if (should_recompile || FLAG_hydrogen_stats) { | 336 if (should_recompile || FLAG_hydrogen_stats) { |
342 base::ElapsedTimer timer; | 337 base::ElapsedTimer timer; |
343 if (FLAG_hydrogen_stats) { | 338 if (FLAG_hydrogen_stats) { |
344 timer.Start(); | 339 timer.Start(); |
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 MaybeHandle<Code> code; | 1728 MaybeHandle<Code> code; |
1734 if (cached.code != nullptr) code = handle(cached.code); | 1729 if (cached.code != nullptr) code = handle(cached.code); |
1735 Handle<Context> native_context(function->context()->native_context()); | 1730 Handle<Context> native_context(function->context()->native_context()); |
1736 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1731 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1737 literals, BailoutId::None()); | 1732 literals, BailoutId::None()); |
1738 } | 1733 } |
1739 } | 1734 } |
1740 | 1735 |
1741 } // namespace internal | 1736 } // namespace internal |
1742 } // namespace v8 | 1737 } // namespace v8 |
OLD | NEW |