Skip to main content

DexPool

Struct DexPool 

Source
pub struct DexPool {
    pub dex_labels: Vec<String>,
    pub order: Vec<String>,
    /* private fields */
}
Expand description

Multi-DEX class pool: classes from all images, first definition wins.

Fields§

§dex_labels: Vec<String>

Human label per image (“weibo!classes.dex”) for the provenance header; defaults to “dex N” until the CLI names the inputs.

§order: Vec<String>

Class names in insertion order (stable for output).

Implementations§

Source§

impl DexPool

Source

pub fn new() -> Self

Source

pub fn outer_of(&self, name: &str) -> Option<&str>

The outer class of name, from the cached map (borrowed).

Source

pub fn children_of(&self, internal: &str) -> &[String]

Direct nested children of internal (any $ depth 1), cached. (Perf: returns a borrowed slice — the owned-Vec clone ran once per class on 98k-class runs.)

Source

pub fn add_dex(&mut self, dex: DexFile) -> usize

Adds one image; duplicate class names keep their first definition. Returns the image’s index — call set_dex_label with it to give the provenance header a real origin instead of the default “dex N”.

Source

pub fn add_dex_lazy(&mut self, dex: DexFile) -> usize

Registers class NAMES only; the PoolClass (annotation reads included) is materialized on first get. Duplicate class names keep their first definition, matching add_dex.

Source

pub fn set_dex_label(&mut self, idx: usize, label: impl Into<String>)

Label the image at idx (see add_dex).

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, internal: &str) -> Option<&PoolClass>

Source

pub fn materialize_all(&self, threads: usize)

Materialize every lazy entry (parallel across the given chunk count). After this the pool is observationally identical to an eagerly-built one — including the annotation-aware outer-map — while the annotation reads ran on worker threads instead of the serial pool build (~0.2s on weibo).

Source

pub fn has_name(&self, internal: &str) -> bool

Name registered (no materialization).

Source

pub fn dex(&self, idx: usize) -> Option<Arc<DexFile>>

One image as an Arc snapshot (borrows of the snapshot live as long as the caller holds the Arc).

Source

pub fn dex_count(&self) -> usize

Source

pub fn class_names(&self) -> impl Iterator<Item = &str>

Source

pub fn is_subtype(&self, sub: &str, sup: &str) -> bool

True when sub is assignable to sup (internal names), walking the pool’s hierarchy. Unknown classes are never assignable (conservative).

Source§

impl DexPool

Classes to emit as their own compilation units: top-level classes plus anonymous/local/lambda-shaped ones (clean members render inline).

Source

pub fn arm_retirement(&self)

Arm image retirement (full-decompile driver only): count one pending class per image by pool ownership.

Source

pub fn report_class_done(&self, class_name: &str) -> Option<usize>

Report one class finished; Some(image) when it was the image’s last class (driver batches these into release_images).

Source

pub fn release_images(&self, indexes: &[usize])

Release the images’ inflated bytes. Safe: the driver calls this only when every class of each image is emitted or failed; new dex() snapshots still work (tables valid, code accessors empty).

Trait Implementations§

Source§

impl Default for DexPool

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.