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

Unified Diff: src/compiler.cc

Issue 677843005: Do not compile with Turbofan if we cannot deopt for debugging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add assertion Created 6 years, 2 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 e894e10410a7c991ad4c0988b017bb1428aa9b30..b7e0c98f5e2ac2dbf97f756aca85f815375769c0 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -845,14 +845,17 @@ MaybeHandle<Code> Compiler::GetUnoptimizedCode(Handle<JSFunction> function) {
MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
- DCHECK(!function->GetIsolate()->has_pending_exception());
+ Isolate* isolate = function->GetIsolate();
+ DCHECK(!isolate->has_pending_exception());
DCHECK(!function->is_compiled());
-
- if (FLAG_turbo_asm && function->shared()->asm_function()) {
+ // If the debugger is active, do not compile with turbofan unless we can
+ // deopt from turbofan code.
+ if (FLAG_turbo_asm && function->shared()->asm_function() &&
+ (FLAG_turbo_deoptimization || !isolate->debug()->is_active())) {
CompilationInfoWithZone info(function);
- VMState<COMPILER> state(info.isolate());
- PostponeInterruptsScope postpone(info.isolate());
+ VMState<COMPILER> state(isolate);
+ PostponeInterruptsScope postpone(isolate);
info.SetOptimizing(BailoutId::None(),
Handle<Code>(function->shared()->code()));
@@ -861,7 +864,10 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
info.MarkAsTypingEnabled();
info.MarkAsInliningDisabled();
- if (GetOptimizedCodeNow(&info)) return info.code();
+ if (GetOptimizedCodeNow(&info)) {
+ DCHECK(function->shared()->is_compiled());
+ return info.code();
+ }
}
if (function->shared()->is_compiled()) {
@@ -870,13 +876,12 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
CompilationInfoWithZone info(function);
Handle<Code> result;
- ASSIGN_RETURN_ON_EXCEPTION(info.isolate(), result,
- GetUnoptimizedCodeCommon(&info), Code);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
+ Code);
- if (FLAG_always_opt &&
- info.isolate()->use_crankshaft() &&
+ if (FLAG_always_opt && isolate->use_crankshaft() &&
!info.shared_info()->optimization_disabled() &&
- !info.isolate()->DebuggerHasBreakPoints()) {
+ !isolate->DebuggerHasBreakPoints()) {
Handle<Code> opt_code;
if (Compiler::GetOptimizedCode(
function, result,
« 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