< prev index next >

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

Print this page




  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_CLASSFILE_JAVACLASSES_INLINE_HPP
  26 #define SHARE_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 
  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 
  48 bool java_lang_String::hash_is_set(oop java_string) {
  49   assert(initialized && (hash_offset > 0) && (hashIsZero_offset > 0), "Must be initialized");
  50   return java_string->int_field(hash_offset) != 0 || java_string->bool_field(hashIsZero_offset) != 0;
  51 }


 144 }
 145 
 146 void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
 147   ref->obj_field_put(discovered_offset, value);
 148 }
 149 
 150 void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
 151   ref->obj_field_put_raw(discovered_offset, value);
 152 }
 153 
 154 HeapWord* java_lang_ref_Reference::discovered_addr_raw(oop ref) {
 155   return ref->obj_field_addr_raw<HeapWord>(discovered_offset);
 156 }
 157 
 158 bool java_lang_ref_Reference::is_final(oop ref) {
 159   return InstanceKlass::cast(ref->klass())->reference_type() == REF_FINAL;
 160 }
 161 
 162 bool java_lang_ref_Reference::is_phantom(oop ref) {
 163   return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM;






















































































































 164 }
 165 
 166 inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
 167   site->obj_field_put_volatile(_target_offset, target);
 168 }
 169 
 170 inline oop  java_lang_invoke_CallSite::target(oop site) {
 171   return site->obj_field(_target_offset);
 172 }
 173 
 174 inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
 175   site->obj_field_put(_target_offset, target);
 176 }
 177 
 178 inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
 179   return obj != NULL && is_subclass(obj->klass());
 180 }
 181 
 182 inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
 183   return obj != NULL && is_subclass(obj->klass());




  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_CLASSFILE_JAVACLASSES_INLINE_HPP
  26 #define SHARE_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 
  44 void java_lang_String::set_value(oop string, typeArrayOop buffer) {
  45   assert(initialized && (value_offset > 0), "Must be initialized");
  46   string->obj_field_put(value_offset, (oop)buffer);
  47 }
  48 
  49 bool java_lang_String::hash_is_set(oop java_string) {
  50   assert(initialized && (hash_offset > 0) && (hashIsZero_offset > 0), "Must be initialized");
  51   return java_string->int_field(hash_offset) != 0 || java_string->bool_field(hashIsZero_offset) != 0;
  52 }


 145 }
 146 
 147 void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
 148   ref->obj_field_put(discovered_offset, value);
 149 }
 150 
 151 void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
 152   ref->obj_field_put_raw(discovered_offset, value);
 153 }
 154 
 155 HeapWord* java_lang_ref_Reference::discovered_addr_raw(oop ref) {
 156   return ref->obj_field_addr_raw<HeapWord>(discovered_offset);
 157 }
 158 
 159 bool java_lang_ref_Reference::is_final(oop ref) {
 160   return InstanceKlass::cast(ref->klass())->reference_type() == REF_FINAL;
 161 }
 162 
 163 bool java_lang_ref_Reference::is_phantom(oop ref) {
 164   return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM;
 165 }
 166 
 167 inline oop java_lang_ContinuationScope::name(oop ref) {
 168   return ref->obj_field(_name_offset);
 169 }
 170 
 171 inline oop java_lang_Continuation::scope(oop ref) {
 172   return ref->obj_field(_scope_offset);
 173 }
 174 inline oop java_lang_Continuation::target(oop ref) {
 175   return ref->obj_field(_target_offset);
 176 }
 177 inline oop java_lang_Continuation::parent(oop ref) {
 178   return ref->obj_field(_parent_offset);
 179 }
 180 inline oop java_lang_Continuation::yieldInfo(oop ref) {
 181   return ref->obj_field(_yieldInfo_offset);
 182 }
 183 inline void java_lang_Continuation::set_yieldInfo(oop ref, oop value) {
 184   ref->obj_field_put(_yieldInfo_offset, value);
 185 }
 186 inline typeArrayOop java_lang_Continuation::stack(oop ref) {
 187   oop a = ref->obj_field(_stack_offset);
 188   return (typeArrayOop)a;
 189 }
 190 inline objArrayOop java_lang_Continuation::refStack(oop ref) {
 191   oop a = ref->obj_field(_refStack_offset);
 192   return (objArrayOop)a;
 193 }
 194 inline void java_lang_Continuation::set_stack(oop ref, oop value) {
 195   ref->obj_field_put(_stack_offset, value);
 196 }
 197 inline void java_lang_Continuation::set_refStack(oop ref, oop value) {
 198   ref->obj_field_put(_refStack_offset, value);
 199 }
 200 inline jlong java_lang_Continuation::fp(oop ref) {
 201   return ref->long_field(_fp_offset);
 202 }
 203 inline void java_lang_Continuation::set_fp(oop ref, const jlong i) {
 204   ref->long_field_put(_fp_offset, i);
 205 }
 206 inline jint java_lang_Continuation::sp(oop ref) {
 207   return ref->int_field(_sp_offset);
 208 }
 209 inline void java_lang_Continuation::set_sp(oop ref, const jint i) {
 210   ref->int_field_put(_sp_offset, i);
 211 }
 212 inline void* java_lang_Continuation::pc(oop ref) {
 213   return (void*)ref->long_field(_pc_offset);
 214 }
 215 inline void java_lang_Continuation::set_pc(oop ref, const void* pc) {
 216   ref->long_field_put(_pc_offset, (jlong)pc);
 217 }
 218 inline jint java_lang_Continuation::refSP(oop ref) {
 219   return ref->int_field(_refSP_offset);
 220 }
 221 inline void java_lang_Continuation::set_refSP(oop ref, jint i) {
 222   ref->int_field_put(_refSP_offset, i);
 223 }
 224 inline intptr_t* java_lang_Continuation::entrySP(oop ref) {
 225   return (intptr_t*)ref->long_field(_entrySP_offset);
 226 }
 227 inline void java_lang_Continuation::set_entrySP(oop ref, intptr_t* sp) {
 228   ref->long_field_put(_entrySP_offset, (jlong)sp);
 229 }
 230 inline intptr_t* java_lang_Continuation::entryFP(oop ref) {
 231   return (intptr_t*)ref->long_field(_entryFP_offset);
 232 }
 233 inline void java_lang_Continuation::set_entryFP(oop ref, intptr_t* fp) {
 234   ref->long_field_put(_entryFP_offset, (jlong)fp);
 235 }
 236 inline address java_lang_Continuation::entryPC(oop ref) {
 237   return (address)ref->long_field(_entryPC_offset);
 238 }
 239 inline void java_lang_Continuation::set_entryPC(oop ref, address pc) {
 240   ref->long_field_put(_entryPC_offset, (jlong)pc);
 241 }
 242 inline address* java_lang_Continuation::entryPC_addr(oop ref) {
 243   return (address*)ref->field_addr(_entryPC_offset);
 244 }
 245 inline jint java_lang_Continuation::maxSize(oop ref) {
 246   return ref->int_field(_maxSize_offset);
 247 }
 248 inline void java_lang_Continuation::set_maxSize(oop ref, jint i) {
 249   ref->int_field_put(_maxSize_offset, i);
 250 }
 251 inline unsigned char java_lang_Continuation::flags(oop ref) {
 252   return (unsigned char)ref->byte_field(_flags_offset);
 253 }
 254 inline void java_lang_Continuation::set_flags(oop ref, unsigned char flags) {
 255   ref->byte_field_put(_flags_offset, (jbyte)flags);
 256 }
 257 inline jshort java_lang_Continuation::critical_section(oop ref) {
 258   return ref->short_field(_cs_offset);
 259 }
 260 inline bool java_lang_Continuation::is_reset(oop ref) {
 261   return ref->bool_field(_reset_offset);
 262 }
 263 inline jshort java_lang_Continuation::numFrames(oop ref) {
 264   return ref->short_field(_numFrames_offset);
 265 }
 266 inline void java_lang_Continuation::set_numFrames(oop ref, jshort i) {
 267   ref->short_field_put(_numFrames_offset, i);
 268 }
 269 inline jshort java_lang_Continuation::numInterpretedFrames(oop ref) {
 270   return ref->short_field(_numInterpretedFrames_offset);
 271 }
 272 inline void java_lang_Continuation::set_numInterpretedFrames(oop ref, jshort i) {
 273   ref->short_field_put(_numInterpretedFrames_offset, i);
 274 }
 275 inline int java_lang_Continuation::stack_size(oop ref) {
 276   return stack(ref)->length() * 4;
 277 }
 278 inline void* java_lang_Continuation::stack_base(oop ref) {
 279   return stack(ref)->base(T_INT);
 280 }
 281 inline HeapWord* java_lang_Continuation::refStack_base(oop ref) {
 282   return refStack(ref)->base();
 283 }
 284 
 285 inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
 286   site->obj_field_put_volatile(_target_offset, target);
 287 }
 288 
 289 inline oop  java_lang_invoke_CallSite::target(oop site) {
 290   return site->obj_field(_target_offset);
 291 }
 292 
 293 inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
 294   site->obj_field_put(_target_offset, target);
 295 }
 296 
 297 inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
 298   return obj != NULL && is_subclass(obj->klass());
 299 }
 300 
 301 inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
 302   return obj != NULL && is_subclass(obj->klass());


< prev index next >