diff options
author | 2021-01-22 14:05:13 +0000 | |
---|---|---|
committer | 2021-01-22 07:15:51 -0800 | |
commit | fc1ce4e8be0d977e3d41699f5ec746d68f63c024 (patch) | |
tree | b656aa7c9e62aa181dfbf7fd4f2a0d32b8bf0704 /test/639-checker-code-sinking/src/Main.java | |
parent | c6da1be58086e873c9695f8c4c1a3a8ca718696e (diff) |
Revert^2 "Partial Load Store Elimination"
This reverts commit 47ac53100303e7e864b7f6d65f17b23088ccf1d6.
There was a bug in LSE where we would incorrectly record the
shadow$_monitor_ field as not having a default initial value. This
caused partial LSE to be unable to compile the Object.identityHashCode
function, causing crashes. This issue was fixed in a parent CL. Also
updated all Offsets in LSE_test to be outside of the object header
regardless of configuration.
Test: ./test.py --host
Bug: 67037140
Reason for revert: Fixed issue with shadow$_monitor_ field and offsets
Change-Id: I4fb2afff4d410da818db38ed833927dfc0f6be33
Diffstat (limited to 'test/639-checker-code-sinking/src/Main.java')
-rw-r--r-- | test/639-checker-code-sinking/src/Main.java | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/test/639-checker-code-sinking/src/Main.java b/test/639-checker-code-sinking/src/Main.java index 8efac92c34..28fa57cfbf 100644 --- a/test/639-checker-code-sinking/src/Main.java +++ b/test/639-checker-code-sinking/src/Main.java @@ -100,13 +100,20 @@ public class Main { } } + // NB It might seem that we'd move the allocation and ifield-set but those are + // already moved into the throw block by a combo of partial-LSE and DCE. + // Instead all that is actually moved is the LoadClass. Also note the + // LoadClass can only be moved since it refers to the 'Main' class itself, + // meaning there's no need for any clinit/actual loading. + // /// CHECK-START: void Main.testFieldStores(boolean) code_sinking (before) /// CHECK: <<Int42:i\d+>> IntConstant 42 + /// CHECK: begin_block /// CHECK: <<LoadClass:l\d+>> LoadClass class_name:Main - /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] - /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int42>>] /// CHECK: If /// CHECK: begin_block + /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] + /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int42>>] /// CHECK: Throw /// CHECK-START: void Main.testFieldStores(boolean) code_sinking (after) @@ -114,15 +121,17 @@ public class Main { /// CHECK-NOT: NewInstance /// CHECK: If /// CHECK: begin_block - /// CHECK: <<Error:l\d+>> LoadClass class_name:java.lang.Error /// CHECK: <<LoadClass:l\d+>> LoadClass class_name:Main /// CHECK-NOT: begin_block /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] /// CHECK-NOT: begin_block /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int42>>] /// CHECK-NOT: begin_block - /// CHECK: NewInstance [<<Error>>] - /// CHECK: Throw + /// CHECK: <<Error:l\d+>> LoadClass class_name:java.lang.Error + /// CHECK-NOT: begin_block + /// CHECK: <<Throw:l\d+>> NewInstance [<<Error>>] + /// CHECK-NOT: begin_block + /// CHECK: Throw [<<Throw>>] public static void testFieldStores(boolean doThrow) { Main m = new Main(); m.intField = 42; @@ -306,16 +315,26 @@ public class Main { } // Test that we preserve the order of stores. + // NB It might seem that we'd move the allocation and ifield-set but those are + // already moved into the throw block by a combo of partial-LSE and DCE. + // Instead all that is actually moved is the LoadClass. Also note the + // LoadClass can only be moved since it refers to the 'Main' class itself, + // meaning there's no need for any clinit/actual loading. + // /// CHECK-START: void Main.testStoreStore(boolean) code_sinking (before) /// CHECK: <<Int42:i\d+>> IntConstant 42 /// CHECK: <<Int43:i\d+>> IntConstant 43 /// CHECK: <<LoadClass:l\d+>> LoadClass class_name:Main - /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] - /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int42>>] - /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int43>>] /// CHECK: If /// CHECK: begin_block + // Moved to throw block by partial-LSE and DCE. + /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] + // These were moved by partial LSE and order of sets is not observable and are + // in an arbitrary order. + /// CHECK-DAG: InstanceFieldSet [<<NewInstance>>,<<Int42>>] + /// CHECK-DAG: InstanceFieldSet [<<NewInstance>>,<<Int43>>] /// CHECK: Throw + /// CHECK-NOT: InstanceFieldSet /// CHECK-START: void Main.testStoreStore(boolean) code_sinking (after) /// CHECK: <<Int42:i\d+>> IntConstant 42 @@ -323,17 +342,17 @@ public class Main { /// CHECK-NOT: NewInstance /// CHECK: If /// CHECK: begin_block - /// CHECK: <<Error:l\d+>> LoadClass class_name:java.lang.Error /// CHECK: <<LoadClass:l\d+>> LoadClass class_name:Main - /// CHECK-NOT: begin_block /// CHECK: <<NewInstance:l\d+>> NewInstance [<<LoadClass>>] /// CHECK-NOT: begin_block - /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int42>>] + /// CHECK-DAG: InstanceFieldSet [<<NewInstance>>,<<Int42>>] + /// CHECK-DAG: InstanceFieldSet [<<NewInstance>>,<<Int43>>] /// CHECK-NOT: begin_block - /// CHECK: InstanceFieldSet [<<NewInstance>>,<<Int43>>] + /// CHECK: <<Error:l\d+>> LoadClass class_name:java.lang.Error /// CHECK-NOT: begin_block /// CHECK: NewInstance [<<Error>>] /// CHECK: Throw + /// CHECK-NOT: InstanceFieldSet public static void testStoreStore(boolean doThrow) { Main m = new Main(); m.intField = 42; |