MCPcopy Create free account
hub / github.com/Snapchat/Valdi / call_closure_callable

Function call_closure_callable

tsn/src/tsn/tsn.cpp:1372–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370static constexpr size_t kFrameMarginSizeBytes = 1024;
1371
1372js_force_inline JSValue call_closure_callable(tsn_vm* ctx,
1373 tsn_value_const func,
1374 tsn_value_const thisObject,
1375 int argc,
1376 tsn_value_const* argv,
1377 tsn_closure* closure) {
1378 JSStackFrame stackFrame;
1379 stackFrame.cur_func = (JSValue)func;
1380 stackFrame.arg_buf = nullptr;
1381 stackFrame.var_buf = nullptr;
1382 stackFrame.cur_pc = nullptr;
1383 stackFrame.arg_count = 0;
1384 stackFrame.js_mode = 0;
1385 stackFrame.cur_sp = nullptr;
1386
1387 if (JS_PushStackFrame_tsn(ctx, &stackFrame, kFrameMarginSizeBytes) != 0) {
1388 return JS_EXCEPTION;
1389 }
1390
1391 auto value = closure->callable(ctx, thisObject, &stackFrame, argc, argv, closure);
1392 JS_PopStackFrame_tsn(ctx, &stackFrame);
1393 return value;
1394}
1395
1396static JSValue __tsn_call_trampoline(
1397 JSContext* context, JSValueConst funcObject, JSValueConst thisValue, int argc, JSValueConst* argv, int flags) {

Callers 4

__tsn_call_trampolineFunction · 0.85
tsn_callFunction · 0.85
tsn_call_constructorFunction · 0.85
tsn_generator_nextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected