39 lines
746 B
Rust
39 lines
746 B
Rust
use std::collections::HashMap;
|
|
|
|
use crate::stackframe::Value;
|
|
use crate::classfile::{ AbstractTypeDescription, MethodInfo };
|
|
|
|
pub struct HeapArea {
|
|
pub object_area: ObjectArea,
|
|
pub static_area: StaticArea,
|
|
}
|
|
|
|
type ObjectReference=u32;
|
|
|
|
pub struct ObjectArea {
|
|
compartments: Vec<ObjectCompartment>,
|
|
}
|
|
|
|
pub struct ObjectCompartment {
|
|
objects: Box<[HeapObject]>,
|
|
}
|
|
|
|
pub struct HeapObject {
|
|
fields: Box<[ObjectField]>,
|
|
}
|
|
|
|
pub struct StaticArea {
|
|
static_objects: HashMap<String, StaticObject>,
|
|
}
|
|
|
|
pub struct StaticObject {
|
|
pub class_index: usize,
|
|
pub fields: Box<[ObjectField]>,
|
|
pub methods: Box<[MethodInfo]>,
|
|
}
|
|
|
|
pub struct ObjectField {
|
|
pub type_description: AbstractTypeDescription,
|
|
pub value: Value,
|
|
}
|
|
|