I think you need to change the Crankshaft graph builder to bailout in case of let declarations. Otherwise, there won't be the expected behavior from generated
code. e.g. the following example would optimize f and doesn't throw a
ReferenceError when invoking f(42, false) after optimization:


function f(x, b) {
  let y = (b ? y : x) + 42;
  return y;
}

for (var i=0; i<10000000; i++) f(42, false);
print(f(42, true));


http://codereview.chromium.org/7671042/

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

Reply via email to