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

Unified Diff: src/compiler.cc

Issue 1883313003: [compiler] Hoist bailouts out of OptimizedCompileJob. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-compiler-2
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 4be483a88edf88a314095c5d7cefa8262e0b2860..b36d2663ac0545ee89e5f814d136aa3fa0df3501 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -308,20 +308,9 @@ void CompilationInfo::PrintAstForTesting() {
// Implementation of OptimizedCompileJob
OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
+ DisallowJavascriptExecution no_js(isolate());
DCHECK(info()->IsOptimizing());
- // Do not use Crankshaft/TurboFan if we need to be able to set break points.
- if (info()->shared_info()->HasDebugInfo()) {
- return AbortOptimization(kFunctionBeingDebugged);
- }
-
- // Limit the number of times we try to optimize functions.
- const int kMaxOptCount =
- FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
- if (info()->shared_info()->opt_count() > kMaxOptCount) {
- return AbortOptimization(kOptimizedTooManyTimes);
- }
-
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure()) << " using "
@@ -833,6 +822,20 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
info->SetOptimizingForOsr(osr_ast_id);
+ // Do not use Crankshaft/TurboFan if we need to be able to set break points.
+ if (info->shared_info()->HasDebugInfo()) {
+ info->AbortOptimization(kFunctionBeingDebugged);
+ return MaybeHandle<Code>();
+ }
+
+ // Limit the number of times we try to optimize functions.
+ const int kMaxOptCount =
+ FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
+ if (info->shared_info()->opt_count() > kMaxOptCount) {
+ info->AbortOptimization(kOptimizedTooManyTimes);
+ return MaybeHandle<Code>();
+ }
+
if (mode == Compiler::CONCURRENT) {
if (GetOptimizedCodeLater(info.get())) {
info.Detach(); // The background recompile job owns this now.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698