Closed Bug 1890513 Opened 1 month ago Closed 1 month ago

Directly call native functions instead using InvokeNativeFunction

Categories

(Core :: JavaScript Engine: JIT, task, P3)

task

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

:jandem mentioned during code review that InvokeNativeFunction from bug 1889091 can be replaced with a direct call to the native C++ function.

CodeGenerator.cpp:
Split emitCallNative into two methods, so we can reuse it for emitApplyNative.
Also add some comments how NativeExitFrameLayout is constructed on the stack and
add an assertion that the native C++ function returned an object when constructing.
emitCallNative uses setupAlignedABICall, so we now need to align the Value
arguments, this happens through the new emitAlignStackForApplyNative method.

LIR-shared.h, Lowering.cpp:
The callee doesn't need to be stored which frees up one register, so we can
allocate an additional temp-register. This matches the approach taken for
LCallNative. The additional temp register is needed, because emitCallNative
requires four registers.

VMFunctions:

  • Remove no longer used InvokeNativeFunction.
Severity: -- → N/A
Priority: -- → P3
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/02ac150e8da3
Directly invoke variadic native functions. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Regressions: 1891688
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: