United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7036706 G1: Use LIR_OprDesc::as_pointer_register in code changes for 7035117
JDK-7036706 : G1: Use LIR_OprDesc::as_pointer_register in code changes for 7035117

Details
Type:
Enhancement
Submit Date:
2011-04-14
Status:
Closed
Updated Date:
2011-07-29
Project Name:
JDK
Resolved Date:
2011-05-10
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs21 (b10)

Related Reports
Backport:

Sub Tasks

Description
In his review of the code changes for 7035117, Christian suggested that the "as_pointer_register" be used to get the register containing the thread in the additional C1 code stub code for Unsafe.get().

Looking at this routine - this seems like an excellent idea. as_pointer_register has exactly the same logic as the existing code (in 64 bit the value in the low half of the register pair is returned; in the 32 bit only a single register is specified and that is returned) and has an assert that for a register pair the low and high halves are the same machine register.

Unfortunately Christian's review comments came in just before the changes were pushed to the hotspot-gc repo.

Hence this CR.

                                    

Comments
SUGGESTED FIX

- Register thread_reg = NOT_LP64(thread()->as_register()) LP64_ONLY(thread()->as_register_lo());
+ Register thread_reg = thread()->as_pointer_register();
                                     
2011-04-14
EVALUATION

There is a better interface in LIR_OprDesc for pointer registers (like the Thread pointer) which encapsulates the 32 bit/64 bit logic - as_pointer_register.
                                     
2011-04-14
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/527b586edf24
                                     
2011-04-19
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/527b586edf24
                                     
2011-04-23



Hardware and Software, Engineered to Work Together