35 // an aggregate of the VM's oop and klass hierarchies (see 36 // oopHierarchy.hpp). Each instance of ciObject holds a handle 37 // to a corresponding oop on the VM side and provides routines 38 // for accessing the information in its oop. By using the ciObject 39 // hierarchy for accessing oops in the VM, the compiler ensures 40 // that it is safe with respect to garbage collection; that is, 41 // GC and compilation can proceed independently without 42 // interference. 43 // 44 // Within the VM, the oop and klass hierarchies are separate. 45 // The compiler interface does not preserve this separation -- 46 // the distinction between `Klass*' and `Klass' are not 47 // reflected in the interface and instead the Klass hierarchy 48 // is directly modeled as the subclasses of ciKlass. 49 50 // ------------------------------------------------------------------ 51 // ciObject::ciObject 52 ciObject::ciObject(oop o) { 53 ASSERT_IN_VM; 54 if (ciObjectFactory::is_initialized()) { 55 _handle = JNIHandles::make_local(o); 56 } else { 57 _handle = JNIHandles::make_global(o); 58 } 59 _klass = NULL; 60 init_flags_from(o); 61 } 62 63 // ------------------------------------------------------------------ 64 // ciObject::ciObject 65 // 66 ciObject::ciObject(Handle h) { 67 ASSERT_IN_VM; 68 if (ciObjectFactory::is_initialized()) { 69 _handle = JNIHandles::make_local(h()); 70 } else { 71 _handle = JNIHandles::make_global(h); 72 } 73 _klass = NULL; 74 init_flags_from(h()); 75 } 76 77 // ------------------------------------------------------------------ | 35 // an aggregate of the VM's oop and klass hierarchies (see 36 // oopHierarchy.hpp). Each instance of ciObject holds a handle 37 // to a corresponding oop on the VM side and provides routines 38 // for accessing the information in its oop. By using the ciObject 39 // hierarchy for accessing oops in the VM, the compiler ensures 40 // that it is safe with respect to garbage collection; that is, 41 // GC and compilation can proceed independently without 42 // interference. 43 // 44 // Within the VM, the oop and klass hierarchies are separate. 45 // The compiler interface does not preserve this separation -- 46 // the distinction between `Klass*' and `Klass' are not 47 // reflected in the interface and instead the Klass hierarchy 48 // is directly modeled as the subclasses of ciKlass. 49 50 // ------------------------------------------------------------------ 51 // ciObject::ciObject 52 ciObject::ciObject(oop o) { 53 ASSERT_IN_VM; 54 if (ciObjectFactory::is_initialized()) { 55 _handle = JNIHandles::make_local(oopDesc::bs()->write_barrier(o)); 56 } else { 57 _handle = JNIHandles::make_global(oopDesc::bs()->write_barrier(o)); 58 } 59 _klass = NULL; 60 init_flags_from(o); 61 } 62 63 // ------------------------------------------------------------------ 64 // ciObject::ciObject 65 // 66 ciObject::ciObject(Handle h) { 67 ASSERT_IN_VM; 68 if (ciObjectFactory::is_initialized()) { 69 _handle = JNIHandles::make_local(h()); 70 } else { 71 _handle = JNIHandles::make_global(h); 72 } 73 _klass = NULL; 74 init_flags_from(h()); 75 } 76 77 // ------------------------------------------------------------------ |