-
Notifications
You must be signed in to change notification settings - Fork 6
JIT Compilation: Fast: x86_64 (TD)
This page describes the implementation of the fast JIT compiler for the x84_64.
There are two types of calling conventions: for JIT generated methods and for interop methods.
The calling convention for JIT generated methods is as follows:
-
[0] globals: A pointer to the global data (see JIT Compilation (TD)), -
[1] argc: The number of arguments provided to the function; -
[2] args: A pointer to the arguments provided to the function with the following layout:-
[0] return: Allocated space for the return value; -
[1] this: The this value; -
[2] function: The function being called; -
[3..args + 3] arguments: The arguments to the function.
-
The result of a function is a Boolean specifying whether the function completed successfully. If this is set to false, the exception in flight will be assigned to the global data.
Interop methods are methods that expose standard functionality like e.g. JsEnv::add. These methods wrap methods on JsEnv so that this functionality can be used in JIT generated methods.
These methods have the following calling convention:
-
[0] globals: A pointer to the global data (see JIT Compilation (TD)), -
[1] argc: The number of arguments provided to the function; -
[2] args: A pointer to the arguments provided to the function with the following layout:-
[0..args] arguments: The arguments to the function.
-
The first position of the args array is also used for the return value. This means that when argc is 0, the length of the args array is still one to accommodate the return value.
The result of a function is a Boolean specifying whether the function completed successfully. If this is set to false, the exception in flight will be assigned to the global data.