summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime-compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/runtime/runtime-compiler.cc')
-rw-r--r--deps/v8/src/runtime/runtime-compiler.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/v8/src/runtime/runtime-compiler.cc b/deps/v8/src/runtime/runtime-compiler.cc
index 4364c55775..c7f3201eac 100644
--- a/deps/v8/src/runtime/runtime-compiler.cc
+++ b/deps/v8/src/runtime/runtime-compiler.cc
@@ -157,6 +157,9 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) {
TimerEventScope<TimerEventDeoptimizeCode> timer(isolate);
TRACE_EVENT0("v8", "V8.DeoptimizeCode");
Handle<JSFunction> function = deoptimizer->function();
+ // For OSR the optimized code isn't installed on the function, so get the
+ // code object from deoptimizer.
+ Handle<Code> optimized_code = deoptimizer->compiled_code();
DeoptimizeKind type = deoptimizer->deopt_kind();
// TODO(turbofan): We currently need the native context to materialize
@@ -174,7 +177,7 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) {
// Invalidate the underlying optimized code on non-lazy deopts.
if (type != DeoptimizeKind::kLazy) {
- Deoptimizer::DeoptimizeFunction(*function);
+ Deoptimizer::DeoptimizeFunction(*function, *optimized_code);
}
return ReadOnlyRoots(isolate).undefined_value();
@@ -224,8 +227,7 @@ BailoutId DetermineEntryAndDisarmOSRForInterpreter(JavaScriptFrame* frame) {
RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate);
- DCHECK_EQ(1, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+ DCHECK_EQ(0, args.length());
// Only reachable when OST is enabled.
CHECK(FLAG_use_osr);
@@ -233,7 +235,6 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
// Determine frame triggering OSR request.
JavaScriptFrameIterator it(isolate);
JavaScriptFrame* frame = it.frame();
- DCHECK_EQ(frame->function(), *function);
DCHECK(frame->is_interpreted());
// Determine the entry point for which this OSR request has been fired and
@@ -242,6 +243,7 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
DCHECK(!ast_id.IsNone());
MaybeHandle<Code> maybe_result;
+ Handle<JSFunction> function(frame->function(), isolate);
if (IsSuitableForOnStackReplacement(isolate, function)) {
if (FLAG_trace_osr) {
PrintF("[OSR - Compiling: ");