MCPcopy Create free account
hub / github.com/Snapchat/Valdi / operator()

Method operator()

valdi_core/src/valdi_core/jni/ValueFunctionWithJavaFunction.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11ValueFunctionWithJavaFunction::~ValueFunctionWithJavaFunction() = default;
12
13Valdi::Value ValueFunctionWithJavaFunction::operator()(const Valdi::ValueFunctionCallContext& callContext) noexcept {
14 Valdi::Marshaller marshaller(callContext.getExceptionTracker());
15 for (size_t i = 0; i < callContext.getParametersSize(); i++) {
16 marshaller.push(callContext.getParameters()[i]);
17 }
18
19 ValdiFunctionType functionObject(JavaEnv(), get());
20
21 VALDI_TRACE("Valdi.callJavaFunction");
22 JavaEnv::getCache().getValdiFunctionNativePerformFromNativeMethod().call(
23 JavaEnv::getCache().getValdiFunctionNativeClass().getClass(),
24 functionObject,
25 reinterpret_cast<int64_t>(&marshaller));
26
27 if (!callContext.getExceptionTracker()) {
28 return Valdi::Value::undefined();
29 } else {
30 return marshaller.getOrUndefined(-1);
31 }
32}
33
34std::string_view ValueFunctionWithJavaFunction::getFunctionType() const {
35 return "Java";

Callers

nothing calls this directly

Calls 8

getOrUndefinedMethod · 0.80
JavaEnvClass · 0.70
callMethod · 0.65
getFunction · 0.50
getParametersSizeMethod · 0.45
pushMethod · 0.45
getParametersMethod · 0.45
getClassMethod · 0.45

Tested by

no test coverage detected