Reviewers: Sven Panne,

Message:
Committed patchset #1 manually as r22022 (presubmit successful).

Description:
Revert "Allow inlining of functions containing %_ArgumentsLength."

This cuased layout test failures.

[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=22022

Please review this at https://codereview.chromium.org/349923009/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+11, -13 lines):
  M src/ast.cc
  M src/hydrogen.cc


Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index bf16b9c076b8786ce1cb4a2eecf4963f79d70fe9..53d27999ea073768fd0f879121cddf7964974732 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -1117,9 +1117,11 @@ void AstConstructionVisitor::VisitCallRuntime(CallRuntime* node) {
     // optimize them.
     add_flag(kDontInline);
   } else if (node->function()->intrinsic_type == Runtime::INLINE &&
-             node->raw_name()->IsOneByteEqualTo("_Arguments")) {
- // Don't inline the %_Arguments because it's implementation will not work.
-    // There is no stack frame to get them from.
+             (node->raw_name()->IsOneByteEqualTo("_ArgumentsLength") ||
+              node->raw_name()->IsOneByteEqualTo("_Arguments"))) {
+    // Don't inline the %_ArgumentsLength or %_Arguments because their
+    // implementation will not work.  There is no stack frame to get them
+    // from.
     add_flag(kDontInline);
   }
 }
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index d447bbc9f76cbcb6d16990ed22233d11b154e1d1..6ae1466d62de54427cc9992af757099705339594 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11310,17 +11310,13 @@ 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* 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);
-  }
+  HInstruction* elements = Add<HArgumentsElements>(false);
+  HArgumentsLength* result = New<HArgumentsLength>(elements);
   return ast_context()->ReturnInstruction(result, call->id());
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to