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

Unified Diff: src/hydrogen.cc

Issue 355993002: Reland "Allow inlining of functions containing %_ArgumentsLength." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/ast.cc ('k') | no next file » | 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 6ae1466d62de54427cc9992af757099705339594..d447bbc9f76cbcb6d16990ed22233d11b154e1d1 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11310,13 +11310,17 @@ void HOptimizedGraphBuilder::GenerateIsConstructCall(CallRuntime* call) {
// Support for arguments.length and arguments[?].
void HOptimizedGraphBuilder::GenerateArgumentsLength(CallRuntime* call) {
- // Our implementation of arguments (based on this stack frame or an
- // adapter below it) does not work for inlined functions. This runtime
- // function is blacklisted by AstNode::IsInlineable.
- ASSERT(function_state()->outer() == NULL);
ASSERT(call->arguments()->length() == 0);
- HInstruction* elements = Add<HArgumentsElements>(false);
- HArgumentsLength* result = New<HArgumentsLength>(elements);
+ HInstruction* result = NULL;
+ if (function_state()->outer() == NULL) {
+ HInstruction* elements = Add<HArgumentsElements>(false);
+ result = New<HArgumentsLength>(elements);
+ } else {
+ // Number of arguments without receiver.
+ int argument_count = environment()->
+ arguments_environment()->parameter_count() - 1;
+ result = New<HConstant>(argument_count);
+ }
return ast_context()->ReturnInstruction(result, call->id());
}
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698