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

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

Issue 1412223015: [turbofan] Fix receiver binding for inlined callees. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 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 | « src/runtime/runtime.h ('k') | test/mjsunit/compiler/receiver-conversion.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 f994ee336561a3c51da186de4783480b75bf0a92..5e212a5bc9c861779050a78db930f728fbe36280 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -547,6 +547,18 @@ RUNTIME_FUNCTION(Runtime_GetOriginalConstructor) {
}
+// ES6 section 9.2.1.2, OrdinaryCallBindThis for sloppy callee.
+RUNTIME_FUNCTION(Runtime_ConvertReceiver) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
+ if (receiver->IsNull() || receiver->IsUndefined()) {
+ return isolate->global_proxy();
+ }
+ return *Object::ToObject(isolate, receiver).ToHandleChecked();
+}
+
+
// TODO(bmeurer): Kill %_CallFunction ASAP as it is almost never used
// correctly because of the weird semantics underneath.
RUNTIME_FUNCTION(Runtime_CallFunction) {
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/compiler/receiver-conversion.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698