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

Unified Diff: src/runtime/runtime-function.cc

Issue 1432493003: [turbofan] Fix new.target when a function is inlined to a constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@reland
Patch Set: Test added Created 5 years, 1 month 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 | « src/frames.cc ('k') | test/mjsunit/es6/new-target.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 5e212a5bc9c861779050a78db930f728fbe36280..e575712daea1306e3a9f5a73a571eef66038789c 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -542,8 +542,10 @@ RUNTIME_FUNCTION(Runtime_GetOriginalConstructor) {
DCHECK(args.length() == 0);
JavaScriptFrameIterator it(isolate);
JavaScriptFrame* frame = it.frame();
- return frame->IsConstructor() ? frame->GetOriginalConstructor()
- : isolate->heap()->undefined_value();
+ // Currently we don't inline [[Construct]] calls.
+ return frame->IsConstructor() && !frame->HasInlinedFrames()
+ ? frame->GetOriginalConstructor()
+ : isolate->heap()->undefined_value();
}
« no previous file with comments | « src/frames.cc ('k') | test/mjsunit/es6/new-target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698