2017-01-13 13:57:00 +00:00
|
|
|
// 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.
|
|
|
|
|
2022-02-03 15:52:11 +00:00
|
|
|
// Test various debug flags
|
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax --trace-gc-object-stats --gc-global
|
|
|
|
// Flags: --trace-zone-stats --expose-gc --trace-gc
|
2017-01-13 13:57:00 +00:00
|
|
|
|
|
|
|
var largeArray = [];
|
|
|
|
largeArray[0xFFFF00] = 123;
|
|
|
|
|
2017-04-06 09:41:59 +00:00
|
|
|
function sloppyArguments() {
|
|
|
|
return arguments;
|
|
|
|
}
|
|
|
|
|
|
|
|
function sloppyArguments2(a, b) {
|
|
|
|
return arguments;
|
|
|
|
}
|
|
|
|
|
|
|
|
function slowSloppyArguments() {
|
|
|
|
arguments[0xFFFFF] = -1;
|
|
|
|
return arguments;
|
|
|
|
}
|
|
|
|
|
|
|
|
function slowSloppyArguments2(a, b) {
|
|
|
|
arguments[0xFFFFF] = -1;
|
|
|
|
return arguments;
|
|
|
|
}
|
|
|
|
|
2022-02-03 15:52:11 +00:00
|
|
|
let proto_obj = { fn1() { return 1 } }
|
|
|
|
let obj_with_enum_cache = {
|
|
|
|
__proto__: proto_obj,
|
|
|
|
a: 1,
|
|
|
|
b: 2,
|
|
|
|
c: "c"
|
|
|
|
};
|
|
|
|
|
|
|
|
for (let k in obj_with_enum_cache) {
|
|
|
|
// do something
|
|
|
|
obj_with_enum_cache.a += obj_with_enum_cache.fn1();
|
|
|
|
}
|
2017-04-06 09:41:59 +00:00
|
|
|
|
2022-02-03 15:52:11 +00:00
|
|
|
|
|
|
|
let string_1 = "aasdfasdfasdfasdf asd fa sdf asdf as dfa sdf asd f"
|
|
|
|
let string_2 = "aasdfasdfasdfasdf asd fa sdf UC16\u2028asdf as dfa sdf asd f"
|
2017-01-13 13:57:00 +00:00
|
|
|
var objects = [
|
|
|
|
this,
|
|
|
|
true, false, null, undefined,
|
|
|
|
1, -1, 1.1, -2.2, -0, 0,
|
2019-10-29 11:56:15 +00:00
|
|
|
9007199254740991.0, 9007199254740991.0 + 10,
|
|
|
|
-9007199254740992.0, -9007199254740992.0 - 10,
|
2017-01-13 13:57:00 +00:00
|
|
|
Infinity, -Infinity, NaN,
|
2022-02-03 15:52:11 +00:00
|
|
|
string_1, string_1+"b", string_1.slice(1),
|
|
|
|
string_2, string_2+"b", string_2.slice(1),
|
2017-01-13 13:57:00 +00:00
|
|
|
{}, {1:1}, {a:1}, {1:1, 2:2}, Object.create(null),
|
2022-02-03 15:52:11 +00:00
|
|
|
obj_with_enum_cache,
|
2017-01-13 13:57:00 +00:00
|
|
|
[], [{}, {}], [1, 1, 1], [1.1, 1.1, 1.1, 1.1, 2], largeArray,
|
|
|
|
new Proxy({},{}),
|
|
|
|
new Date(), new String(" a"),
|
2017-04-06 09:41:59 +00:00
|
|
|
new Uint8Array(12), new Float32Array([1, 2, 4, 5]),
|
|
|
|
new Uint8ClampedArray(2048),
|
2017-01-13 13:57:00 +00:00
|
|
|
/asdf/, new RegExp(),
|
|
|
|
Object.create, Object, Array,
|
|
|
|
Symbol.iterator,
|
|
|
|
[][Symbol.iterator](),
|
|
|
|
new Map(), new Set(),
|
2017-04-06 09:41:59 +00:00
|
|
|
(new Map()).entries(), (new Set()).entries(),
|
|
|
|
sloppyArguments(), sloppyArguments(1, 2, 3, 4),
|
|
|
|
sloppyArguments2(), sloppyArguments2(1, 2, 3, 4),
|
|
|
|
slowSloppyArguments(), slowSloppyArguments(1, 2, 3, 4),
|
|
|
|
slowSloppyArguments2(), slowSloppyArguments2(1, 2, 3, 4),
|
2017-01-13 13:57:00 +00:00
|
|
|
|
|
|
|
];
|
|
|
|
for (var o of objects) %DebugPrint(o);
|
2022-02-03 15:52:11 +00:00
|
|
|
|
|
|
|
// Trigger some gcs to trigger heap and zone stats
|
|
|
|
for (let i = 0; i <= 4; i++) gc();
|