2020-04-14 19:56:54 +03:00
|
|
|
[BytecodeModule::] Bytecode Module.
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
Setting up the use of this module.
|
|
|
|
|
2022-05-17 09:46:35 +03:00
|
|
|
@ This section simply sets up the module in ways expected by //foundation//, and
|
2020-03-28 17:00:33 +02:00
|
|
|
contains no code of interest. The following constant exists only in tools
|
|
|
|
which use this module:
|
2019-02-05 02:44:07 +02:00
|
|
|
|
2020-04-14 19:56:54 +03:00
|
|
|
@d BYTECODE_MODULE TRUE
|
2019-02-05 02:44:07 +02:00
|
|
|
|
2020-05-09 18:25:04 +03:00
|
|
|
@ This module defines the following classes:
|
2019-02-05 02:44:07 +02:00
|
|
|
|
2020-05-09 15:07:39 +03:00
|
|
|
@e inter_tree_CLASS
|
2020-05-09 16:15:42 +03:00
|
|
|
@e inter_tree_node_CLASS
|
2020-05-09 15:07:39 +03:00
|
|
|
@e inter_warehouse_CLASS
|
|
|
|
@e inter_warehouse_room_CLASS
|
|
|
|
@e inter_symbols_table_CLASS
|
2020-05-09 16:15:42 +03:00
|
|
|
@e inter_symbol_CLASS
|
|
|
|
@e inter_annotation_CLASS
|
2020-05-09 15:07:39 +03:00
|
|
|
@e inter_construct_CLASS
|
|
|
|
@e inter_annotation_form_CLASS
|
|
|
|
@e inter_error_message_CLASS
|
|
|
|
@e inter_error_stash_CLASS
|
|
|
|
@e inter_package_CLASS
|
|
|
|
@e inter_node_list_CLASS
|
2022-02-03 01:35:38 +02:00
|
|
|
@e inter_node_array_CLASS
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
=
|
2020-05-09 15:07:39 +03:00
|
|
|
DECLARE_CLASS(inter_tree)
|
|
|
|
DECLARE_CLASS(inter_warehouse)
|
|
|
|
DECLARE_CLASS(inter_warehouse_room)
|
|
|
|
DECLARE_CLASS(inter_symbols_table)
|
|
|
|
DECLARE_CLASS(inter_construct)
|
|
|
|
DECLARE_CLASS(inter_annotation_form)
|
|
|
|
DECLARE_CLASS(inter_error_message)
|
|
|
|
DECLARE_CLASS(inter_package)
|
|
|
|
DECLARE_CLASS(inter_node_list)
|
2022-02-03 01:35:38 +02:00
|
|
|
DECLARE_CLASS(inter_node_array)
|
2022-03-24 12:53:32 +02:00
|
|
|
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_error_stash, 1024)
|
2020-05-09 15:07:39 +03:00
|
|
|
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_symbol, 1024)
|
|
|
|
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_tree_node, 8192)
|
|
|
|
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_annotation, 8192)
|
2019-02-05 02:44:07 +02:00
|
|
|
|
2020-03-28 17:00:33 +02:00
|
|
|
@ Like all modules, this one must define a |start| and |end| function:
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
=
|
2020-04-14 19:56:54 +03:00
|
|
|
void BytecodeModule::start(void) {
|
2019-02-05 02:44:07 +02:00
|
|
|
@<Register this module's memory allocation reasons@>;
|
|
|
|
@<Register this module's stream writers@>;
|
|
|
|
@<Register this module's debugging log aspects@>;
|
|
|
|
@<Register this module's debugging log writers@>;
|
|
|
|
|
2022-03-01 02:41:22 +02:00
|
|
|
InterInstruction::create_language();
|
2022-02-21 15:05:50 +02:00
|
|
|
InterTypes::initialise_constructors();
|
2019-02-05 02:44:07 +02:00
|
|
|
}
|
2020-04-14 19:56:54 +03:00
|
|
|
void BytecodeModule::end(void) {
|
2020-03-28 17:00:33 +02:00
|
|
|
}
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@
|
|
|
|
|
|
|
|
@e INTER_SYMBOLS_MREASON
|
|
|
|
@e INTER_BYTECODE_MREASON
|
|
|
|
@e INTER_LINKS_MREASON
|
2021-04-25 15:23:45 +03:00
|
|
|
@e TREE_LIST_MREASON
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's memory allocation reasons@> =
|
|
|
|
Memory::reason_name(INTER_SYMBOLS_MREASON, "inter symbols storage");
|
|
|
|
Memory::reason_name(INTER_BYTECODE_MREASON, "inter bytecode storage");
|
|
|
|
Memory::reason_name(INTER_LINKS_MREASON, "inter links storage");
|
2021-04-25 15:23:45 +03:00
|
|
|
Memory::reason_name(TREE_LIST_MREASON, "inter tree location list storage");
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's stream writers@> =
|
2022-02-10 01:48:51 +02:00
|
|
|
Writers::register_writer('t', &TextualInter::writer);
|
2022-03-01 02:41:22 +02:00
|
|
|
Writers::register_writer('F', &InterInstruction::instruction_writer);
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@
|
|
|
|
|
|
|
|
@e INTER_FILE_READ_DA
|
|
|
|
@e INTER_MEMORY_DA
|
|
|
|
@e INTER_BINARY_DA
|
|
|
|
@e INTER_SYMBOLS_DA
|
2019-09-01 13:50:12 +03:00
|
|
|
@e INTER_CONNECTORS_DA
|
2021-09-26 13:01:13 +03:00
|
|
|
@e CONSTANT_DEPTH_CALCULATION_DA
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's debugging log aspects@> =
|
2023-09-05 10:36:51 +03:00
|
|
|
Log::declare_aspect(INTER_MEMORY_DA, U"inter memory usage", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(INTER_FILE_READ_DA, U"intermediate file reading", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(INTER_BINARY_DA, U"inter binary", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(INTER_SYMBOLS_DA, U"inter symbols", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(INTER_CONNECTORS_DA, U"inter connectors", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(CONSTANT_DEPTH_CALCULATION_DA, U"constant depth calculation", FALSE, FALSE);
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's debugging log writers@> =
|
2022-02-03 21:44:57 +02:00
|
|
|
Writers::register_logger('3', InterSymbol::log);
|
2022-02-03 17:51:44 +02:00
|
|
|
Writers::register_logger('4', InterSymbolsTable::log);
|
2022-01-27 01:59:02 +02:00
|
|
|
Writers::register_logger('5', InterBookmark::log);
|
2022-01-31 01:49:12 +02:00
|
|
|
Writers::register_logger('6', InterPackage::log);
|