Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/constantPoolOop.hpp @ 1660:083fde3b838e
6964498: JSR 292 invokedynamic sites need local bootstrap methods
Summary: Add JVM_CONSTANT_InvokeDynamic records to constant pool to determine per-instruction BSMs.
Reviewed-by: twisti
author | jrose |
---|---|
date | Thu, 15 Jul 2010 18:40:45 -0700 |
parents | 136b78722a08 |
children | d1896d1dda3e |
comparison
equal
deleted
inserted
replaced
1649:a528509c992b | 1660:083fde3b838e |
---|---|
154 void method_type_index_at_put(int which, int ref_index) { | 154 void method_type_index_at_put(int which, int ref_index) { |
155 tag_at_put(which, JVM_CONSTANT_MethodType); | 155 tag_at_put(which, JVM_CONSTANT_MethodType); |
156 *int_at_addr(which) = ref_index; | 156 *int_at_addr(which) = ref_index; |
157 } | 157 } |
158 | 158 |
159 void invoke_dynamic_at_put(int which, int bootstrap_method_index, int name_and_type_index) { | |
160 tag_at_put(which, JVM_CONSTANT_InvokeDynamic); | |
161 *int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_method_index; | |
162 } | |
163 | |
159 // Temporary until actual use | 164 // Temporary until actual use |
160 void unresolved_string_at_put(int which, symbolOop s) { | 165 void unresolved_string_at_put(int which, symbolOop s) { |
161 *obj_at_addr(which) = NULL; | 166 *obj_at_addr(which) = NULL; |
162 release_tag_at_put(which, JVM_CONSTANT_UnresolvedString); | 167 release_tag_at_put(which, JVM_CONSTANT_UnresolvedString); |
163 oop_store_without_check(obj_at_addr(which), oop(s)); | 168 oop_store_without_check(obj_at_addr(which), oop(s)); |
394 } | 399 } |
395 symbolOop method_type_signature_at(int which) { | 400 symbolOop method_type_signature_at(int which) { |
396 int sym = method_type_index_at(which); | 401 int sym = method_type_index_at(which); |
397 return symbol_at(sym); | 402 return symbol_at(sym); |
398 } | 403 } |
404 int invoke_dynamic_bootstrap_method_ref_index_at(int which) { | |
405 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool"); | |
406 jint ref_index = *int_at_addr(which); | |
407 return extract_low_short_from_int(ref_index); | |
408 } | |
409 int invoke_dynamic_name_and_type_ref_index_at(int which) { | |
410 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool"); | |
411 jint ref_index = *int_at_addr(which); | |
412 return extract_high_short_from_int(ref_index); | |
413 } | |
399 | 414 |
400 // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve, | 415 // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve, |
401 // name_and_type_ref_index_at) all expect to be passed indices obtained | 416 // name_and_type_ref_index_at) all expect to be passed indices obtained |
402 // directly from the bytecode, and extracted according to java byte order. | 417 // directly from the bytecode, and extracted according to java byte order. |
403 // If the indices are meant to refer to fields or methods, they are | 418 // If the indices are meant to refer to fields or methods, they are |