Repository navigation
perf(win32): prepared call descriptors and register-based dispatch - #52
Merged
Merged
Conversation
Ports the linux-runtime Win32 call path. win32_call.rs parses a signature once into a prepared descriptor and calls through the argument registers (up to 8 args on the fast API). define() binds every function up front; bind() locks a function's types in from its first call. Applies to the classic engine and napi. Adds NSWIN_V8_FLAGS and packages/demo/win32-bench.js.
Pre-merge checks:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
win32_call.rs: a signature is parsed once into a cached descriptor (address, argument kinds, libffi cif). Up to 8 arguments go straight through the argument registers on x64 and arm64; longer signatures use libffi.define()returns V8 fast API functions;bind()locks a function's argument types in on its first call. Fast calls convert numbers, bools, null, BigInts, ArrayBuffers and strings without a handle scope.__nsWin32Bind;define()andbind()use it the same way.NSWIN_V8_FLAGSpasses extra V8 flags (e.g.--trace-deopt) on the classic engine.packages/demo/win32-bench.jsmeasures call overhead on every engine.Tests: new
win32_define_bound_functions,win32_bind_locks_argument_typesandwin32_pointer_argument_rejects_plain_objectsintegration tests;windows-napi/test/win32-test.jscovers floats, stack arguments, lock-in and errors.