Static object creation
This commit is contained in:
parent
8642dcdd6a
commit
6c0fbd179a
6 changed files with 160 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::classfile::{ JavaClassFile, AttributeData };
|
||||
use crate::classfile::{ JavaClassFile, AttributeData, AbstractTypeDescription };
|
||||
use crate::heap_area::ObjectReference;
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
|
@ -18,6 +18,23 @@ pub enum Value {
|
|||
Empty(),
|
||||
}
|
||||
|
||||
impl Value {
|
||||
fn default_for(t: AbstractTypeDescription) -> Self {
|
||||
match t {
|
||||
AbstractTypeDescription::Void() => unreachable!(),
|
||||
AbstractTypeDescription::Byte() => Value::Byte(0),
|
||||
AbstractTypeDescription::Char() => Value::Char(0),
|
||||
AbstractTypeDescription::Double() => Value::Double(0),
|
||||
AbstractTypeDescription::Float() => ,
|
||||
AbstractTypeDescription::Int() => ,
|
||||
AbstractTypeDescription::Long() => ,
|
||||
AbstractTypeDescription::Classname(String) => ,
|
||||
AbstractTypeDescription::Short() => ,
|
||||
AbstractTypeDescription::Boolean() => ,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct OperandStack {
|
||||
stack: Box<[Value]>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue