Change GlobalVar to GlobalValue
This commit is contained in:
committed by
Dan Gohman
parent
49cc693d64
commit
5c320a0d30
@@ -110,7 +110,7 @@ Program structure
|
||||
|
||||
In LLVM IR, the largest representable unit is the *module* which corresponds
|
||||
more or less to a C translation unit. It is a collection of functions and
|
||||
global variables that may contain references to external symbols too.
|
||||
global valueiables that may contain references to external symbols too.
|
||||
|
||||
In Cretonne IR, the largest representable unit is the *function*. This is so
|
||||
that functions can easily be compiled in parallel without worrying about
|
||||
|
||||
@@ -554,7 +554,7 @@ stack overflow checks in the prologue.
|
||||
the stack pointer has reached or exceeded the limit, generate a trap with a
|
||||
``stk_ovf`` code.
|
||||
|
||||
The global variable must be accessible and naturally aligned for a
|
||||
The global valueiable must be accessible and naturally aligned for a
|
||||
pointer-sized value.
|
||||
|
||||
Setting `stack_limit` is an alternative way to detect stack overflow, when using
|
||||
@@ -563,12 +563,12 @@ stack overflow checks in the prologue.
|
||||
Global variables
|
||||
----------------
|
||||
|
||||
A *global variable* is an :term:`accessible` object in memory whose address is
|
||||
A *global valueiable* is an :term:`accessible` object in memory whose address is
|
||||
not known at compile time. The address is computed at runtime by
|
||||
:inst:`global_addr`, possibly using information provided by the linker via
|
||||
relocations. There are multiple kinds of global variables using different
|
||||
:inst:`global_value`, possibly using information provided by the linker via
|
||||
relocations. There are multiple kinds of global valueiables using different
|
||||
methods for determining their address. Cretonne does not track the type or even
|
||||
the size of global variables, they are just pointers to non-stack memory.
|
||||
the size of global valueiables, they are just pointers to non-stack memory.
|
||||
|
||||
When Cretonne is generating code for a virtual machine environment, globals can
|
||||
be used to access data structures in the VM's runtime. This requires functions
|
||||
@@ -578,26 +578,26 @@ Cretonne functions.
|
||||
|
||||
.. inst:: GV = vmctx+Offset
|
||||
|
||||
Declare a global variable in the VM context struct.
|
||||
Declare a global valueiable in the VM context struct.
|
||||
|
||||
This declares a global variable whose address is a constant offset from the
|
||||
This declares a global valueiable whose address is a constant offset from the
|
||||
VM context pointer which is passed as a hidden argument to all functions
|
||||
JIT-compiled for the VM.
|
||||
|
||||
Typically, the VM context is a C struct, and the declared global variable
|
||||
Typically, the VM context is a C struct, and the declared global valueiable
|
||||
is a member of the struct.
|
||||
|
||||
:arg Offset: Byte offset from the VM context pointer to the global
|
||||
variable.
|
||||
:result GV: Global variable.
|
||||
|
||||
The address of a global variable can also be derived by treating another global
|
||||
The address of a global valueiable can also be derived by treating another global
|
||||
variable as a struct pointer. This makes it possible to chase pointers into VM
|
||||
runtime data structures.
|
||||
|
||||
.. inst:: GV = deref(BaseGV)+Offset
|
||||
|
||||
Declare a global variable in a struct pointed to by BaseGV.
|
||||
Declare a global valueiable in a struct pointed to by BaseGV.
|
||||
|
||||
The address of GV can be computed by first loading a pointer from BaseGV
|
||||
and adding Offset to it.
|
||||
@@ -605,7 +605,7 @@ runtime data structures.
|
||||
It is assumed the BaseGV resides in readable memory with the appropriate
|
||||
alignment for storing a pointer.
|
||||
|
||||
Chains of ``deref`` global variables are possible, but cycles are not
|
||||
Chains of ``deref`` global valueiables are possible, but cycles are not
|
||||
allowed. They will be caught by the IR verifier.
|
||||
|
||||
:arg BaseGV: Global variable containing the base pointer.
|
||||
@@ -615,7 +615,7 @@ runtime data structures.
|
||||
|
||||
.. inst:: GV = [colocated] globalsym name
|
||||
|
||||
Declare a global variable at a symbolic address.
|
||||
Declare a global valueiable at a symbolic address.
|
||||
|
||||
The address of GV is symbolic and will be assigned a relocation, so that
|
||||
it can be resolved by a later linking phase.
|
||||
@@ -627,7 +627,7 @@ runtime data structures.
|
||||
:arg name: External name.
|
||||
:result GV: Global variable.
|
||||
|
||||
.. autoinst:: global_addr
|
||||
.. autoinst:: global_value
|
||||
.. autoinst:: globalsym_addr
|
||||
|
||||
|
||||
@@ -701,7 +701,7 @@ trap when accessed.
|
||||
address space reserved for the heap, not including the guard pages.
|
||||
:arg GuardBytes: Size of the guard pages in bytes.
|
||||
|
||||
When the base is a global variable, it must be :term:`accessible` and naturally
|
||||
When the base is a global valueiable, it must be :term:`accessible` and naturally
|
||||
aligned for a pointer value.
|
||||
|
||||
The ``reserved_reg`` option is not yet implemented.
|
||||
@@ -711,7 +711,7 @@ Dynamic heaps
|
||||
|
||||
A *dynamic heap* can be relocated to a different base address when it is
|
||||
resized, and its bound can move dynamically. The guard pages move when the heap
|
||||
is resized. The bound of a dynamic heap is stored in a global variable.
|
||||
is resized. The bound of a dynamic heap is stored in a global valueiable.
|
||||
|
||||
.. inst:: H = dynamic Base, min MinBytes, bound BoundGV, guard GuardBytes
|
||||
|
||||
@@ -724,7 +724,7 @@ is resized. The bound of a dynamic heap is stored in a global variable.
|
||||
:arg BoundGV: Global variable containing the current heap bound in bytes.
|
||||
:arg GuardBytes: Size of the guard pages in bytes.
|
||||
|
||||
When the base is a global variable, it must be :term:`accessible` and naturally
|
||||
When the base is a global valueiable, it must be :term:`accessible` and naturally
|
||||
aligned for a pointer value.
|
||||
|
||||
The ``reserved_reg`` option is not yet implemented.
|
||||
|
||||
@@ -15,7 +15,7 @@ The meta language descriptions are Python modules under the
|
||||
steps:
|
||||
|
||||
1. The Python modules are imported. This has the effect of building static data
|
||||
structures in global variables in the modules. These static data structures
|
||||
structures in global valueiables in the modules. These static data structures
|
||||
in the :mod:`base` and :mod:`isa` packages use the classes in the
|
||||
:mod:`cdsl` package to describe instruction sets and other properties.
|
||||
|
||||
@@ -81,7 +81,7 @@ open :class:`InstructionGroup`.
|
||||
:members:
|
||||
|
||||
The basic Cretonne instruction set described in :doc:`langref` is defined by the
|
||||
Python module :mod:`base.instructions`. This module has a global variable
|
||||
Python module :mod:`base.instructions`. This module has a global valueiable
|
||||
:data:`base.instructions.GROUP` which is an :class:`InstructionGroup` instance
|
||||
containing all the base instructions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user