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

Unified Diff: src/hydrogen.cc

Issue 9750007: Use correct arguments adaptation environment when inlining function containing arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 358256cbf2f4fc2ddd6253a910d55013f0eb305b..507d041a39ecc186147c244cec06652644984f17 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5749,20 +5749,11 @@ bool HGraphBuilder::TryCallApply(Call* expr) {
AddInstruction(new(zone()) HWrapReceiver(receiver, function));
PushAndAdd(new(zone()) HPushArgument(wrapped_receiver));
- int parameter_count = environment()->parameter_count();
- for (int i = 1; i < environment()->parameter_count(); i++) {
- PushAndAdd(new(zone()) HPushArgument(environment()->Lookup(i)));
- }
-
- if (environment()->outer()->frame_type() == ARGUMENTS_ADAPTOR) {
- HEnvironment* adaptor = environment()->outer();
- parameter_count = adaptor->parameter_count();
+ HEnvironment* arguments_env = environment()->arguments_environment();
- for (int i = environment()->parameter_count();
- i < adaptor->parameter_count();
- i++) {
- PushAndAdd(new(zone()) HPushArgument(adaptor->Lookup(i)));
- }
+ int parameter_count = arguments_env->parameter_count();
+ for (int i = 1; i < arguments_env->parameter_count(); i++) {
+ PushAndAdd(new(zone()) HPushArgument(arguments_env->Lookup(i)));
}
HInvokeFunction* call = new(zone()) HInvokeFunction(

Powered by Google App Engine
This is Rietveld 408576698