Factor out repeated shift instructions to reduce code size
R8 has some O(n^3) analysis somewhere, so this should speed up analysis of "onResourcesLoaded" by 1.5^3=3.3x. Bug: 145052564 Change-Id: Ib6ab111511d6bd3afae0c29cd00f743e7128768a Tested: aapt2_tests
This commit is contained in:
@@ -522,9 +522,15 @@ TEST(JavaClassGeneratorTest, GenerateOnResourcesLoadedCallbackForSharedLibrary)
|
||||
ASSERT_TRUE(generator.Generate("android", &out));
|
||||
out.Flush();
|
||||
|
||||
EXPECT_THAT(output, HasSubstr("void onResourcesLoaded"));
|
||||
EXPECT_THAT(output, HasSubstr("com.foo.R.onResourcesLoaded"));
|
||||
EXPECT_THAT(output, HasSubstr("com.boo.R.onResourcesLoaded"));
|
||||
EXPECT_THAT(output, HasSubstr(
|
||||
R"( public static void onResourcesLoaded(int p) {
|
||||
com.foo.R.onResourcesLoaded(p);
|
||||
com.boo.R.onResourcesLoaded(p);
|
||||
final int packageIdBits = p << 24;
|
||||
attr.foo = (attr.foo & 0x00ffffff) | packageIdBits;
|
||||
id.foo = (id.foo & 0x00ffffff) | packageIdBits;
|
||||
style.foo = (style.foo & 0x00ffffff) | packageIdBits;
|
||||
})"));
|
||||
}
|
||||
|
||||
TEST(JavaClassGeneratorTest, OnlyGenerateRText) {
|
||||
|
||||
Reference in New Issue
Block a user