PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/jaeger/bug670885.js

http://github.com/zpao/v8monkey
JavaScript | 16 lines | 14 code | 0 blank | 2 comment | 1 complexity | 9a65a78f316cc24b5e030bd8f33e0e8e MD5 | raw file
 1// arr is an Int8Array, then changes to Int16Array.
 2// This should trigger recompilation of f.
 3var arr = new Int8Array(100);
 4var arr16 = new Int16Array(100);
 5arr16[2] = 12345;
 6function f(a) {
 7    var x;
 8    for(var i=0; i<30; i++) {
 9        x = a[2];
10    }
11    return x;
12}
13assertEq(f(arr), 0);
14assertEq(f(arr), 0);
15this.arr = arr16;
16assertEq(f(arr), 12345);