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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2367483003: Remove ARGUMENTS_VARIABLE and fix crankshaft to properly detect the arguments object and keep it al… (Closed)
Patch Set: Rebaseline more Created 4 years, 3 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/crankshaft/hydrogen.h ('k') | src/globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index b93db2478e0af3db40d2cf1374040006b1dd1abd..e6c913486ae24361859b3f1e5322fcfaefcb94a4 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -6934,8 +6934,6 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
}
}
- if (var->is_arguments()) return Bailout(kAssignmentToArguments);
-
// Handle the assignment.
switch (var->location()) {
case VariableLocation::UNALLOCATED:
@@ -9314,8 +9312,6 @@ bool HOptimizedGraphBuilder::TryIndirectCall(Call* expr) {
case kFunctionApply: {
// For .apply, only the pattern f.apply(receiver, arguments)
// is supported.
- if (current_info()->scope()->arguments() == NULL) return false;
-
if (!CanBeFunctionApplyArguments(expr)) return false;
BuildFunctionApply(expr);
@@ -9335,6 +9331,10 @@ void HOptimizedGraphBuilder::BuildFunctionApply(Call* expr) {
HValue* function = Pop(); // f
Drop(1); // apply
+ // Make sure the arguments object is live.
+ VariableProxy* arg_two = args->at(1)->AsVariableProxy();
+ LookupAndMakeLive(arg_two->var());
+
Handle<Map> function_map = expr->GetReceiverTypes()->first();
HValue* checked_function = AddCheckMap(function, function_map);
@@ -9580,8 +9580,9 @@ bool HOptimizedGraphBuilder::CanBeFunctionApplyArguments(Call* expr) {
if (args->length() != 2) return false;
VariableProxy* arg_two = args->at(1)->AsVariableProxy();
if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false;
- HValue* arg_two_value = LookupAndMakeLive(arg_two->var());
+ HValue* arg_two_value = environment()->Lookup(arg_two->var());
if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false;
+ DCHECK_NOT_NULL(current_info()->scope()->arguments());
return true;
}
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698