Add full oatdump output behind filters (#7233)

This change makes full oatdump output visible behind the "Directives"
filter. This does the same thing as the --full-output flag, but is
more-easily used. The default code snippets have been updated to include
this.
This commit is contained in:
kevinjeon-g
2024-12-20 12:58:18 -05:00
committed by GitHub
parent f2dd98bc8a
commit 5e23a935de
4 changed files with 9 additions and 3 deletions

View File

@@ -3,6 +3,9 @@
// For R8, please load R8Example for an example with a keep annotation,
// which will prevent unused code from being removed from the final output.
//
// For dex2oat, 'Filter...' > 'Directives' can be unchecked for full
// oatdump output.
//
// (For advanced use only) Click "Templates > Android Java IDE" for
// profile-guided compilation.

View File

@@ -3,6 +3,9 @@
// For R8, please load R8Example for an example with a keep annotation,
// which will prevent unused code from being removed from the final output.
//
// For dex2oat, 'Filter...' > 'Directives' can be unchecked for full
// oatdump output.
//
// (For advanced use only) Click "Templates > Android Kotlin IDE" for
// profile-guided compilation.

View File

@@ -361,7 +361,7 @@ export class Dex2OatCompiler extends BaseCompiler {
};
}
override async processAsm(result) {
override async processAsm(result, filters: ParseFiltersAndOutputOptions) {
let asm: string = '';
if (typeof result.asm === 'string') {
@@ -381,7 +381,7 @@ export class Dex2OatCompiler extends BaseCompiler {
}
const segments: ParsedAsmResultLine[] = [];
if (this.fullOutput) {
if (this.fullOutput || !filters.directives) {
// Returns entire dex2oat output.
segments.push({text: asm, source: null});
} else {

View File

@@ -97,7 +97,7 @@ describe('dex2oat', () => {
const objdumpResult = {
asm,
};
const processed = await compiler.processAsm(objdumpResult);
const processed = await compiler.processAsm(objdumpResult, compiler.getDefaultFilters());
expect(processed).toHaveProperty('asm');
const actualSegments = (processed as {asm: ParsedAsmResultLine[]}).asm;