{"ScriptPreparationCode":"const data = [\u0022hello\u0022, \u0022 \u0022, \u0022world\u0022, \u0022!\u0022];\r\nvar dep1 = { id: 0 };\r\nvar dep2 = { id: 1 };\r\nvar dep3 = { id: 2 };\r\nvar dep4 = { id: 3 };\r\nvar deps1 = [dep1];\r\nvar deps2 = [dep1, dep2];\r\nvar deps3 = [dep1, dep2, dep3];\r\nvar deps4 = [dep1, dep2, dep3, dep4];\r\n\r\nfunction sample1(_0) {\r\n return _0;\r\n}\r\n\r\nfunction sample2(_0, _1) {\r\n return _0 \u002B _1;\r\n}\r\n\r\nfunction sample3(_0, _1, _2) {\r\n return _0 \u002B _1 \u002B _2;\r\n}\r\n\r\nfunction sample4(_0, _1, _2, _3) {\r\n return _0 \u002B _1 \u002B _2 \u002B _3;\r\n}\r\n\r\nvar sampleApply1 = createApplyComputation(sample1, deps1);\r\nvar sampleApply2 = createApplyComputation(sample2, deps2);\r\nvar sampleApply3 = createApplyComputation(sample3, deps3);\r\nvar sampleApply4 = createApplyComputation(sample4, deps4);\r\nvar sampleSingle1 = createSingleComputation(sample1, dep1, true);\r\nvar sampleSingle2 = createSingleComputation(sample2, deps2);\r\nvar sampleSingle3 = createSingleComputation(sample3, deps3);\r\nvar sampleSingle4 = createSingleComputation(sample4, deps4);\r\nvar sampleDeopt1 = createDeoptComputation(sample1, deps1);\r\nvar sampleDeopt2 = createDeoptComputation(sample2, deps2);\r\nvar sampleDeopt3 = createDeoptComputation(sample3, deps3);\r\nvar sampleDeopt4 = createDeoptComputation(sample4, deps4);\r\n\r\nfunction createDeoptComputation(fn, deps) {\r\n return () =\u003E fn(...deps.map(read));\r\n}\r\n\r\nfunction createApplyComputation(fn, deps) {\r\n switch (deps.length) {\r\n case 1:\r\n return () =\u003E fn(read(deps[0]));\r\n case 2:\r\n return () =\u003E fn(read(deps[0]), read(deps[1]));\r\n case 3:\r\n return () =\u003E fn(read(deps[0]), read(deps[1]), read(deps[2]));\r\n default:\r\n return () =\u003E fn(...deps.map(read));\r\n }\r\n}\r\n\r\nfunction createSingleComputation(fn, deps, isSingle) {\r\n if (isSingle) {\r\n return () =\u003E fn(read(deps));\r\n } else {\r\n return () =\u003E fn(...deps.map(read));\r\n }\r\n}\r\n\r\nfunction read(s) {\r\n return data[s.id];\r\n}","TestCases":[{"Name":"apply exec 1","Code":"sampleApply1();","IsDeferred":false},{"Name":"deopt create 2","Code":"createDeoptComputation(sample2, [dep1, dep2])();","IsDeferred":false},{"Name":"deopt create 1","Code":"createDeoptComputation(sample1, [dep1])();","IsDeferred":false},{"Name":"deopt exec 4","Code":"sampleDeopt4();","IsDeferred":false},{"Name":"deopt exec 3","Code":"sampleDeopt3();","IsDeferred":false},{"Name":"deopt exec 2","Code":"sampleDeopt2();","IsDeferred":false},{"Name":"deopt exec 1","Code":"sampleDeopt1();","IsDeferred":false},{"Name":"single create 4","Code":"createSingleComputation(sample4, [dep1, dep2, dep3, dep4])();","IsDeferred":false},{"Name":"single create 3","Code":"createSingleComputation(sample3, [dep1, dep2, dep3])();","IsDeferred":false},{"Name":"single create 2","Code":"createSingleComputation(sample2, [dep1, dep2])();","IsDeferred":false},{"Name":"single create 1","Code":"createSingleComputation(sample1, dep1, true)();","IsDeferred":false},{"Name":"apply create 4","Code":"createApplyComputation(sample4, [dep1, dep2, dep3, dep4])();","IsDeferred":false},{"Name":"apply create 3","Code":"createApplyComputation(sample3, [dep1, dep2, dep3])();","IsDeferred":false},{"Name":"apply create 2","Code":"createApplyComputation(sample2, [dep1, dep2])();","IsDeferred":false},{"Name":"apply create 1","Code":"createApplyComputation(sample1, [dep1])();","IsDeferred":false},{"Name":"single exec 4","Code":"sampleSingle4();","IsDeferred":false},{"Name":"single exec 3","Code":"sampleSingle3();","IsDeferred":false},{"Name":"single exec 2","Code":"sampleSingle2();","IsDeferred":false},{"Name":"single exec 1","Code":"sampleSingle1();","IsDeferred":false},{"Name":"apply exec 4","Code":"sampleApply4();","IsDeferred":false},{"Name":"apply exec 3","Code":"sampleApply3();","IsDeferred":false},{"Name":"apply exec 2","Code":"sampleApply2();","IsDeferred":false},{"Name":"deopt create 3","Code":"createDeoptComputation(sample3, [dep1, dep2, dep3])();","IsDeferred":false},{"Name":"deopt create 4","Code":"createDeoptComputation(sample4, [dep1, dep2, dep3, dep4])();","IsDeferred":false}]}