pub struct CodegenCtx<'a> {Show 18 fields
pub writer: &'a mut ClassFileWriter,
pub catalog: ClassCatalog,
pub class_name: Ustr,
pub super_name: Ustr,
pub return_ty: Ty,
pub next_local: u16,
pub locals: HashMap<Ustr, u16>,
pub local_types: HashMap<Ustr, Ty>,
pub fields: HashMap<Ustr, FieldInfo>,
pub methods: HashMap<Ustr, MethodSig>,
pub outer_this: Option<OuterThisInfo>,
pub outer_fields: HashMap<Ustr, CapturedField>,
pub enclosing_static_owner: Option<Ustr>,
pub break_labels: Vec<ControlTarget>,
pub continue_labels: Vec<ControlTarget>,
pub labeled_break_labels: Vec<(Ustr, ControlTarget)>,
pub labeled_continue_labels: Vec<(Ustr, ControlTarget)>,
pub cleanup_scopes: Vec<CleanupScope>,
/* private fields */
}Fields§
§writer: &'a mut ClassFileWriter§catalog: ClassCatalog§class_name: Ustr§super_name: Ustr§return_ty: Ty§next_local: u16§locals: HashMap<Ustr, u16>§local_types: HashMap<Ustr, Ty>§fields: HashMap<Ustr, FieldInfo>§methods: HashMap<Ustr, MethodSig>§outer_this: Option<OuterThisInfo>§outer_fields: HashMap<Ustr, CapturedField>§enclosing_static_owner: Option<Ustr>§break_labels: Vec<ControlTarget>§continue_labels: Vec<ControlTarget>§labeled_break_labels: Vec<(Ustr, ControlTarget)>§labeled_continue_labels: Vec<(Ustr, ControlTarget)>§cleanup_scopes: Vec<CleanupScope>Implementations§
Source§impl<'a> CodegenCtx<'a>
impl<'a> CodegenCtx<'a>
pub fn new( writer: &'a mut ClassFileWriter, class_name: Ustr, catalog: &ClassCatalog, ) -> Self
pub fn set_super_name(&mut self, super_name: Ustr)
pub fn set_fields(&mut self, fields: &[FieldDecl])
pub fn set_methods(&mut self, methods: &[MethodDecl])
pub fn set_anonymous_info(&mut self, info: Option<&AnonymousClassInfo>)
pub fn begin_method(&mut self, method: &MethodDecl)
pub fn alloc_local(&mut self, name: Ustr, ty: Ty) -> u16
pub fn alloc_temp(&mut self, ty: &Ty) -> u16
pub fn get_local(&self, name: Ustr) -> Option<u16>
pub fn local_ty(&self, name: Ustr) -> Option<Ty>
pub fn field_ty(&self, name: Ustr) -> Option<Ty>
pub fn field_is_static(&self, name: Ustr) -> bool
pub fn method_sig(&self, name: Ustr) -> Option<MethodSig>
pub fn control_target(&self, label: Label) -> ControlTarget
pub fn push_labeled_loop( &mut self, label: Ustr, break_label: ControlTarget, continue_label: ControlTarget, )
pub fn pop_labeled_loop(&mut self)
pub fn find_break_target(&self, label: Option<Ustr>) -> Option<ControlTarget>
pub fn find_continue_target(&self, label: Option<Ustr>) -> Option<ControlTarget>
Trait Implementations§
Source§impl TypeEnvironment for CodegenCtx<'_>
impl TypeEnvironment for CodegenCtx<'_>
fn local_ty(&self, name: Ustr) -> Option<Ty>
fn field_ty(&self, name: Ustr) -> Option<Ty>
fn resolve_static_field(&self, owner: &str, name: &str) -> Option<Ty>
fn resolve_instance_method( &self, receiver: &Ty, name: &str, args: &[Ty], ) -> Option<Ty>
fn resolve_static_method( &self, owner: &str, name: &str, args: &[Ty], ) -> Option<Ty>
fn resolve_current_method(&self, name: Ustr, _args: &[Ty]) -> Option<Ty>
fn this_ty(&self) -> Ty
fn super_ty(&self) -> Ty
Auto Trait Implementations§
impl<'a> Freeze for CodegenCtx<'a>
impl<'a> RefUnwindSafe for CodegenCtx<'a>
impl<'a> Send for CodegenCtx<'a>
impl<'a> Sync for CodegenCtx<'a>
impl<'a> Unpin for CodegenCtx<'a>
impl<'a> UnsafeUnpin for CodegenCtx<'a>
impl<'a> !UnwindSafe for CodegenCtx<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more