diff src/share/vm/opto/library_call.cpp @ 4739:52b5d32fbfaf

7117052: instanceKlass::_init_state can be u1 type Summary: Change instanceKlass::_init_state field to u1 type. Reviewed-by: bdelsart, coleenp, dholmes, phh, never Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
author coleenp
date Tue, 06 Dec 2011 18:28:51 -0500
parents a92cdbac8b9e
children 22cee0ee8927
line wrap: on
line diff
--- a/src/share/vm/opto/library_call.cpp	Tue Nov 29 14:44:44 2011 -0500
+++ b/src/share/vm/opto/library_call.cpp	Tue Dec 06 18:28:51 2011 -0500
@@ -2807,7 +2807,9 @@
   // Serializable.class or Object[].class.   The runtime will handle it.
   // But we must make an explicit check for initialization.
   Node* insp = basic_plus_adr(kls, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc));
-  Node* inst = make_load(NULL, insp, TypeInt::INT, T_INT);
+  // Use T_BOOLEAN for instanceKlass::_init_state so the compiler
+  // can generate code to load it as unsigned byte.
+  Node* inst = make_load(NULL, insp, TypeInt::UBYTE, T_BOOLEAN);
   Node* bits = intcon(instanceKlass::fully_initialized);
   Node* test = _gvn.transform( new (C, 3) SubINode(inst, bits) );
   // The 'test' is non-zero if we need to take a slow path.