< prev index next >

src/hotspot/share/classfile/javaClasses.inline.hpp

Print this page
rev 50307 : [mq]: cont


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
  26 #define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "oops/access.inline.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "oops/oopsHierarchy.hpp"

  32 
  33 void java_lang_String::set_coder(oop string, jbyte coder) {
  34   assert(initialized && (coder_offset > 0), "Must be initialized");
  35   string->byte_field_put(coder_offset, coder);
  36 }
  37 
  38 void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) {
  39   assert(initialized, "Must be initialized");
  40   string->obj_field_put_raw(value_offset, buffer);
  41 }
  42 void java_lang_String::set_value(oop string, typeArrayOop buffer) {
  43   assert(initialized && (value_offset > 0), "Must be initialized");
  44   string->obj_field_put(value_offset, (oop)buffer);
  45 }
  46 void java_lang_String::set_hash(oop string, unsigned int hash) {
  47   assert(initialized && (hash_offset > 0), "Must be initialized");
  48   string->int_field_put(hash_offset, hash);
  49 }
  50 
  51 // Accessors


 114 }
 115 HeapWord* java_lang_ref_Reference::next_addr_raw(oop ref) {
 116   return ref->obj_field_addr_raw<HeapWord>(next_offset);
 117 }
 118 oop java_lang_ref_Reference::discovered(oop ref) {
 119   return ref->obj_field(discovered_offset);
 120 }
 121 void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
 122   ref->obj_field_put(discovered_offset, value);
 123 }
 124 void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
 125   ref->obj_field_put_raw(discovered_offset, value);
 126 }
 127 HeapWord* java_lang_ref_Reference::discovered_addr_raw(oop ref) {
 128   return ref->obj_field_addr_raw<HeapWord>(discovered_offset);
 129 }
 130 bool java_lang_ref_Reference::is_phantom(oop ref) {
 131   return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM;
 132 }
 133 





























































































 134 inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
 135   site->obj_field_put_volatile(_target_offset, target);
 136 }
 137 
 138 inline oop  java_lang_invoke_CallSite::target(oop site) {
 139   return site->obj_field(_target_offset);
 140 }
 141 
 142 inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
 143   site->obj_field_put(_target_offset, target);
 144 }
 145 
 146 inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
 147   return obj != NULL && is_subclass(obj->klass());
 148 }
 149 
 150 inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
 151   return obj != NULL && is_subclass(obj->klass());
 152 }
 153 




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
  26 #define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "oops/access.inline.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "oops/oopsHierarchy.hpp"
  32 #include "oops/typeArrayOop.inline.hpp"
  33 
  34 void java_lang_String::set_coder(oop string, jbyte coder) {
  35   assert(initialized && (coder_offset > 0), "Must be initialized");
  36   string->byte_field_put(coder_offset, coder);
  37 }
  38 
  39 void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) {
  40   assert(initialized, "Must be initialized");
  41   string->obj_field_put_raw(value_offset, buffer);
  42 }
  43 void java_lang_String::set_value(oop string, typeArrayOop buffer) {
  44   assert(initialized && (value_offset > 0), "Must be initialized");
  45   string->obj_field_put(value_offset, (oop)buffer);
  46 }
  47 void java_lang_String::set_hash(oop string, unsigned int hash) {
  48   assert(initialized && (hash_offset > 0), "Must be initialized");
  49   string->int_field_put(hash_offset, hash);
  50 }
  51 
  52 // Accessors


 115 }
 116 HeapWord* java_lang_ref_Reference::next_addr_raw(oop ref) {
 117   return ref->obj_field_addr_raw<HeapWord>(next_offset);
 118 }
 119 oop java_lang_ref_Reference::discovered(oop ref) {
 120   return ref->obj_field(discovered_offset);
 121 }
 122 void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
 123   ref->obj_field_put(discovered_offset, value);
 124 }
 125 void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
 126   ref->obj_field_put_raw(discovered_offset, value);
 127 }
 128 HeapWord* java_lang_ref_Reference::discovered_addr_raw(oop ref) {
 129   return ref->obj_field_addr_raw<HeapWord>(discovered_offset);
 130 }
 131 bool java_lang_ref_Reference::is_phantom(oop ref) {
 132   return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM;
 133 }
 134 
 135 inline oop java_lang_Continuation::scope(oop ref) {
 136   return ref->obj_field(scope_offset);
 137 }
 138 inline oop java_lang_Continuation::target(oop ref) {
 139   return ref->obj_field(target_offset);
 140 }
 141 inline oop java_lang_Continuation::parent(oop ref) {
 142   return ref->obj_field(parent_offset);
 143 }
 144 inline typeArrayOop java_lang_Continuation::stack(oop ref) {
 145   oop a = ref->obj_field(stack_offset);
 146   return (typeArrayOop)a;
 147 }
 148 inline objArrayOop java_lang_Continuation::refStack(oop ref) {
 149   oop a = ref->obj_field(refStack_offset);
 150   return (objArrayOop)a;
 151 }
 152 inline jlong java_lang_Continuation::fp(oop ref) {
 153   return ref->long_field(fp_offset);
 154 }
 155 inline void java_lang_Continuation::set_fp(oop ref, const jlong i) {
 156   ref->long_field_put(fp_offset, i);
 157 }
 158 inline jint java_lang_Continuation::sp(oop ref) {
 159   return ref->int_field(sp_offset);
 160 }
 161 inline void java_lang_Continuation::set_sp(oop ref, const jint i) {
 162   ref->int_field_put(sp_offset, i);
 163 }
 164 inline void* java_lang_Continuation::pc(oop ref) {
 165   return (void*)ref->long_field(pc_offset);
 166 }
 167 inline void java_lang_Continuation::set_pc(oop ref, const void* pc) {
 168   ref->long_field_put(pc_offset, (long)pc);
 169 }
 170 inline jint java_lang_Continuation::refSP(oop ref) {
 171   return ref->int_field(refSP_offset);
 172 }
 173 inline void java_lang_Continuation::set_refSP(oop ref, jint i) {
 174   ref->int_field_put(refSP_offset, i);
 175 }
 176 inline intptr_t* java_lang_Continuation::entrySP(oop ref) {
 177   return (intptr_t*)ref->long_field(entrySP_offset);
 178 }
 179 inline void java_lang_Continuation::set_entrySP(oop ref, intptr_t* sp) {
 180   ref->long_field_put(entrySP_offset, (long)sp);
 181 }
 182 inline intptr_t* java_lang_Continuation::entryFP(oop ref) {
 183   return (intptr_t*)ref->long_field(entryFP_offset);
 184 }
 185 inline void java_lang_Continuation::set_entryFP(oop ref, intptr_t* fp) {
 186   ref->long_field_put(entryFP_offset, (long)fp);
 187 }
 188 inline address java_lang_Continuation::entryPC(oop ref) {
 189   return (address)ref->long_field(entryPC_offset);
 190 }
 191 inline void java_lang_Continuation::set_entryPC(oop ref, address pc) {
 192   ref->long_field_put(entryPC_offset, (long)pc);
 193 }
 194 inline jint java_lang_Continuation::maxSize(oop ref) {
 195   return ref->int_field(maxSize_offset);
 196 }
 197 inline void java_lang_Continuation::set_maxSize(oop ref, jint i) {
 198   ref->int_field_put(maxSize_offset, i);
 199 }
 200 inline unsigned char java_lang_Continuation::flags(oop ref) {
 201   return (unsigned char)ref->byte_field(flags_offset);
 202 }
 203 inline void java_lang_Continuation::set_flags(oop ref, unsigned char flags) {
 204   ref->byte_field_put(flags_offset, (jbyte)flags);
 205 }
 206 inline jshort java_lang_Continuation::numFrames(oop ref) {
 207   return ref->short_field(numFrames_offset);
 208 }
 209 inline void java_lang_Continuation::set_numFrames(oop ref, jshort i) {
 210   ref->short_field_put(numFrames_offset, i);
 211 }
 212 inline jshort java_lang_Continuation::numInterpretedFrames(oop ref) {
 213   return ref->short_field(numInterpretedFrames_offset);
 214 }
 215 inline void java_lang_Continuation::set_numInterpretedFrames(oop ref, jshort i) {
 216   ref->short_field_put(numInterpretedFrames_offset, i);
 217 }
 218 inline int java_lang_Continuation::stack_size(oop ref) {
 219   return stack(ref)->length() * 4;
 220 }
 221 inline void* java_lang_Continuation::stack_base(oop ref) {
 222   return stack(ref)->base(T_INT);
 223 }
 224 inline HeapWord* java_lang_Continuation::refStack_base(oop ref) {
 225   return refStack(ref)->base();
 226 }
 227 
 228 inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
 229   site->obj_field_put_volatile(_target_offset, target);
 230 }
 231 
 232 inline oop  java_lang_invoke_CallSite::target(oop site) {
 233   return site->obj_field(_target_offset);
 234 }
 235 
 236 inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
 237   site->obj_field_put(_target_offset, target);
 238 }
 239 
 240 inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
 241   return obj != NULL && is_subclass(obj->klass());
 242 }
 243 
 244 inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
 245   return obj != NULL && is_subclass(obj->klass());
 246 }
 247 


< prev index next >