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

Unified Diff: src/hydrogen.cc

Issue 7085034: Reapply change to Pass undefined to JS builtins when called with (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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/heap.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index c76f7c4a9cd88af44183fcc3b29da0fcabd25c68..a03ceb46de9f98b4fd5e5b997a8075c6d13c7d4a 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5959,10 +5959,11 @@ HEnvironment* HEnvironment::CopyForInlining(
inner->SetValueAt(i, push);
}
}
- // If the function we are inlining is a strict mode function, pass
- // undefined as the receiver for function calls (instead of the
- // global receiver).
- if (function->strict_mode() && call_kind == CALL_AS_FUNCTION) {
+ // If the function we are inlining is a strict mode function or a
+ // builtin function, pass undefined as the receiver for function
+ // calls (instead of the global receiver).
+ if ((target->shared()->native() || function->strict_mode()) &&
+ call_kind == CALL_AS_FUNCTION) {
inner->SetValueAt(0, undefined);
}
inner->SetValueAt(arity + 1, outer->LookupContext());
« no previous file with comments | « src/heap.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698