• Home
  • Raw
  • Download

Lines Matching full:to

9 * Transition from the interpeter to compiled code and vise versa  
17 Panda runtime as a set of functions aimed to execute managed code. The runtime consists of several …
18 The document refers to the interpreter and the compiler modules.
20 …rpreter is a part of the runtime aimed to execute bytecode of managed functions. The interpreter i…
23 The compiler is aimed to translate managed function's bytecode to native code. The compiler has an …
25 changes its entrypoint to newly generated code. Next time when the function gets called native code…
28 Panda runtime and managed code must call functions according to the target calling convention.
29 Compiled code of a managed function must accept one extra argumnent: the pointer to `panda::Method`…
36 - a pointer to `panda::Method` in the register R0.
48 | pending_exception_ | panda::ObjectHeader* | A pointer to a thrown exception or 0 if there is n…
52 ## Access to `panda::ManagedThread` from compiled code
53 There is an allocated register for each target architecture to store a pointer to `panda::ManagedTh…
54 must contains a valid pointer to `panda::ManagedThread` on entry to each compiled function.
57 …via runtime entrypoints. A runtime entrypoint is a function which conforms to the target calling c…
62 This document refers to the following fields of `panda::Method`:
73 Panda runtime provides a command line option to tune the hotness counter threshold: `--compiler-hot…
76 Entrypoint is a pointer to native code which can execute the function. This code must conform to th…
77 one extra argument: a pointer to `panda::Method` ( See [Calling convention](#calling_convention)).
79 In the case the function has compiled code the `compiled_entry_point_` must point to compiled code.…
80 In the case the function is executed by the interpreter the `compiled_entry_point_` must point to a…
83 A stack frame contains data necessary to execute the function the frame belongs to.
87 …decribed by `panda::Frame` class. The class has fields to store virtual registers and a pointer to
88 …zed into a linked list. The field `panda::Frame::prev_` contains a pointer to the previous interpr…
91 Each compiled function is responsible to reserve stack frame for its purpose and then release it wh…
94 When compiled code is executing the `stack pointer` register must point to a valid stack frame (new…
95 `frame pointer` register must point to correct place in the frame before the following operations:
100 … done by restoring values of `stack pointer` and `frame pointer` registers to the value they have …
135 - `panda::Method*` - a pointer to `panda::Method` which describes the called function.
136 - frame pointer - pointer to the previous frame. The value of `frame pointer` register at the momen…
137 - return address - address to which control will be transfered after the function gets returned.
140 `stack pointer` register contains a pointer to the last stack element.
141 `frame pointer` register contains a pointer to the place in the stack where the return address is s…
143 Panda contains special class for getting cframe layout: `class CFrameLayout`. Everything related to
147 To call a managed function compiled code must resolve it (i.e. retreive a pointer to callee's `pand…
148 prepare arguments in the registers and the stack (if necessary) and jump to callee's entrypoint.
156 // r0 contains a pointer to the current `panda::Method`
161 // r0 contains a pointer to `panada::Method` which describes `int max(int, int)` function.
162 // 2nd step: prepare arguments and entrypoint to call `int max(int, int)`
172 The Compiler have an entrypoints table. Each entrypoint contains a link to the Bridge Function.
173 The Bridge Functions are auto-generated for each runtime function to be called using the macro asse…
174 The Bridge Function sets up the Boundary Frame and performs the call to the actual runtime function.
176 To do a runtime call from compiled code the Compiler generates:
177 * putting callee saved (if need) and param holding (if any) register values to the stack
178 * (callee saved regisers goes to Bridge Function stack frame, caller saved registers goes to the cu…
185 * push the caller saved registers (except of registers holding function parameters) to the caller's…
186 * adjust Stack Pointer, and pass execution to the runtime function
208 + 16-byte alignment pad to the next frame +
211 ## Transition from the interpreter to compiled code
214 If the entrypoint points to `CompiledCodeToInterpreterBridge` then the callee should be executed by…
215 In other cases the interpreter calls the function `InterpreterToCompiledCodeBridge` passing to it t…
216 the call instruction, the interpreter's frame and the pointer to `panda::ManagedThread`.
220 * Set the pointer to `panda::ManagedThread` to the thread register.
221 * Change stack frame kind in `panda::ManagedThread::stack_frame_kind_` to compiled code stack frame…
222 * Prepare the arguments according to the target calling convention. The function uses the bytecode …
223 and interpreter's frame to retreive the function's arguments.
224 * Jump to the callee's entrypoint.
225 * After the return save the result to the interpreter stack frame.
226 * Change stack frame kind in `panda::ManagedThread::stack_frame_kind_` back to interpreter stack fr…
229 `InterpreterToCompiledCodeBridge`'s boundary stack frame is necessary to link the interpreter's fra…
237 d k | pointer to the |
248 Instead of pointer to `panda::Method` the frame contains constant `INTERPRETER_TO_COMPILED_CODE_BRI…
249 Frame pointer points to the previous interpreter frame.
251 ## Transition from compiled code to the interpreter
254 * Change stack frame kind in `panda::ManagedThread::stack_frame_kind_` to interpreter stack frame.
256 * Fill in the interpreter frame by the arguments passed to `CompiledCodeToInterpreterBridge` in the…
258 * Store the result in registers or in the stack according to the target calling convention.
260 * Change stack frame kind in `panda::ManagedThread::stack_frame_kind_` back to compiled code stack …
262 `CompiledCodeToInterpreterBridge`'s boundary stack frame is necessary to link the compiled code's f…
282 Instead of a pointer to `panda::Method` the frame contains constant `COMPILED_CODE_TO_INTERPRETER_B…
283 Frame pointer points to the previous frame in compiled code stack frame.
284 The field `panda::Frame::prev_` must point to the boundary frame pointer.
289 to the top frame could be determined depends on the kind of the top stack frame:
293 Having a pointer to the top stack frame, its kind and structure the runtime can move to the next fr…
294 Moving to the next frame is done according to the table below:
296 | Kind of the current stack frame | How to get a pointer to the next stack frame | Kind of the prev…
299 | INTERPRETER_TO_COMPILED_CODE_BRIDGE boundary stack frame | Read `pointer to the interpreter frame…
303 Thus the runtime can traverse all the managed stack frames moving from one frame to the previous fr…
307 …d from several managed functions (inlined functions). If the runtime needs to get information abou…
309 * Compiled code may save any callee-saved registers on the stack. Before moving to the next stack f…
310 To do that the runtime uses information about callee-saved registers stored on the stack. This info…
311 …k unwinding. For example, when GC moves an object, it must update all the references to the object.
355 d k | pointer to the | -+
378 `panda::ManagedThread::GetCurrentFrame()` method must return the pointer to `baz`'s interpreter sta…
379 To go to the previous frame the runtime reads the field `panda::Frame::prev_` which must point to `…
380 It means that to get `bar`'s stack frame the runtime must read `frame pointer` and the kind of the …
381 At this step the runtime has a pointer to `bar`'s compiled code stack frame. To go to the next fram…
382 …PILED_CODE_BRIDGE` boundary stack frame. To reach `foo`'s interpreter stack frame the runtime read…
386 For such cases compiled code must call `void Deoptimize()` runtime entrypoint to continue execution…
394 * Saves all the callee-saved registers to the stack
395 * Stores the pointer to the exception object to `panda::ManagedThread::pending_exception_`
396 * Unwind compiled code stack frames to find the corresponding exception handler by going from one s…
398 If the corresponding catch handler is found in the current stack frame the runtime jumps to the han…
400 …_BRIDGE boundary stack frame is reached the runtime returns to the interpreter letting it to handl…
401 Returning to the interpreter is performed as follow:
402 1. Determine the return address to the boundary frame. The return address is stored in the followin…
403 2. Set the pointer to the boundary frame into stack pointer, assign the return address determined a…
405 …frame then the runtime restores values of callee-saved registers and moves to the previous stack f…