Skip to content

Commit eb7015f

Browse files
committed
perf: reduce direct native dispatch overhead
1 parent 060e835 commit eb7015f

11 files changed

Lines changed: 1077 additions & 356 deletions

File tree

NativeScript/ffi/EngineDirectCall.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
#include <cstddef>
55
#include <cstdint>
66

7+
#include <objc/objc.h>
8+
79
#include "MetadataReader.h"
810
#include "js_native_api.h"
911

1012
namespace nativescript {
1113

1214
using metagen::MDSectionOffset;
1315

16+
class CFunction;
17+
class Cif;
1418
class ObjCClassMember;
19+
struct MethodDescriptor;
1520

1621
enum class EngineDirectMemberKind : uint8_t {
1722
Method,
@@ -30,6 +35,19 @@ napi_value TryCallCFunctionEngineDirect(napi_env env, MDSectionOffset offset,
3035
const napi_value* rawArgs,
3136
bool* handled);
3237

38+
bool InvokeObjCMemberEngineDirectDynamic(napi_env env, Cif* cif, id self,
39+
bool receiverIsClass,
40+
MethodDescriptor* descriptor,
41+
uint8_t dispatchFlags,
42+
size_t actualArgc,
43+
const napi_value* rawArgs,
44+
void* rvalue);
45+
46+
bool InvokeCFunctionEngineDirectDynamic(napi_env env, CFunction* function,
47+
Cif* cif, size_t actualArgc,
48+
const napi_value* rawArgs,
49+
void* rvalue);
50+
3351
} // namespace nativescript
3452

3553
#endif // NS_ENGINE_DIRECT_CALL_H

0 commit comments

Comments
 (0)