8224828: aarch64: rflags is not correct after safepoint poll
Reviewed-by: aph, adinn
Contributed-by: Xiang Yuan <yuanxiang4@huawei.com>
--- a/src/hotspot/cpu/aarch64/aarch64.ad Thu May 30 11:00:23 2019 -0700
+++ b/src/hotspot/cpu/aarch64/aarch64.ad Thu May 30 10:29:55 2019 +0800
@@ -14551,9 +14551,10 @@
// TODO
// provide a near and far version of this code
-instruct safePoint(iRegP poll)
+instruct safePoint(rFlagsReg cr, iRegP poll)
%{
match(SafePoint poll);
+ effect(KILL cr);
format %{
"ldrw zr, [$poll]\t# Safepoint: poll for GC"
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp Thu May 30 11:00:23 2019 -0700
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp Thu May 30 10:29:55 2019 +0800
@@ -135,8 +135,7 @@
int frame_size_in_words = frame_size_in_bytes / wordSize;
*total_frame_words = frame_size_in_words;
- // Save registers, fpu state, and flags.
-
+ // Save Integer and Float registers.
__ enter();
__ push_CPU_state(save_vectors);
@@ -2880,7 +2879,7 @@
bool cause_return = (poll_type == POLL_AT_RETURN);
bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP);
- // Save registers, fpu state, and flags
+ // Save Integer and Float registers.
map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, save_vectors);
// The following is basically a call_VM. However, we need the precise