Skip to content

Change MethodBindResult to a readonly ref struct #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

AnsisMalins
Copy link
Contributor

This change makes MethodBindResult a readonly ref struct to reduce of GC allocations when calling into JavaScript.

All unit tests passed, but there were 12 errors of the form

Exception thrown during bootstrapping
Extension or internal compilation error in Script at line 1.
Error installing extension 'v8/gc'.
Failing script:
    1: foo()

@AnsisMalins AnsisMalins changed the title Changed MethodBindResult to a readonly ref struct Change MethodBindResult to a readonly ref struct Dec 10, 2024
@ClearScriptLib ClearScriptLib self-assigned this Dec 11, 2024
@ClearScriptLib
Copy link
Collaborator

Hi @AnsisMalins,

This is a good change; thanks for contributing it. We're a bit concerned about the errors you mentioned, so we'll build your branch and take a look before merging.

Thanks again!

@ClearScriptLib ClearScriptLib merged commit 1d2800b into microsoft:master Dec 13, 2024
1 check passed
ClearScriptLib added a commit that referenced this pull request Mar 7, 2025
…; overhauled the codebase in favor of static lambdas; replaced most scope objects with ref structures; minimized boxing and structure copying on performance-critical code paths; eliminated the use of argument vectors for host calls with typical argument counts; [V8] added span support to array buffers and related types (GitHub Issue #632); [V8] enhanced task-promise interop with support for pre-settled promises and pre-completed tasks (GitHub Issue #641); [V8] added V8ScriptEngineFlags.EnableArrayConversion (GitHub Issue #634); [V8] fixed fast data transfer bounds checking for zero-length arrays and buffers (GitHub Issue #581); [V8] added import.meta.setResult to enable reliable module evaluation results; [V8] fixed MaxHeapSize and MaxRuntimeHeapSize behavior (GitHub Issue #571); incorporated Ansis Māliņš' conversion of MethodBindResult to a ref structure (GitHub PR #616); added promise state indicators to JavaScriptObjectFlags; fixed XMLDOM enumeration issue discussed in GitHub Issue #594; added sparse argument support to the reflection binder (GitHub Discussion #624); added ScriptEngine.NullImportValue (GitHub Issue #629); switched to XML for assembly table storage to eliminate security issues related to BinaryFormatter; updated API documentation. Tested with V8 13.3.415.23.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants