#include "cell.h" #include "pit_internal.h" JSC_CCALL(os_mem_limit, JS_SetMemoryLimit(JS_GetRuntime(js), js2number(js,argv[0]))) JSC_CCALL(os_max_stacksize, JS_SetMaxStackSize(js, js2number(js,argv[0]))) // TODO: Reimplement memory usage reporting for new allocator JSC_CCALL(os_calc_mem, ret = JS_NewObject(js); ) // TODO: Reimplement for register VM JSC_CCALL(js_disassemble, return JS_NewArray(js);) JSC_CCALL(js_fn_info, return JS_NewObject(js);) static const JSCFunctionListEntry js_js_funcs[] = { MIST_FUNC_DEF(os, calc_mem, 0), MIST_FUNC_DEF(os, mem_limit, 1), MIST_FUNC_DEF(os, max_stacksize, 1), MIST_FUNC_DEF(js, disassemble, 1), MIST_FUNC_DEF(js, fn_info, 1), }; JSValue js_core_js_use(JSContext *js) { JS_FRAME(js); JS_ROOT(mod, JS_NewObject(js)); JS_SetPropertyFunctionList(js, mod.val, js_js_funcs, countof(js_js_funcs)); JS_RETURN(mod.val); }