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,68 @@
// Copyright 2015 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 Foo(a, b) {
var bname = "b";
this["a"] = a;
this[bname] = b;
this.x = this.a + this.b;
}
var f1 = new Foo(3, 4);
assertEquals(7, f1.x);
// SMIs
for (var i = 0; i < 6; i++) {
var f = new Foo(i, i + 2);
assertEquals(i + i + 2, f.x);
}
// derbles
for (var i = 0.25; i < 6.25; i++) {
var f = new Foo(i, i + 2);
assertEquals(i + i + 2, f.x);
}
// stirngs
for (var i = 0; i < 6; i++) {
var f = new Foo(i + '', i + 2 + '');
assertEquals(i + '' + (i + 2 + ''), f.x);
}
{
function Global(i) {
this.bla = i;
};
%PrepareFunctionForOptimization(Global);
Global(0);
Global(1);
%OptimizeFunctionOnNextCall(Global);
Global(2);
assertEquals(bla, 2);
}
{
function access(obj) {
obj.bla = 42;
}
access({a: 0});
access({b: 0});
access({c: 0});
access({d: 0});
access({e: 0});
var global = this;
function foo() {
access(global);
};
%PrepareFunctionForOptimization(foo);
;
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
foo();
}