pr 60
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::common::symbols::Symbol;
|
||||
use anyhow::{Context, Result};
|
||||
use prometeu_bytecode::disasm::disasm;
|
||||
use prometeu_bytecode::v0::BytecodeLoader;
|
||||
use prometeu_bytecode::BytecodeLoader;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ use anyhow::{anyhow, Result};
|
||||
use prometeu_bytecode::abi::SourceSpan;
|
||||
use prometeu_bytecode::asm::{update_pc_by_operand, Asm, Operand};
|
||||
use prometeu_bytecode::opcode::OpCode;
|
||||
use prometeu_bytecode::v0::{BytecodeModule, ConstantPoolEntry, DebugInfo, FunctionMeta};
|
||||
use prometeu_bytecode::{BytecodeModule, ConstantPoolEntry, DebugInfo, FunctionMeta};
|
||||
|
||||
/// The final output of the code generation phase.
|
||||
pub struct EmitResult {
|
||||
@@ -38,7 +38,7 @@ pub fn emit_module(module: &ir_vm::Module) -> Result<EmitResult> {
|
||||
let fragments = emit_fragments(module)?;
|
||||
|
||||
let exports: Vec<_> = module.functions.iter().enumerate().map(|(i, f)| {
|
||||
prometeu_bytecode::v0::Export {
|
||||
prometeu_bytecode::Export {
|
||||
symbol: f.name.clone(),
|
||||
func_idx: i as u32,
|
||||
}
|
||||
@@ -307,7 +307,7 @@ mod tests {
|
||||
use crate::ir_vm::instr::{InstrKind, Instruction};
|
||||
use crate::ir_vm::module::{Function, Module};
|
||||
use crate::ir_vm::types::Type;
|
||||
use prometeu_bytecode::v0::{BytecodeLoader, ConstantPoolEntry};
|
||||
use prometeu_bytecode::{BytecodeLoader, ConstantPoolEntry};
|
||||
|
||||
#[test]
|
||||
fn test_emit_module_with_const_pool() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::building::output::{CompiledModule};
|
||||
use crate::building::plan::BuildStep;
|
||||
use prometeu_bytecode::opcode::OpCode;
|
||||
use prometeu_bytecode::v0::{ConstantPoolEntry, DebugInfo};
|
||||
use prometeu_bytecode::{ConstantPoolEntry, DebugInfo};
|
||||
use prometeu_core::virtual_machine::{ProgramImage, Value};
|
||||
use std::collections::{HashMap};
|
||||
|
||||
@@ -278,7 +278,7 @@ mod tests {
|
||||
use crate::deps::resolver::ProjectId;
|
||||
use crate::frontends::pbs::symbols::SymbolKind;
|
||||
use prometeu_bytecode::opcode::OpCode;
|
||||
use prometeu_bytecode::v0::FunctionMeta;
|
||||
use prometeu_bytecode::FunctionMeta;
|
||||
|
||||
#[test]
|
||||
fn test_link_root_and_lib() {
|
||||
|
||||
@@ -13,7 +13,7 @@ use crate::frontends::pbs::symbols::{ModuleSymbols, Namespace, Symbol, SymbolKin
|
||||
use crate::frontends::pbs::typecheck::TypeChecker;
|
||||
use crate::frontends::pbs::types::PbsType;
|
||||
use crate::lowering::core_to_vm;
|
||||
use prometeu_bytecode::v0::{ConstantPoolEntry, DebugInfo, FunctionMeta};
|
||||
use prometeu_bytecode::{ConstantPoolEntry, DebugInfo, FunctionMeta};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::path::Path;
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::backend;
|
||||
use crate::common::config::ProjectConfig;
|
||||
use crate::common::symbols::Symbol;
|
||||
use anyhow::Result;
|
||||
use prometeu_bytecode::v0::BytecodeModule;
|
||||
use prometeu_bytecode::BytecodeModule;
|
||||
use std::path::Path;
|
||||
|
||||
/// The result of a successful compilation process.
|
||||
@@ -77,7 +77,7 @@ mod tests {
|
||||
use crate::ir_vm;
|
||||
use prometeu_bytecode::disasm::disasm;
|
||||
use prometeu_bytecode::opcode::OpCode;
|
||||
use prometeu_bytecode::v0::BytecodeLoader;
|
||||
use prometeu_bytecode::BytecodeLoader;
|
||||
use std::fs;
|
||||
use tempfile::tempdir;
|
||||
|
||||
@@ -331,7 +331,7 @@ mod tests {
|
||||
let rom = emit_result.rom;
|
||||
|
||||
// --- 5. ASSERT INDUSTRIAL FORMAT ---
|
||||
use prometeu_bytecode::v0::BytecodeLoader;
|
||||
use prometeu_bytecode::BytecodeLoader;
|
||||
let pbc = BytecodeLoader::load(&rom).expect("Failed to parse industrial PBC");
|
||||
|
||||
assert_eq!(&rom[0..4], b"PBS\0");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use prometeu_bytecode::disasm::disasm;
|
||||
use prometeu_bytecode::v0::BytecodeLoader;
|
||||
use prometeu_bytecode::BytecodeLoader;
|
||||
use prometeu_compiler::compiler::compile;
|
||||
use prometeu_compiler::frontends::pbs::ast::Node;
|
||||
use prometeu_compiler::frontends::pbs::parser::Parser;
|
||||
|
||||
@@ -86,7 +86,7 @@ fn test_hip_conformance_core_to_vm_to_bytecode() {
|
||||
let bytecode = emit_result.rom;
|
||||
|
||||
// 4. Assert industrial PBS\0 format
|
||||
use prometeu_bytecode::v0::BytecodeLoader;
|
||||
use prometeu_bytecode::BytecodeLoader;
|
||||
let module = BytecodeLoader::load(&bytecode).expect("Failed to parse industrial PBC");
|
||||
assert_eq!(&bytecode[0..4], b"PBS\0");
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ fn test_integration_test01_link() {
|
||||
let unit = compile(&project_dir).expect("Failed to compile and link");
|
||||
|
||||
let mut vm = VirtualMachine::default();
|
||||
// Use initialize to load the ROM and resolve entrypoint
|
||||
vm.initialize(unit.rom, "frame").expect("Failed to initialize VM");
|
||||
// Use initialize to load the ROM; entrypoint must be numeric or empty (defaults to 0)
|
||||
vm.initialize(unit.rom, "").expect("Failed to initialize VM");
|
||||
|
||||
let mut native = SimpleNative;
|
||||
let mut hw = SimpleHardware::new();
|
||||
|
||||
Reference in New Issue
Block a user