MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

deps/v8/test/mjsunit/compiler/osr-block-scope.js:27–48  ·  view source on GitHub ↗
(expected, func, depth)

Source from the content-addressed store, hash-verified

25}
26
27function test(expected, func, depth) {
28 %PrepareFunctionForOptimization(func);
29 assertEquals(expected, func());
30 %PrepareFunctionForOptimization(func);
31 assertEquals(expected, func());
32 %PrepareFunctionForOptimization(func);
33 assertEquals(expected, func());
34
35 var orig = func.toString();
36 var name = func.name;
37 for (var depth = 1; depth < 4; depth++) {
38 var body = nest(orig, name, depth);
39 func = eval("(" + body + ")");
40
41 %PrepareFunctionForOptimization(func);
42 assertEquals(expected, func());
43 %PrepareFunctionForOptimization(func);
44 assertEquals(expected, func());
45 %PrepareFunctionForOptimization(func);
46 assertEquals(expected, func());
47 }
48}
49
50function foo() {
51 var result;

Callers 1

osr-block-scope.jsFile · 0.70

Calls 5

nestFunction · 0.85
assertEqualsFunction · 0.70
funcFunction · 0.70
evalFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…