// clang-format off staticconst JSFunctionSpecWithHelp unwind_functions[] = {
JS_FN_HELP("something", Something, 0, 0, "something()", " Test function for test-unwind."),
JS_FS_HELP_END
}; // clang-format on
FRAGMENT(unwind, simple) { usingnamespace JS;
JS::Rooted<JSObject*> global(cx, JS::CurrentGlobalOrNull(cx)); if (!JS_DefineFunctionsWithHelp(cx, global, unwind_functions)) { return;
}
// Define an itercount property and use it to ensure Baseline compilation.
uint32_t threshold = js::jit::JitOptions.baselineJitWarmUpThreshold;
RootedValue val(cx, Int32Value(threshold + 10)); if (!JS_DefineProperty(cx, global, "itercount", val, 0)) { return;
}
int line0 = __LINE__; constchar* bytes = "\n" "function unwindFunctionInner() {\n" " for (var i = 0; i < itercount; i++) {}\n" " return something();\n" "}\n" "\n" "function unwindFunctionOuter() {\n" " for (var i = 0; i < itercount; i++) {}\n" " return unwindFunctionInner();\n" "}\n" "\n" "unwindFunctionOuter();\n";
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.