diff --git a/src/compiler.cc b/src/compiler.cc index e496aee62d..50e69a2c4d 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -417,6 +417,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { compiler::Pipeline pipeline(info()); pipeline.GenerateCode(); if (!info()->code().is_null()) { + info()->context()->native_context()->AddOptimizedCode(*info()->code()); return SetLastStatus(SUCCEEDED); } } diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index d5e73233c6..66a371bceb 100644 --- a/src/compiler/ast-graph-builder.cc +++ b/src/compiler/ast-graph-builder.cc @@ -87,7 +87,8 @@ bool AstGraphBuilder::CreateGraph() { VisitDeclarations(scope->declarations()); // TODO(mstarzinger): This should do an inlined stack check. - NewNode(javascript()->Runtime(Runtime::kStackGuard, 0)); + Node* node = NewNode(javascript()->Runtime(Runtime::kStackGuard, 0)); + PrepareFrameState(node, BailoutId::FunctionEntry()); // Visit statements in the function body. VisitStatements(info()->function()->body()); diff --git a/src/compiler/operator-properties-inl.h b/src/compiler/operator-properties-inl.h index a65068d7ff..9d8cc0424e 100644 --- a/src/compiler/operator-properties-inl.h +++ b/src/compiler/operator-properties-inl.h @@ -47,6 +47,9 @@ inline bool OperatorProperties::HasFrameStateInput(Operator* op) { switch (function) { case Runtime::kDebugBreak: case Runtime::kDeoptimizeFunction: + case Runtime::kSetScriptBreakPoint: + case Runtime::kDebugGetLoadedScripts: + case Runtime::kStackGuard: return true; default: return false; @@ -178,6 +181,9 @@ inline bool OperatorProperties::CanLazilyDeoptimize(Operator* op) { switch (function) { case Runtime::kDebugBreak: case Runtime::kDeoptimizeFunction: + case Runtime::kSetScriptBreakPoint: + case Runtime::kDebugGetLoadedScripts: + case Runtime::kStackGuard: return true; default: return false; diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc index 1df7df84d0..5209a51611 100644 --- a/src/deoptimizer.cc +++ b/src/deoptimizer.cc @@ -378,7 +378,8 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) { CHECK_EQ(code->kind(), Code::OPTIMIZED_FUNCTION); Object* next = code->next_code_link(); - if (code->marked_for_deoptimization()) { + if (code->marked_for_deoptimization() && + (!code->is_turbofanned() || FLAG_turbo_deoptimization)) { // Put the code into the list for later patching. codes.Add(code, &zone); diff --git a/test/mjsunit/debug-backtrace-text.js b/test/mjsunit/debug-backtrace-text.js index 61648fa4e2..3bfaeb0dad 100644 --- a/test/mjsunit/debug-backtrace-text.js +++ b/test/mjsunit/debug-backtrace-text.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --expose-debug-as debug +// Flags: --expose-debug-as debug --turbo-deoptimization // The functions used for testing backtraces. function Point(x, y) { diff --git a/test/mjsunit/debug-break-inline.js b/test/mjsunit/debug-break-inline.js index 4418fa8d1b..3ef4d4eafe 100644 --- a/test/mjsunit/debug-break-inline.js +++ b/test/mjsunit/debug-break-inline.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --expose-debug-as debug --allow-natives-syntax +// Flags: --expose-debug-as debug --allow-natives-syntax --turbo-deoptimization // This test tests that deoptimization due to debug breaks works for // inlined functions where the full-code is generated before the diff --git a/test/mjsunit/debug-scopes.js b/test/mjsunit/debug-scopes.js index ce37d24023..4823496e3c 100644 --- a/test/mjsunit/debug-scopes.js +++ b/test/mjsunit/debug-scopes.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --expose-debug-as debug --allow-natives-syntax +// Flags: --expose-debug-as debug --allow-natives-syntax --turbo-deoptimization // The functions used for testing backtraces. They are at the top to make the // testing of source line/column easier. diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index 472ecee9f1..636b7084db 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -97,8 +97,6 @@ 'deserialize-reference': [PASS, NO_VARIANTS], # Support for %GetFrameDetails is missing and requires checkpoints. - 'debug-backtrace-text': [PASS, NO_VARIANTS], - 'debug-break-inline': [PASS, NO_VARIANTS], 'debug-evaluate-bool-constructor': [PASS, NO_VARIANTS], 'debug-evaluate-closure': [PASS, NO_VARIANTS], 'debug-evaluate-const': [PASS, NO_VARIANTS], @@ -110,7 +108,6 @@ 'debug-liveedit-double-call': [PASS, NO_VARIANTS], 'debug-liveedit-restart-frame': [PASS, NO_VARIANTS], 'debug-return-value': [PASS, NO_VARIANTS], - 'debug-scopes': [PASS, NO_VARIANTS], 'debug-set-variable-value': [PASS, NO_VARIANTS], 'debug-step-stub-callfunction': [PASS, NO_VARIANTS], 'debug-stepin-accessor': [PASS, NO_VARIANTS],