Search in sources :

Example 1 with BuilderArrayEncodedValue

use of org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderArrayEncodedValue in project smali by JesusFreke.

the class BuilderEncodedArrayPool method internArrayEncodedValue.

@Nonnull
public BuilderArrayEncodedValue internArrayEncodedValue(@Nonnull ArrayEncodedValue arrayEncodedValue) {
    BuilderArrayEncodedValue builderArrayEncodedValue = internedItems.get(arrayEncodedValue);
    if (builderArrayEncodedValue != null) {
        return builderArrayEncodedValue;
    }
    builderArrayEncodedValue = (BuilderArrayEncodedValue) dexBuilder.internEncodedValue(arrayEncodedValue);
    BuilderArrayEncodedValue previous = internedItems.putIfAbsent(builderArrayEncodedValue, builderArrayEncodedValue);
    return previous == null ? builderArrayEncodedValue : previous;
}
Also used : BuilderArrayEncodedValue(org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderArrayEncodedValue) Nonnull(javax.annotation.Nonnull)

Example 2 with BuilderArrayEncodedValue

use of org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderArrayEncodedValue in project smali by JesusFreke.

the class BuilderCallSitePool method internCallSite.

@Nonnull
public BuilderCallSiteReference internCallSite(@Nonnull CallSiteReference callSiteReference) {
    BuilderCallSiteReference internedCallSite = internedItems.get(callSiteReference);
    if (internedCallSite != null) {
        return internedCallSite;
    }
    BuilderArrayEncodedValue encodedCallSite = dexBuilder.encodedArraySection.internArrayEncodedValue(CallSiteUtil.getEncodedCallSite(callSiteReference));
    internedCallSite = new BuilderCallSiteReference(callSiteReference.getName(), encodedCallSite);
    BuilderCallSiteReference existing = internedItems.putIfAbsent(internedCallSite, internedCallSite);
    return existing == null ? internedCallSite : existing;
}
Also used : BuilderArrayEncodedValue(org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderArrayEncodedValue) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)2 BuilderArrayEncodedValue (org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderArrayEncodedValue)2