|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
One value stored in bytecode registers, locals, or globals. More...
#include <Bytecode_Interpreter.H>
Public Member Functions | |
| bool | is_invalid () const noexcept |
| Returns whether this value is invalid. | |
| bool | is_runtime_value () const noexcept |
Returns whether this value wraps an Interpreter_Value. | |
| bool | is_function_ref () const noexcept |
| Returns whether this value is a bytecode function reference. | |
Public Attributes | |
| Compiler_Bytecode_Value_Kind | kind = Compiler_Bytecode_Value_Kind::Invalid |
| Active payload category. | |
| Interpreter_Value | runtime_value = Interpreter_Value::make_invalid() |
| Wrapped scalar/tuple/host-function value. | |
| Compiler_Bytecode_Function_Id | function_id = compiler_bytecode_invalid_id() |
Referenced bytecode function when kind == Function_Ref. | |
One value stored in bytecode registers, locals, or globals.
The VM reuses Interpreter_Value for ordinary runtime data such as integers, booleans, strings, tuples, or host functions. Bytecode function references remain separate so the VM never confuses bytecode callables with HIR function values.
Definition at line 129 of file Bytecode_Interpreter.H.
|
inlinenoexcept |
Returns whether this value is a bytecode function reference.
Definition at line 238 of file Bytecode_Interpreter.H.
References Aleph::Function_Ref, and kind.
Referenced by Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinenoexcept |
Returns whether this value is invalid.
Definition at line 224 of file Bytecode_Interpreter.H.
References Aleph::Invalid, and kind.
|
inlinenoexcept |
Returns whether this value wraps an Interpreter_Value.
Definition at line 231 of file Bytecode_Interpreter.H.
References kind, and Aleph::Value.
Referenced by Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinestatic |
Builds a boolean runtime value.
Definition at line 171 of file Bytecode_Interpreter.H.
References Aleph::Interpreter_Value::make_bool(), make_value(), and value.
Referenced by Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value(), Aleph::Compiler_Bytecode_VM::execute_loop(), main(), and TEST().
|
inlinestatic |
Builds a character runtime value.
Definition at line 192 of file Bytecode_Interpreter.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::Interpreter_Value::make_character(), and make_value().
Referenced by Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value().
|
inlinestatic |
Builds a reference to one bytecode function in the current module.
Definition at line 214 of file Bytecode_Interpreter.H.
References function_id, Aleph::Function_Ref, and kind.
Referenced by Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinestatic |
Builds a callable value backed by host code.
This is useful for embeddings that want to expose helper functions to bytecode by preloading globals before execution.
Definition at line 203 of file Bytecode_Interpreter.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::Interpreter_Value::make_host_function(), and make_value().
|
inlinestatic |
Builds an integer runtime value.
Definition at line 178 of file Bytecode_Interpreter.H.
References Aleph::Interpreter_Value::make_integer(), make_value(), and value.
Referenced by Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value(), and Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinestatic |
Builds an invalid placeholder value.
Definition at line 137 of file Bytecode_Interpreter.H.
Referenced by Aleph::Compiler_Bytecode_Execution_Result::runtime_error().
|
inlinestatic |
Builds a string runtime value.
Definition at line 185 of file Bytecode_Interpreter.H.
References Aleph::Interpreter_Value::make_string(), and make_value().
Referenced by Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value().
|
inlinestatic |
Builds the Unit singleton.
Definition at line 164 of file Bytecode_Interpreter.H.
References Aleph::Interpreter_Value::make_unit(), and make_value().
Referenced by Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value(), and Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinestatic |
Wraps one regular runtime value.
Definition at line 144 of file Bytecode_Interpreter.H.
References kind, runtime_value, Aleph::Value, and value.
Referenced by Aleph::Compiler_Bytecode_VM::execute_host_call(), make_bool(), make_character(), make_host_function(), make_integer(), make_string(), and make_unit().
|
inlinestatic |
Wraps one regular runtime value by move.
Definition at line 154 of file Bytecode_Interpreter.H.
References kind, runtime_value, Aleph::Value, and value.
| Compiler_Bytecode_Function_Id Aleph::Compiler_Bytecode_Value::function_id = compiler_bytecode_invalid_id() |
Referenced bytecode function when kind == Function_Ref.
Definition at line 133 of file Bytecode_Interpreter.H.
Referenced by Aleph::compiler_bytecode_values_equal(), Aleph::Compiler_Bytecode_VM::execute_loop(), and make_function_ref().
| Compiler_Bytecode_Value_Kind Aleph::Compiler_Bytecode_Value::kind = Compiler_Bytecode_Value_Kind::Invalid |
Active payload category.
Definition at line 131 of file Bytecode_Interpreter.H.
Referenced by Aleph::compiler_bytecode_values_equal(), is_function_ref(), is_invalid(), is_runtime_value(), make_function_ref(), make_value(), and make_value().
| Interpreter_Value Aleph::Compiler_Bytecode_Value::runtime_value = Interpreter_Value::make_invalid() |
Wrapped scalar/tuple/host-function value.
Definition at line 132 of file Bytecode_Interpreter.H.
Referenced by Aleph::compiler_bytecode_values_equal(), Aleph::Compiler_Bytecode_VM::execute_host_call(), Aleph::Compiler_Bytecode_VM::execute_loop(), make_value(), and make_value().