pr 59
This commit is contained in:
@@ -50,8 +50,10 @@ pub const TRAP_INVALID_FUNC: u32 = 0x0000_000B;
|
||||
/// Executed RET with an incorrect stack height (mismatch with function metadata).
|
||||
pub const TRAP_BAD_RET_SLOTS: u32 = 0x0000_000C;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Detailed information about a source code span.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
pub struct SourceSpan {
|
||||
pub file_id: u32,
|
||||
pub start: u32,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::v0::{BytecodeModule, DebugInfo, ConstantPoolEntry, FunctionMeta};
|
||||
use crate::opcode::OpCode;
|
||||
use crate::v0::{BytecodeModule, ConstantPoolEntry, DebugInfo, FunctionMeta};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@@ -158,8 +158,8 @@ impl Linker {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::v0::{BytecodeModule, FunctionMeta, Export, Import};
|
||||
use crate::opcode::OpCode;
|
||||
use crate::v0::{BytecodeModule, Export, FunctionMeta, Import};
|
||||
|
||||
#[test]
|
||||
fn test_linker_basic() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
pub mod linker;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::opcode::OpCode;
|
||||
use crate::abi::SourceSpan;
|
||||
use crate::opcode::OpCode;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// An entry in the Constant Pool.
|
||||
///
|
||||
@@ -50,7 +50,7 @@ pub struct FunctionMeta {
|
||||
pub max_stack_slots: u16,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct DebugInfo {
|
||||
pub pc_to_span: Vec<(u32, SourceSpan)>, // Sorted by PC
|
||||
pub function_names: Vec<(u32, String)>, // (func_idx, name)
|
||||
|
||||
Reference in New Issue
Block a user