Lines Matching full:compiled
1 # Interaction of compiled code and the runtime
5 Compiled code and Panda runtime interact with each other during execution. This document describes …
8 * Structure of compiled code stack frames and stack traversing
9 * Transition from the interpreter to compiled code and vice versa
22 `panda::CompilerInterface::CompileMethodSync` for compilation. When a function is compiled, the com…
27 Compiled code of a managed function must accept one extra argument: the pointer to `panda::Method` …
41 `panda::ManagedThread` has the following fields that compiled code may use:
48 | stack_frame_kind_ | StackFrameKind | A kind of the current stack frame (compiled code o…
50 ## Access to `panda::ManagedThread` from compiled code
52 must contain a valid pointer to `panda::ManagedThread` on entry to each compiled function.
55 Runtime serves compiled code via runtime entrypoints. A runtime entrypoint is a function which conf…
76 The managed function may have compiled code or be executed by the interpreter.
77 If the function has compiled code the `compiled_entry_point_` must point to compiled code.
82 …mes of managed code must have the structure described in [Compiled code stack frame](#compiled-cod…
86 …ld `panda::Frame::prev_` contains a pointer to the previous interpreter (or compiled bridge) frame.
88 ### Compiled code stack frame
89 Each compiled function is responsible for reserving stack frame for its purpose and then release it…
90 Generally compiled function builds the stack frame in prolog and releases it in epilog. If a compil…
92 When compiled code is being executed the `stack pointer` register must point to a valid stack frame…
100 Compiled code stack frames of caller and callee must be continuous in the stack i.e. the callee's s…
102 A compiled code stack frame must have the following structure:
144 ## Calling a function from compiled code
145 To call a managed function, the compiled code must resolve it (i.e. retrieve a pointer to callee's …
150 Calling `int max(int a, int b)` function from compiled code on ARM architecture with arguments `2` …
169 ## Calling a function from compiled code: Bridge function
174 To do a runtime call from compiled code the compiler generates:
209 ## Transition from the interpreter to compiled code
219 * Changes stack frame kind in `panda::ManagedThread::stack_frame_kind_` to compiled code stack fram…
227 …s boundary stack frame is necessary to link the interpreter's frame with the compiled code's frame.
245 The structure of boundary frame is the same as a stack frame of compiled code.
249 ## Transition from compiled code to the interpreter
258 * Changes stack frame kind in `panda::ManagedThread::stack_frame_kind_` back to compiled code stack…
260 `CompiledCodeToInterpreterBridge`'s boundary stack frame is necessary to link the compiled code's f…
279 The structure of boundary frame is the same as a stack frame of compiled code.
281 Frame pointer points to the previous frame in compiled code stack frame.
289 * If the top stack frame is a compiled code stack frame, `frame pointer` register contains the addr…
298 …TER_BRIDGE boundary stack frame | Read `frame pointer` from the stack | Compiled code stack frame |
299 | Compiled code stack frame | Read `frame pointer` | Compiled code stack frame or INTERPRETER_TO_CO…
305 * Compiled code could be combined from several managed functions (inlined functions). If the runtim…
306 during handling a compiled code stack frame, it uses meta information generated by the compiler.
307 * Compiled code may save any callee-saved registers on the stack. Before moving to the next stack f…
317 (interpreted) (compiled) (interpreted)
319 Functions `foo` and `baz` are executed by the interpreter and the function `bar` has compiled code.
378 …the runtime must read `frame pointer` and the kind of the next frame will be compiled code's frame.
379 At this step the runtime has a pointer to `bar`'s compiled code stack frame. To go to the next fram…
383 There may be a situation when compiled code cannot continue execution for some reason.
384 …es compiled code must call `void Deoptimize()` runtime entrypoint to continue execution of the met…
386 When compiled code is combined from several managed functions (inlined functions) `Deoptimize` reco…
390 Throwing an exception from compiled code is performed by calling the runtime entrypoint `void Throw…
394 * Unwinds compiled code stack frames to find the corresponding exception handler by going from one …
400 …ess to the boundary frame. The return address is stored in the following compiled code stack frame.
407 Finding a catch handler in a compiled code stack frame is performed according meta information gene…