RFR: NewInstanceStub reads InstanceKlass::_init_state as int but is u1

Christian Thalinger christian.thalinger at oracle.com
Tue Jul 23 14:09:56 PDT 2013


_init_state is defined as u1 in InstanceKlass:

  u1              _init_state;                    // state of class

but is read as int in newInstance:

diff -r 6057d0168f47 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java	Tue Jul 23 12:27:06 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java	Tue Jul 23 14:06:49 2013 -0700
@@ -89,7 +89,7 @@ public class NewInstanceStub extends Sni
     private static Object newInstance(Word hub, @ConstantParameter Word intArrayHub) {
         int sizeInBytes = hub.readInt(klassInstanceSizeOffset(), LocationIdentity.FINAL_LOCATION);
         if (!forceSlowPath() && inlineContiguousAllocationSupported()) {
-            if (hub.readInt(klassStateOffset(), CLASS_STATE_LOCATION) == klassStateFullyInitialized()) {
+            if (hub.readByte(klassStateOffset(), CLASS_STATE_LOCATION) == klassStateFullyInitialized()) {
                 Word memory = refillAllocate(intArrayHub, sizeInBytes, logging());
                 if (memory.notEqual(0)) {
                     Word prototypeMarkWord = hub.readWord(prototypeMarkWordOffset(), PROTOTYPE_MARK_WORD_LOCATION);

-- Chris


More information about the graal-dev mailing list