MCPcopy Create free account
hub / github.com/nodejs/node / test

Function test

deps/v8/test/mjsunit/constant-folding-2.js:32–45  ·  view source on GitHub ↗
(f, iterations)

Source from the content-addressed store, hash-verified

30// Flags: --no-stress-flush-code --no-lazy-feedback-allocation
31
32function test(f, iterations) {
33 %PrepareFunctionForOptimization(f);
34 f();
35 f();
36 // Some of the tests need to learn until they stabilize.
37 let n = iterations ? iterations : 1;
38 for (let i = 0; i < n; i++) {
39 %OptimizeFunctionOnNextCall(f);
40 f();
41 %PrepareFunctionForOptimization(f);
42 }
43 // Assert that the function finally stabilized.
44 assertOptimized(f);
45}
46
47test(function add() {
48 assertEquals(2, 1 + 1);

Callers 1

Calls 1

fFunction · 0.70

Tested by

no test coverage detected