Reviewers: Kevin Millikin,

Description:
Merge r9091 from the bleeding_edge to the 3.5 branch.

Do constant function check earlier in TryCallApply and ensure correct
environment for deopt.

[email protected]
BUG=v8:1650
TEST=test/mjsunit/regress/regress-1650.js

Please review this at http://codereview.chromium.org/7828005/

SVN Base: http://v8.googlecode.com/svn/branches/3.5/

Affected files:
  M     src/hydrogen.cc
  M     src/version.cc
  A  +  test/mjsunit/regress/regress-1650.js


### BEGIN SVN COPY METADATA
#$ cp branches/bleeding_edge/test/mjsunit/regress/regress-1650.js test/mjsunit/regress/regress-1650.js
### END SVN COPY METADATA
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc     (revision 9095)
+++ src/hydrogen.cc     (working copy)
@@ -4800,13 +4800,15 @@
   // Found pattern f.apply(receiver, arguments).
   VisitForValue(prop->obj());
   if (HasStackOverflow() || current_block() == NULL) return true;
-  HValue* function = Pop();
+  HValue* function = Top();
+  AddCheckConstantFunction(expr, function, function_map, true);
+  Drop(1);
+
   VisitForValue(args->at(0));
   if (HasStackOverflow() || current_block() == NULL) return true;
   HValue* receiver = Pop();
   HInstruction* elements = AddInstruction(new(zone()) HArgumentsElements);
HInstruction* length = AddInstruction(new(zone()) HArgumentsLength(elements));
-  AddCheckConstantFunction(expr, function, function_map, true);
   HInstruction* result =
       new(zone()) HApplyArguments(function, receiver, length, elements);
   result->set_position(expr->position());
Index: src/version.cc
===================================================================
--- src/version.cc      (revision 9095)
+++ src/version.cc      (working copy)
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     6
 #define BUILD_NUMBER      0
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
Index: test/mjsunit/regress/regress-1650.js


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to