Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,9 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function f() {
for (f(x) in []) { f(new f()) }
}
f();

View File

@ -0,0 +1,11 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Verifies that DYNAMIC_GLOBAL variables walk the correct context-chain length
// to reach the sloppy-eval calling function context, including block contexts.
function test() {
return eval('var x = 100; { function z() {z}; x }')
}
test();

View File

@ -0,0 +1,22 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Test that PC in optimized frame would correctly translate into
// unoptimized frame when collecting stack trace.
function f() {
return new Error().stack;
}
function g(x) {
return f();
};
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
print(g());
assertTrue(/g \(.*?\.js:15:10\)/.test(g()));

View File

@ -0,0 +1,13 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --ignition-osr
function f() {
for (var i = 0; i < 10; i++) {
if (i == 5) %OptimizeOsr();
}
}
%PrepareFunctionForOptimization(f);
f();

View File

@ -0,0 +1,70 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
(function TestGeneratorOSRSimple() {
function* gen1() {
for (var i = 0; i < 3; ++i) {
if (i == 1) %OptimizeOsr();
}
return 23;
}
%PrepareFunctionForOptimization(gen1);
var g = gen1();
assertEquals({ value:23, done:true }, g.next());
})();
(function TestGeneratorOSRYieldAfterArming() {
function* gen2() {
for (var i = 0; i < 3; ++i) {
if (i == 1) %OptimizeOsr();
yield i;
}
return 23;
}
%PrepareFunctionForOptimization(gen2);
var g = gen2();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
assertEquals({ value:2, done:false }, g.next());
assertEquals({ value:23, done:true }, g.next());
})();
(function TestGeneratorOSRYieldBeforeArming() {
function* gen3() {
for (var i = 0; i < 3; ++i) {
yield i;
if (i == 1) %OptimizeOsr();
}
return 23;
}
%PrepareFunctionForOptimization(gen3);
var g = gen3();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
assertEquals({ value:2, done:false }, g.next());
assertEquals({ value:23, done:true }, g.next());
})();
(function TestGeneratorOSRNested() {
function* gen4() {
for (var i = 0; i < 3; ++i) {
for (var j = 0; j < 3; ++j) {
for (var k = 0; k < 10; ++k) {
if (k == 5) %OptimizeOsr();
}
%PrepareFunctionForOptimization(gen4);
}
yield i;
}
return 23;
}
%PrepareFunctionForOptimization(gen4);
var g = gen4();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
assertEquals({ value:2, done:false }, g.next());
assertEquals({ value:23, done:true }, g.next());
})();

View File

@ -0,0 +1,13 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --print-ast --no-stress-background-compile
// Ensures that the --print-ast flag doesn't crash.
function foo(a) {
var b = 2;
return function bar() { return a + b; };
}
foo()();

View File

@ -0,0 +1,18 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-inline-new
function __f_2(b, value) {
b[1] = value;
}
function __f_9() {
var arr = [1.5, 0, 0];
// Call with a double, so the expected element type is double.
__f_2(1.5);
// Call with an object, which triggers transition from FAST_double
// to Object for the elements type.
__f_2(arr);
}
__f_9();

View File

@ -0,0 +1,17 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --verify-heap --expose-gc
// Tests that verify heap works for BytecodeArrays in the large object space.
// Creates a list of variable declarations and calls it through eval to
// generate a large BytecodeArray.
var s = "";
for (var i = 0; i < 65535; i++) {
s += ("var a" + i + ";");
}
(function() { eval(s); })();
gc();

View File

@ -0,0 +1,29 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-inline-new
function keyed_store(obj, key, value) {
obj[key] = value;
}
function foo() {
obj = {};
obj.smi = 1;
obj.dbl = 1.5;
obj.obj = {a:1};
// Transition keyed store IC to polymorphic.
keyed_store(obj, "smi", 100);
keyed_store(obj, "dbl", 100);
keyed_store(obj, "obj", 100);
// Now call with a PACKED_SMI_ELEMENTS object.
var smi_array = [5, 1, 1];
keyed_store(smi_array, 1, 6);
// Transition from PACKED_SMI_ELEMENTS to PACKED_DOUBLE_ELEMENTS.
keyed_store(smi_array, 2, 1.2);
}
foo();

View File

@ -0,0 +1,24 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function foo() {
if (this.Worker) {
function __f_0() { this.s = a; }
function __f_1() {
this.l = __f_0;
}
with ( 'source' , Object ) throw function __f_0(__f_0) {
return Worker.__f_0(-2147483648, __f_0);
};
var __v_9 = new Worker('', {type: 'string'});
__f_1 = {s: Math.s, __f_1: true};
}
}
try {
foo();
} catch(e) {
}

View File

@ -0,0 +1,14 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function f(t) {
var f = t || this;
for (var i in t) {
for (var j in t) {
(j);
continue;
}
}
}
f();

View File

@ -0,0 +1,18 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var valueof_calls = 0;
var v = {
toString: function() {
var z = w++;
}
};
var w = {
valueOf: function() {
valueof_calls++;
}
};
var x = { [v]: 'B' };
assertTrue(valueof_calls == 1);

View File

@ -0,0 +1,27 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var foo_call_count = 0;
function foo() { foo_call_count++; }
// These || and && combinations shouldn't call foo().
(true || foo()) ? 1 : 2;
assertTrue(foo_call_count == 0);
(false && foo()) ? 1 : 2;
assertTrue(foo_call_count == 0);
// These || and && combinations should all call foo().
(foo() || true) ? 1 : 2;
assertTrue(foo_call_count == 1);
(false || foo()) ? 1 : 2;
assertTrue(foo_call_count == 2);
(foo() || false) ? 1 : 2;
assertTrue(foo_call_count == 3);
(true && foo()) ? 1 : 2;
assertTrue(foo_call_count == 4);
(foo() && true) ? 1 : 2;
assertTrue(foo_call_count == 5);
(foo() && false) ? 1 : 2;
assertTrue(foo_call_count == 6);

View File

@ -0,0 +1,17 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --max-old-space-size=100 --no-concurrent-sparkplug
(function() {
var source = "[]"
for (var i = 0; i < 300; i++) {
source += ".concat([";
for (var j = 0; j < 1000; j++) {
source += "0,";
}
source += "0])"
}
eval(source);
})();

View File

@ -0,0 +1,20 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-turbo
// TODO(yangguo): fix for turbofan
function f(x) {
if (x == 0) {
return new Error().stack;
}
return f(x - 1);
}
var stack_lines = f(2).split("\n");
assertTrue(/at f \(.*?:11:12\)/.test(stack_lines[1]));
assertTrue(/at f \(.*?:13:10\)/.test(stack_lines[2]));
assertTrue(/at f \(.*?:13:10\)/.test(stack_lines[3]));

View File

@ -0,0 +1,21 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --expose-externalize-string
// Calculate string so that it isn't internalized.
var string = createExternalizableString(((a, b) => {
return a + b;
})('foo', 'bar'));
// Now externalize it.
externalizeString(string);
// Then internalize it by using it as a keyed property name
// to turn it a thin string.
var obj = {};
obj[string];
// Perform a string concatination.
assertEquals('"' + string + '"', '"foobar"');

View File

@ -0,0 +1,24 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --turbofan --allow-natives-syntax --no-always-turbofan
function f(b) {
if (b == 1) {
let a = a = 20;
}
}
f(0);
assertThrows(() => {f(1)}, ReferenceError);
%PrepareFunctionForOptimization(f);
f(0);
f(0);
%OptimizeFunctionOnNextCall(f);
f(0);
assertOptimized(f);
// Check that hole checks are handled correctly in optimized code.
assertThrows(() => {f(1)}, ReferenceError);
assertOptimized(f);

View File

@ -0,0 +1,34 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --turbofan --allow-natives-syntax --no-always-turbofan
class A {
constructor() { }
}
class B extends A {
constructor(call_super) {
super();
if (call_super) {
super();
}
}
}
// No feedback case
test = new B(0);
assertThrows(() => {new B(1)}, ReferenceError);
// Ensure Feedback
%PrepareFunctionForOptimization(B);
%EnsureFeedbackVectorForFunction(A);
test = new B(0);
test = new B(0);
assertThrows(() => {new B(1)}, ReferenceError);
assertThrows(() => {new B(1)}, ReferenceError);
%OptimizeFunctionOnNextCall(B);
test = new B(0);
assertOptimized(B);
// Check that hole checks are handled correctly in optimized code.
assertThrows(() => {new B(1)}, ReferenceError);
assertOptimized(B);

View File

@ -0,0 +1,29 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --turbofan --allow-natives-syntax --no-always-turbofan
class A {
constructor() { }
}
class B extends A {
constructor(call_super) {
if (call_super) {
super();
}
}
}
test = new B(1);
assertThrows(() => {new B(0)}, ReferenceError);
%PrepareFunctionForOptimization(B);
test = new B(1);
test = new B(1);
%OptimizeFunctionOnNextCall(B);
test = new B(1);
assertOptimized(B);
// Check that hole checks are handled correctly in optimized code.
assertThrows(() => {new B(0)}, ReferenceError);
assertOptimized(B);

325
deps/v8/test/mjsunit/ignition/tracing.js vendored Normal file
View File

@ -0,0 +1,325 @@
// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --trace-ignition
// Test tracing doesn't crash or leak. Not explicitly pattern matching.
function f() {
var values = [];
var x = 10000000;
var y = x + 1;
var _aa;
var _ab;
var _ac;
var _ad;
var _ae;
var _af;
var _ag;
var _ah;
var _ai;
var _aj;
var _ak;
var _al;
var _am;
var _an;
var _ao;
var _ap;
var _ba;
var _bb;
var _bc;
var _bd;
var _be;
var _bf;
var _bg;
var _bh;
var _bi;
var _bj;
var _bk;
var _bl;
var _bm;
var _bn;
var _bo;
var _bp;
var _ca;
var _cb;
var _cc;
var _cd;
var _ce;
var _cf;
var _cg;
var _ch;
var _ci;
var _cj;
var _ck;
var _cl;
var _cm;
var _cn;
var _co;
var _cp;
var _da;
var _db;
var _dc;
var _dd;
var _de;
var _df;
var _dg;
var _dh;
var _di;
var _dj;
var _dk;
var _dl;
var _dm;
var _dn;
var _do;
var _dp;
var _ea;
var _eb;
var _ec;
var _ed;
var _ee;
var _ef;
var _eg;
var _eh;
var _ei;
var _ej;
var _ek;
var _el;
var _em;
var _en;
var _eo;
var _ep;
var _fa;
var _fb;
var _fc;
var _fd;
var _fe;
var _ff;
var _fg;
var _fh;
var _fi;
var _fj;
var _fk;
var _fl;
var _fm;
var _fn;
var _fo;
var _fp;
var _ga;
var _gb;
var _gc;
var _gd;
var _ge;
var _gf;
var _gg;
var _gh;
var _gi;
var _gj;
var _gk;
var _gl;
var _gm;
var _gn;
var _go;
var _gp;
var _ha;
var _hb;
var _hc;
var _hd;
var _he;
var _hf;
var _hg;
var _hh;
var _hi;
var _hj;
var _hk;
var _hl;
var _hm;
var _hn;
var _ho;
var _hp;
var _ia;
var _ib;
var _ic;
var _id;
var _ie;
var _if;
var _ig;
var _ih;
var _ii;
var _ij;
var _ik;
var _il;
var _im;
var _in;
var _io;
var _ip;
var _ja;
var _jb;
var _jc;
var _jd;
var _je;
var _jf;
var _jg;
var _jh;
var _ji;
var _jj;
var _jk;
var _jl;
var _jm;
var _jn;
var _jo;
var _jp;
var _ka;
var _kb;
var _kc;
var _kd;
var _ke;
var _kf;
var _kg;
var _kh;
var _ki;
var _kj;
var _kk;
var _kl;
var _km;
var _kn;
var _ko;
var _kp;
var _la;
var _lb;
var _lc;
var _ld;
var _le;
var _lf;
var _lg;
var _lh;
var _li;
var _lj;
var _lk;
var _ll;
var _lm;
var _ln;
var _lo;
var _lp;
var _ma;
var _mb;
var _mc;
var _md;
var _me;
var _mf;
var _mg;
var _mh;
var _mi;
var _mj;
var _mk;
var _ml;
var _mm;
var _mn;
var _mo;
var _mp;
var _na;
var _nb;
var _nc;
var _nd;
var _ne;
var _nf;
var _ng;
var _nh;
var _ni;
var _nj;
var _nk;
var _nl;
var _nm;
var _nn;
var _no;
var _np;
var _oa;
var _ob;
var _oc;
var _od;
var _oe;
var _of;
var _og;
var _oh;
var _oi;
var _oj;
var _ok;
var _ol;
var _om;
var _on;
var _oo;
var _op;
var _pa;
var _pb;
var _pc;
var _pd;
var _pe;
var _pf;
var _pg;
var _ph;
var _pi;
var _pj;
var _pk;
var _pl;
var _pm;
var _pn;
var _po;
var _pp;
var _qa;
var _qb;
var _qc;
var _qd;
var _qe;
var _qf;
var _qg;
var _qh;
var _qi;
var _qj;
var _qk;
var _ql;
var _qm;
var _qn;
var _qo;
var _qp;
var _ra;
var _rb;
var _rc;
var _rd;
var _re;
var _rf;
var _rg;
var _rh;
var _ri;
var _rj;
var _rk;
var _rl;
var _rm;
var _rn;
var _ro;
var _rp = 287; values[_rp] = _rp;
};
f();