313 _invokedynamic_references_map.at_put(resolved_index, cache_index + delta);
314 }
315 }
316 }
317
318
319 // Rewrite some ldc bytecodes to _fast_aldc
320 void Rewriter::maybe_rewrite_ldc(address bcp, int offset, bool is_wide,
321 bool reverse) {
322 if (!reverse) {
323 assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
324 address p = bcp + offset;
325 int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
326 constantTag tag = _pool->tag_at(cp_index).value();
327
328 if (tag.is_method_handle() ||
329 tag.is_method_type() ||
330 tag.is_string() ||
331 (tag.is_dynamic_constant() &&
332 // keep regular ldc interpreter logic for condy primitives
333 is_reference_type(FieldType::basic_type(_pool->uncached_signature_ref_at(cp_index))))
334 ) {
335 int ref_index = cp_entry_to_resolved_references(cp_index);
336 if (is_wide) {
337 (*bcp) = Bytecodes::_fast_aldc_w;
338 assert(ref_index == (u2)ref_index, "index overflow");
339 Bytes::put_native_u2(p, ref_index);
340 } else {
341 (*bcp) = Bytecodes::_fast_aldc;
342 assert(ref_index == (u1)ref_index, "index overflow");
343 (*p) = (u1)ref_index;
344 }
345 }
346 } else {
347 Bytecodes::Code rewritten_bc =
348 (is_wide ? Bytecodes::_fast_aldc_w : Bytecodes::_fast_aldc);
349 if ((*bcp) == rewritten_bc) {
350 address p = bcp + offset;
351 int ref_index = is_wide ? Bytes::get_native_u2(p) : (u1)(*p);
352 int pool_index = resolved_references_entry_to_pool_index(ref_index);
353 if (is_wide) {
|
313 _invokedynamic_references_map.at_put(resolved_index, cache_index + delta);
314 }
315 }
316 }
317
318
319 // Rewrite some ldc bytecodes to _fast_aldc
320 void Rewriter::maybe_rewrite_ldc(address bcp, int offset, bool is_wide,
321 bool reverse) {
322 if (!reverse) {
323 assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
324 address p = bcp + offset;
325 int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
326 constantTag tag = _pool->tag_at(cp_index).value();
327
328 if (tag.is_method_handle() ||
329 tag.is_method_type() ||
330 tag.is_string() ||
331 (tag.is_dynamic_constant() &&
332 // keep regular ldc interpreter logic for condy primitives
333 is_reference_type(Signature::basic_type(_pool->uncached_signature_ref_at(cp_index))))
334 ) {
335 int ref_index = cp_entry_to_resolved_references(cp_index);
336 if (is_wide) {
337 (*bcp) = Bytecodes::_fast_aldc_w;
338 assert(ref_index == (u2)ref_index, "index overflow");
339 Bytes::put_native_u2(p, ref_index);
340 } else {
341 (*bcp) = Bytecodes::_fast_aldc;
342 assert(ref_index == (u1)ref_index, "index overflow");
343 (*p) = (u1)ref_index;
344 }
345 }
346 } else {
347 Bytecodes::Code rewritten_bc =
348 (is_wide ? Bytecodes::_fast_aldc_w : Bytecodes::_fast_aldc);
349 if ((*bcp) == rewritten_bc) {
350 address p = bcp + offset;
351 int ref_index = is_wide ? Bytes::get_native_u2(p) : (u1)(*p);
352 int pool_index = resolved_references_entry_to_pool_index(ref_index);
353 if (is_wide) {
|