Status: Accepted
Owner: ----
CC: [email protected],  [email protected]
Labels: Type-Bug Priority-Medium

New issue 3176 by [email protected]: Optimistic bounds check generalization leads to repetetive deoptimization
http://code.google.com/p/v8/issues/detail?id=3176

In the code below optimizer optimistically generalizes bounds check at (*) to perform both i and i - 5 checks. This leads to a deopt at the very first loop iteration. Optimizer never learns anything from the deopt and will continue to repeat the mistake.

function foo(a) {
  var sum = 0;
  for (var i = 0; i < 10; i++) {
    sum += a[i]; // (*)

    if (i > 6) {
        sum -= a[i - 4];
        sum -= a[i - 5];
    }
  }

  return sum;
}

var a = new Int32Array(10);

foo(a);
foo(a);
%OptimizeFunctionOnNextCall(foo);
foo(a);
%OptimizeFunctionOnNextCall(foo);
foo(a);

Most probably related to r19475 hence CCing Sven and Jakob.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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/groups/opt_out.

Reply via email to