Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: src/compiler.cc

Issue 1884183002: First version of the new generators implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 499 }
500 500
501 bool UseIgnition(CompilationInfo* info) { 501 bool UseIgnition(CompilationInfo* info) {
502 // We only get here without a shared function info is when compiling a script 502 // We only get here without a shared function info is when compiling a script
503 // for live edit. We cannot (yet) use Ignition to compile for live edit. 503 // for live edit. We cannot (yet) use Ignition to compile for live edit.
504 if (!info->has_shared_info()) { 504 if (!info->has_shared_info()) {
505 DCHECK(info->isolate()->debug()->live_edit_enabled()); 505 DCHECK(info->isolate()->debug()->live_edit_enabled());
506 return false; 506 return false;
507 } 507 }
508 508
509 // TODO(4681): Generator functions are not yet supported. 509 if (info->shared_info()->is_generator() && !FLAG_ignition_generators) {
510 if (info->shared_info()->is_generator()) {
511 return false; 510 return false;
512 } 511 }
513 512
514 // Checks whether top level functions should be passed by the filter. 513 // Checks whether top level functions should be passed by the filter.
515 if (info->shared_info()->is_toplevel()) { 514 if (info->shared_info()->is_toplevel()) {
516 Vector<const char> filter = CStrVector(FLAG_ignition_filter); 515 Vector<const char> filter = CStrVector(FLAG_ignition_filter);
517 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); 516 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*');
518 } 517 }
519 518
520 // Finally respect the filter. 519 // Finally respect the filter.
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 PostponeInterruptsScope postpone(isolate); 832 PostponeInterruptsScope postpone(isolate);
834 833
835 info->SetOptimizingForOsr(osr_ast_id); 834 info->SetOptimizingForOsr(osr_ast_id);
836 835
837 // Do not use Crankshaft/TurboFan if we need to be able to set break points. 836 // Do not use Crankshaft/TurboFan if we need to be able to set break points.
838 if (info->shared_info()->HasDebugInfo()) { 837 if (info->shared_info()->HasDebugInfo()) {
839 info->AbortOptimization(kFunctionBeingDebugged); 838 info->AbortOptimization(kFunctionBeingDebugged);
840 return MaybeHandle<Code>(); 839 return MaybeHandle<Code>();
841 } 840 }
842 841
842 // Do not use Crankshaft/TurboFan on a generator function.
843 // TODO(neis): Eventually enable for Turbofan.
844 if (IsGeneratorFunction(info->shared_info()->kind())) {
845 info->AbortOptimization(kGenerator);
846 return MaybeHandle<Code>();
847 }
848
843 // Limit the number of times we try to optimize functions. 849 // Limit the number of times we try to optimize functions.
844 const int kMaxOptCount = 850 const int kMaxOptCount =
845 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; 851 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
846 if (info->shared_info()->opt_count() > kMaxOptCount) { 852 if (info->shared_info()->opt_count() > kMaxOptCount) {
847 info->AbortOptimization(kOptimizedTooManyTimes); 853 info->AbortOptimization(kOptimizedTooManyTimes);
848 return MaybeHandle<Code>(); 854 return MaybeHandle<Code>();
849 } 855 }
850 856
851 if (mode == Compiler::CONCURRENT) { 857 if (mode == Compiler::CONCURRENT) {
852 if (GetOptimizedCodeLater(info.get())) { 858 if (GetOptimizedCodeLater(info.get())) {
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 MaybeHandle<Code> code; 1675 MaybeHandle<Code> code;
1670 if (cached.code != nullptr) code = handle(cached.code); 1676 if (cached.code != nullptr) code = handle(cached.code);
1671 Handle<Context> native_context(function->context()->native_context()); 1677 Handle<Context> native_context(function->context()->native_context());
1672 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, 1678 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
1673 literals, BailoutId::None()); 1679 literals, BailoutId::None());
1674 } 1680 }
1675 } 1681 }
1676 1682
1677 } // namespace internal 1683 } // namespace internal
1678 } // namespace v8 1684 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/debug/mirrors.js » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698