Lines Matching refs:which

40 // Most of the constant pool entries are written during class parsing, which
107 void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); }
108 void release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
110 u1* tag_addr_at(int which) const { return tags()->adr_at(which); }
120 CPSlot slot_at(int which) const {
121 assert(is_within_bounds(which), "index out of bounds");
123 volatile intptr_t adr = (intptr_t)OrderAccess::load_ptr_acquire(obj_at_addr_raw(which));
124 assert(adr != 0 || which == 0, "cp entry for klass should not be zero");
128 void slot_at_put(int which, CPSlot s) const {
129 assert(is_within_bounds(which), "index out of bounds");
131 *(intptr_t*)&base()[which] = s.value();
133 intptr_t* obj_at_addr_raw(int which) const {
134 assert(is_within_bounds(which), "index out of bounds");
135 return (intptr_t*) &base()[which];
138 jint* int_at_addr(int which) const {
139 assert(is_within_bounds(which), "index out of bounds");
140 return (jint*) &base()[which];
143 jlong* long_at_addr(int which) const {
144 assert(is_within_bounds(which), "index out of bounds");
145 return (jlong*) &base()[which];
148 jfloat* float_at_addr(int which) const {
149 assert(is_within_bounds(which), "index out of bounds");
150 return (jfloat*) &base()[which];
153 jdouble* double_at_addr(int which) const {
154 assert(is_within_bounds(which), "index out of bounds");
155 return (jdouble*) &base()[which];
210 // in the resolved_references array (which provides the appendix argument).
230 void klass_at_put(int which, Klass* k) {
232 assert(is_within_bounds(which), "index out of bounds");
233 OrderAccess::release_store_ptr((Klass* volatile *)obj_at_addr_raw(which), k);
237 release_tag_at_put(which, JVM_CONSTANT_Class);
241 void klass_index_at_put(int which, int name_index) {
242 tag_at_put(which, JVM_CONSTANT_ClassIndex);
243 *int_at_addr(which) = name_index;
247 void unresolved_klass_at_put(int which, Symbol* s) {
248 release_tag_at_put(which, JVM_CONSTANT_UnresolvedClass);
249 slot_at_put(which, s);
252 void method_handle_index_at_put(int which, int ref_kind, int ref_index) {
253 tag_at_put(which, JVM_CONSTANT_MethodHandle);
254 *int_at_addr(which) = ((jint) ref_index<<16) | ref_kind;
257 void method_type_index_at_put(int which, int ref_index) {
258 tag_at_put(which, JVM_CONSTANT_MethodType);
259 *int_at_addr(which) = ref_index;
262 void invoke_dynamic_at_put(int which, int bootstrap_specifier_index, int name_and_type_index) {
263 tag_at_put(which, JVM_CONSTANT_InvokeDynamic);
264 *int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_specifier_index;
267 void unresolved_string_at_put(int which, Symbol* s) {
268 release_tag_at_put(which, JVM_CONSTANT_String);
269 slot_at_put(which, CPSlot(s, CPSlot::_symbol_bit));
272 void int_at_put(int which, jint i) {
273 tag_at_put(which, JVM_CONSTANT_Integer);
274 *int_at_addr(which) = i;
277 void long_at_put(int which, jlong l) {
278 tag_at_put(which, JVM_CONSTANT_Long);
279 // *long_at_addr(which) = l;
280 Bytes::put_native_u8((address)long_at_addr(which), *((u8*) &l));
283 void float_at_put(int which, jfloat f) {
284 tag_at_put(which, JVM_CONSTANT_Float);
285 *float_at_addr(which) = f;
288 void double_at_put(int which, jdouble d) {
289 tag_at_put(which, JVM_CONSTANT_Double);
290 // *double_at_addr(which) = d;
292 Bytes::put_native_u8((address) double_at_addr(which), *((u8*) &d));
295 Symbol** symbol_at_addr(int which) const {
296 assert(is_within_bounds(which), "index out of bounds");
297 return (Symbol**) &base()[which];
300 void symbol_at_put(int which, Symbol* s) {
302 tag_at_put(which, JVM_CONSTANT_Utf8);
303 *symbol_at_addr(which) = s;
306 void string_at_put(int which, int obj_index, oop str);
309 void string_index_at_put(int which, int string_index) {
310 tag_at_put(which, JVM_CONSTANT_StringIndex);
311 *int_at_addr(which) = string_index;
314 void field_at_put(int which, int class_index, int name_and_type_index) {
315 tag_at_put(which, JVM_CONSTANT_Fieldref);
316 *int_at_addr(which) = ((jint) name_and_type_index<<16) | class_index;
319 void method_at_put(int which, int class_index, int name_and_type_index) {
320 tag_at_put(which, JVM_CONSTANT_Methodref);
321 *int_at_addr(which) = ((jint) name_and_type_index<<16) | class_index;
324 void interface_method_at_put(int which, int class_index, int name_and_type_index) {
325 tag_at_put(which, JVM_CONSTANT_InterfaceMethodref);
326 *int_at_addr(which) = ((jint) name_and_type_index<<16) | class_index; // Not so nice
329 void name_and_type_at_put(int which, int name_index, int signature_index) {
330 tag_at_put(which, JVM_CONSTANT_NameAndType);
331 *int_at_addr(which) = ((jint) signature_index<<16) | name_index; // Not so nice
336 constantTag tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
340 Klass* klass_at(int which, TRAPS) {
342 return klass_at_impl(h_this, which, true, THREAD);
346 Klass* klass_at_ignore_error(int which, TRAPS) {
348 return klass_at_impl(h_this, which, false, THREAD);
351 Symbol* klass_name_at(int which) const; // Returns the name, w/o resolving.
353 Klass* resolved_klass_at(int which) const { // Used by Compiler
354 guarantee(tag_at(which).is_klass(), "Corrupted constant pool");
357 return CPSlot((Klass*)OrderAccess::load_ptr_acquire(obj_at_addr_raw(which))).get_klass();
361 Symbol* klass_at_noresolve(int which) { return klass_name_at(which); }
363 jint int_at(int which) {
364 assert(tag_at(which).is_int(), "Corrupted constant pool");
365 return *int_at_addr(which);
368 jlong long_at(int which) {
369 assert(tag_at(which).is_long(), "Corrupted constant pool");
370 // return *long_at_addr(which);
371 u8 tmp = Bytes::get_native_u8((address)&base()[which]);
375 jfloat float_at(int which) {
376 assert(tag_at(which).is_float(), "Corrupted constant pool");
377 return *float_at_addr(which);
380 jdouble double_at(int which) {
381 assert(tag_at(which).is_double(), "Corrupted constant pool");
382 u8 tmp = Bytes::get_native_u8((address)&base()[which]);
386 Symbol* symbol_at(int which) const {
387 assert(tag_at(which).is_utf8(), "Corrupted constant pool");
388 return *symbol_at_addr(which);
391 oop string_at(int which, int obj_index, TRAPS) {
393 return string_at_impl(h_this, which, obj_index, THREAD);
395 oop string_at(int which, TRAPS) {
396 int obj_index = cp_to_object_index(which);
397 return string_at(which, obj_index, THREAD);
401 oop uncached_string_at(int which, TRAPS);
410 bool is_pseudo_string_at(int which) {
411 assert(tag_at(which).is_string(), "Corrupted constant pool");
412 return slot_at(which).is_pseudo_string();
415 oop pseudo_string_at(int which, int obj_index) {
416 assert(is_pseudo_string_at(which), "must be a pseudo-string");
421 oop pseudo_string_at(int which) {
422 assert(is_pseudo_string_at(which), "must be a pseudo-string");
423 int obj_index = cp_to_object_index(which);
428 void pseudo_string_at_put(int which, int obj_index, oop x) {
429 assert(tag_at(which).is_string(), "Corrupted constant pool");
430 Symbol* sym = unresolved_string_at(which);
431 slot_at_put(which, CPSlot(sym, (CPSlot::_symbol_bit | CPSlot::_pseudo_bit)));
432 string_at_put(which, obj_index, x); // this works just fine
437 oop resolved_string_at(int which) {
438 assert(tag_at(which).is_string(), "Corrupted constant pool");
442 int obj_index = cp_to_object_index(which);
446 Symbol* unresolved_string_at(int which) {
447 assert(tag_at(which).is_string(), "Corrupted constant pool");
448 Symbol* sym = slot_at(which).get_symbol();
456 char* string_at_noresolve(int which);
458 jint name_and_type_at(int which) {
459 assert(tag_at(which).is_name_and_type(), "Corrupted constant pool");
460 return *int_at_addr(which);
463 int method_handle_ref_kind_at(int which) {
464 assert(tag_at(which).is_method_handle() ||
465 tag_at(which).is_method_handle_in_error(), "Corrupted constant pool");
466 return extract_low_short_from_int(*int_at_addr(which)); // mask out unwanted ref_index bits
468 int method_handle_index_at(int which) {
469 assert(tag_at(which).is_method_handle() ||
470 tag_at(which).is_method_handle_in_error(), "Corrupted constant pool");
471 return extract_high_short_from_int(*int_at_addr(which)); // shift out unwanted ref_kind bits
473 int method_type_index_at(int which) {
474 assert(tag_at(which).is_method_type() ||
475 tag_at(which).is_method_type_in_error(), "Corrupted constant pool");
476 return *int_at_addr(which);
480 Symbol* method_handle_name_ref_at(int which) {
481 int member = method_handle_index_at(which);
484 Symbol* method_handle_signature_ref_at(int which) {
485 int member = method_handle_index_at(which);
488 int method_handle_klass_index_at(int which) {
489 int member = method_handle_index_at(which);
492 Symbol* method_type_signature_at(int which) {
493 int sym = method_type_index_at(which);
497 int invoke_dynamic_name_and_type_ref_index_at(int which) {
498 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
499 return extract_high_short_from_int(*int_at_addr(which));
501 int invoke_dynamic_bootstrap_specifier_index(int which) {
502 assert(tag_at(which).value() == JVM_CONSTANT_InvokeDynamic, "Corrupted constant pool");
503 return extract_low_short_from_int(*int_at_addr(which));
505 int invoke_dynamic_operand_base(int which) {
506 int bootstrap_specifier_index = invoke_dynamic_bootstrap_specifier_index(which);
546 int invoke_dynamic_operand_limit(int which) {
547 int bootstrap_specifier_index = invoke_dynamic_bootstrap_specifier_index(which);
599 int invoke_dynamic_bootstrap_method_ref_index_at(int which) {
600 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
601 int op_base = invoke_dynamic_operand_base(which);
604 int invoke_dynamic_argument_count_at(int which) {
605 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
606 int op_base = invoke_dynamic_operand_base(which);
609 int next_offset = invoke_dynamic_operand_limit(which));
613 int invoke_dynamic_argument_index_at(int which, int j) {
614 int op_base = invoke_dynamic_operand_base(which);
628 // There are also "uncached" versions which do not adjust the operand index; see below.
632 // which are handled by a dynamic check in remap_instruction_operand_from_cache.
636 Klass* klass_ref_at(int which, TRAPS);
637 Symbol* klass_ref_at_noresolve(int which);
638 Symbol* name_ref_at(int which) { return impl_name_ref_at(which, false); }
639 Symbol* signature_ref_at(int which) { return impl_signature_ref_at(which, false); }
641 int klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, false); }
642 int name_and_type_ref_index_at(int which) { return impl_name_and_type_ref_index_at(which, false); }
652 BasicType basic_type_for_signature_at(int which) const;
696 bool klass_name_at_matches(instanceKlassHandle k, int which);
721 static Method* method_at_if_loaded (const constantPoolHandle& this_cp, int which);
722 static bool has_appendix_at_if_loaded (const constantPoolHandle& this_cp, int which);
723 static oop appendix_at_if_loaded (const constantPoolHandle& this_cp, int which);
724 static bool has_method_type_at_if_loaded (const constantPoolHandle& this_cp, int which);
725 static oop method_type_at_if_loaded (const constantPoolHandle& this_cp, int which);
726 static Klass* klass_at_if_loaded (const constantPoolHandle& this_cp, int which);
727 static Klass* klass_ref_at_if_loaded (const constantPoolHandle& this_cp, int which);
729 // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the
732 Symbol* uncached_klass_ref_at_noresolve(int which);
733 Symbol* uncached_name_ref_at(int which) { return impl_name_ref_at(which, true); }
734 Symbol* uncached_signature_ref_at(int which) { return impl_signature_ref_at(which, true); }
735 int uncached_klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, true); }
736 int uncached_name_and_type_ref_index_at(int which) { return impl_name_and_type_ref_index_at(which, true); }
742 const char* printable_name_at(int which) PRODUCT_RETURN0;
766 Symbol* impl_name_ref_at(int which, bool uncached);
767 Symbol* impl_signature_ref_at(int which, bool uncached);
768 int impl_klass_ref_index_at(int which, bool uncached);
769 int impl_name_and_type_ref_index_at(int which, bool uncached);
770 constantTag impl_tag_ref_at(int which, bool uncached);
773 jint klass_index_at(int which) {
774 assert(tag_at(which).is_klass_index(), "Corrupted constant pool");
775 return *int_at_addr(which);
778 jint string_index_at(int which) {
779 assert(tag_at(which).is_string_index(), "Corrupted constant pool");
780 return *int_at_addr(which);
788 static Klass* klass_at_impl(const constantPoolHandle& this_cp, int which,
790 static oop string_at_impl(const constantPoolHandle& this_cp, int which, int obj_index, TRAPS);
801 static void throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS);
802 static Symbol* exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception);
803 static void save_and_throw_exception(const constantPoolHandle& this_cp, int which, constantTag tag, TRAPS);