565 enum { |
565 enum { |
566 _indy_bsm_offset = 0, // CONSTANT_MethodHandle bsm |
566 _indy_bsm_offset = 0, // CONSTANT_MethodHandle bsm |
567 _indy_argc_offset = 1, // u2 argc |
567 _indy_argc_offset = 1, // u2 argc |
568 _indy_argv_offset = 2 // u2 argv[argc] |
568 _indy_argv_offset = 2 // u2 argv[argc] |
569 }; |
569 }; |
|
570 |
|
571 // These functions are used in RedefineClasses for CP merge |
|
572 |
|
573 int operand_offset_at(int bootstrap_specifier_index) { |
|
574 assert(0 <= bootstrap_specifier_index && |
|
575 bootstrap_specifier_index < operand_array_length(operands()), |
|
576 "Corrupted CP operands"); |
|
577 return operand_offset_at(operands(), bootstrap_specifier_index); |
|
578 } |
|
579 int operand_bootstrap_method_ref_index_at(int bootstrap_specifier_index) { |
|
580 int offset = operand_offset_at(bootstrap_specifier_index); |
|
581 return operands()->at(offset + _indy_bsm_offset); |
|
582 } |
|
583 int operand_argument_count_at(int bootstrap_specifier_index) { |
|
584 int offset = operand_offset_at(bootstrap_specifier_index); |
|
585 int argc = operands()->at(offset + _indy_argc_offset); |
|
586 return argc; |
|
587 } |
|
588 int operand_argument_index_at(int bootstrap_specifier_index, int j) { |
|
589 int offset = operand_offset_at(bootstrap_specifier_index); |
|
590 return operands()->at(offset + _indy_argv_offset + j); |
|
591 } |
|
592 int operand_next_offset_at(int bootstrap_specifier_index) { |
|
593 int offset = operand_offset_at(bootstrap_specifier_index) + _indy_argv_offset |
|
594 + operand_argument_count_at(bootstrap_specifier_index); |
|
595 return offset; |
|
596 } |
|
597 // Compare a bootsrap specifier in the operands arrays |
|
598 bool compare_operand_to(int bootstrap_specifier_index1, constantPoolHandle cp2, |
|
599 int bootstrap_specifier_index2, TRAPS); |
|
600 // Find a bootsrap specifier in the operands array |
|
601 int find_matching_operand(int bootstrap_specifier_index, constantPoolHandle search_cp, |
|
602 int operands_cur_len, TRAPS); |
|
603 // Resize the operands array with delta_len and delta_size |
|
604 void resize_operands(int delta_len, int delta_size, TRAPS); |
|
605 // Extend the operands array with the length and size of the ext_cp operands |
|
606 void extend_operands(constantPoolHandle ext_cp, TRAPS); |
|
607 // Shrink the operands array to a smaller array with new_len length |
|
608 void shrink_operands(int new_len, TRAPS); |
|
609 |
|
610 |
570 int invoke_dynamic_bootstrap_method_ref_index_at(int which) { |
611 int invoke_dynamic_bootstrap_method_ref_index_at(int which) { |
571 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool"); |
612 assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool"); |
572 int op_base = invoke_dynamic_operand_base(which); |
613 int op_base = invoke_dynamic_operand_base(which); |
573 return operands()->at(op_base + _indy_bsm_offset); |
614 return operands()->at(op_base + _indy_bsm_offset); |
574 } |
615 } |