Reviewers: mvstanton, wingo,

Message:
Could you take a look, please?

It probably solve some of the other problems with the feedback vector
initialization and such...

Description:
Do not try to inline if the function has an illegal redeclaration.

[email protected]
BUG=chromium:436896
LOG=n

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+14, -5 lines):
  M src/hydrogen.cc
  A + test/mjsunit/regress/regress-436896.js


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 1d33bfa6126c7ed6ed889440934b0835616f1fde..eec5de3a0c23004efeeec5ad0d206dfc37ea157e 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7931,6 +7931,11 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
     return false;
   }

+  if (target_info.scope()->HasIllegalRedeclaration()) {
+    TraceInline(target, caller, "target has illegal redeclaration");
+    return false;
+  }
+
   if (target_info.scope()->num_heap_slots() > 0) {
     TraceInline(target, caller, "target has context-allocated variables");
     return false;
Index: test/mjsunit/regress/regress-436896.js
diff --git a/test/mjsunit/regress/regress-355486.js b/test/mjsunit/regress/regress-436896.js
similarity index 64%
copy from test/mjsunit/regress/regress-355486.js
copy to test/mjsunit/regress/regress-436896.js
index 55362a13416335b72bfa1ff92bc29f7a04edbd65..344a7a3049305a655b74f0ca56ea5ecba3bbf58c 100644
--- a/test/mjsunit/regress/regress-355486.js
+++ b/test/mjsunit/regress/regress-436896.js
@@ -4,10 +4,14 @@

 // Flags: --allow-natives-syntax

-function f() { var v = arguments[0]; }
-function g() { f(); }
+function f(x) {
+  const x = 0;
+  return x;
+}
+
+function g(x) {
+  return f(x);
+}

-g();
-g();
 %OptimizeFunctionOnNextCall(g);
-g();
+assertThrows(function() { g(42); }, TypeError);


--
--
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