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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 | 369 |
370 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { | 370 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { |
371 DCHECK(info()->IsOptimizing()); | 371 DCHECK(info()->IsOptimizing()); |
372 | 372 |
373 // Do not use Crankshaft/TurboFan if we need to be able to set break points. | 373 // Do not use Crankshaft/TurboFan if we need to be able to set break points. |
374 if (info()->shared_info()->HasDebugInfo()) { | 374 if (info()->shared_info()->HasDebugInfo()) { |
375 return AbortOptimization(kFunctionBeingDebugged); | 375 return AbortOptimization(kFunctionBeingDebugged); |
376 } | 376 } |
377 | 377 |
378 // Resuming a suspended frame is not supported by Crankshaft/TurboFan. | |
379 if (info()->shared_info()->HasBuiltinFunctionId() && | |
380 (info()->shared_info()->builtin_function_id() == kGeneratorObjectNext || | |
381 info()->shared_info()->builtin_function_id() == kGeneratorObjectReturn || | |
382 info()->shared_info()->builtin_function_id() == kGeneratorObjectThrow)) { | |
383 return AbortOptimization(kGeneratorResumeMethod); | |
384 } | |
385 | |
386 // Limit the number of times we try to optimize functions. | 378 // Limit the number of times we try to optimize functions. |
387 const int kMaxOptCount = | 379 const int kMaxOptCount = |
388 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 380 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
389 if (info()->opt_count() > kMaxOptCount) { | 381 if (info()->opt_count() > kMaxOptCount) { |
390 return AbortOptimization(kOptimizedTooManyTimes); | 382 return AbortOptimization(kOptimizedTooManyTimes); |
391 } | 383 } |
392 | 384 |
393 // Check the whitelist for Crankshaft. | 385 // Check the whitelist for Crankshaft. |
394 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { | 386 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { |
395 return AbortOptimization(kHydrogenFilter); | 387 return AbortOptimization(kHydrogenFilter); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 } | 786 } |
795 return true; | 787 return true; |
796 } | 788 } |
797 | 789 |
798 bool UseIgnition(CompilationInfo* info) { | 790 bool UseIgnition(CompilationInfo* info) { |
799 // TODO(4681): Generator functions are not yet supported. | 791 // TODO(4681): Generator functions are not yet supported. |
800 if (info->shared_info()->is_generator()) { | 792 if (info->shared_info()->is_generator()) { |
801 return false; | 793 return false; |
802 } | 794 } |
803 | 795 |
804 // TODO(4681): Resuming a suspended frame is not supported. | |
805 if (info->shared_info()->HasBuiltinFunctionId() && | |
806 (info->shared_info()->builtin_function_id() == kGeneratorObjectNext || | |
807 info->shared_info()->builtin_function_id() == kGeneratorObjectReturn || | |
808 info->shared_info()->builtin_function_id() == kGeneratorObjectThrow)) { | |
809 return false; | |
810 } | |
811 | |
812 // Checks whether top level functions should be passed by the filter. | 796 // Checks whether top level functions should be passed by the filter. |
813 if (info->shared_info()->is_toplevel()) { | 797 if (info->shared_info()->is_toplevel()) { |
814 Vector<const char> filter = CStrVector(FLAG_ignition_filter); | 798 Vector<const char> filter = CStrVector(FLAG_ignition_filter); |
815 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); | 799 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); |
816 } | 800 } |
817 | 801 |
818 // Finally respect the filter. | 802 // Finally respect the filter. |
819 return info->shared_info()->PassesFilter(FLAG_ignition_filter); | 803 return info->shared_info()->PassesFilter(FLAG_ignition_filter); |
820 } | 804 } |
821 | 805 |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 MaybeHandle<Code> code; | 1935 MaybeHandle<Code> code; |
1952 if (cached.code != nullptr) code = handle(cached.code); | 1936 if (cached.code != nullptr) code = handle(cached.code); |
1953 Handle<Context> native_context(function->context()->native_context()); | 1937 Handle<Context> native_context(function->context()->native_context()); |
1954 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1938 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1955 literals, BailoutId::None()); | 1939 literals, BailoutId::None()); |
1956 } | 1940 } |
1957 } | 1941 } |
1958 | 1942 |
1959 } // namespace internal | 1943 } // namespace internal |
1960 } // namespace v8 | 1944 } // namespace v8 |
OLD | NEW |