forked from ocaml/ocaml
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flambda-backend: To upstream: fix dependency problem with Instruct
- Loading branch information
Showing
8 changed files
with
117 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
(**************************************************************************) | ||
(* *) | ||
(* OCaml *) | ||
(* *) | ||
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) | ||
(* *) | ||
(* Copyright 1996 Institut National de Recherche en Informatique et *) | ||
(* en Automatique. *) | ||
(* *) | ||
(* All rights reserved. This file is distributed under the terms of *) | ||
(* the GNU Lesser General Public License version 2.1, with the *) | ||
(* special exception on linking described in the file LICENSE. *) | ||
(* *) | ||
(**************************************************************************) | ||
|
||
(* Structure of compilation environments *) | ||
|
||
type compilation_env = | ||
{ ce_stack: int Ident.tbl; (* Positions of variables in the stack *) | ||
ce_heap: int Ident.tbl; (* Structure of the heap-allocated env *) | ||
ce_rec: int Ident.tbl } (* Functions bound by the same let rec *) | ||
|
||
(* The ce_stack component gives locations of variables residing | ||
in the stack. The locations are offsets w.r.t. the origin of the | ||
stack frame. | ||
The ce_heap component gives the positions of variables residing in the | ||
heap-allocated environment. | ||
The ce_rec component associates offsets to identifiers for functions | ||
bound by the same let rec as the current function. The offsets | ||
are used by the OFFSETCLOSURE instruction to recover the closure | ||
pointer of the desired function from the env register (which | ||
points to the closure for the current function). *) | ||
|
||
(* Debugging events *) | ||
|
||
(* Warning: when you change these types, check runtime/backtrace_byt.c *) | ||
type debug_event = | ||
{ mutable ev_pos: int; (* Position in bytecode *) | ||
ev_module: string; (* Name of defining module *) | ||
ev_loc: Location.t; (* Location in source file *) | ||
ev_kind: debug_event_kind; (* Before/after event *) | ||
ev_defname: string; (* Enclosing definition *) | ||
ev_info: debug_event_info; (* Extra information *) | ||
ev_typenv: Env.summary; (* Typing environment *) | ||
ev_typsubst: Subst.t; (* Substitution over types *) | ||
ev_compenv: compilation_env; (* Compilation environment *) | ||
ev_stacksize: int; (* Size of stack frame *) | ||
ev_repr: debug_event_repr } (* Position of the representative *) | ||
|
||
and debug_event_kind = | ||
Event_before | ||
| Event_after of Types.type_expr | ||
| Event_pseudo | ||
|
||
and debug_event_info = | ||
Event_function | ||
| Event_return of int | ||
| Event_other | ||
|
||
and debug_event_repr = | ||
Event_none | ||
| Event_parent of int ref | ||
| Event_child of int ref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters