Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/hotspot/share/interpreter/rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ void Rewriter::rewrite_invokedynamic(address bcp, int offset, bool reverse) {
// Should do nothing since we are not patching this bytecode
int cache_index = ConstantPool::decode_invokedynamic_index(
Bytes::get_native_u4(p));
// We will reverse the bytecode rewriting _after_ adjusting them.
// Adjust the cache index by offset to the invokedynamic entries in the
// cpCache plus the delta if the invokedynamic bytecodes were adjusted.
int cp_index = _initialized_indy_entries.at(cache_index).constant_pool_index();
assert(_pool->tag_at(cp_index).is_invoke_dynamic(), "wrong index");
// zero out 4 bytes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -102,7 +102,9 @@ protected short getConstantPoolIndex(int rawcode, int bci) {
// Invokedynamic require special handling
cpCacheIndex = ~cpCacheIndex;
cpCacheIndex = bytes.swapInt(cpCacheIndex);
return (short) cpCache.getEntryAt(cpCacheIndex).getConstantPoolIndex();
short cpIndex = (short) cpCache.getIndyEntryAt(cpCacheIndex).getConstantPoolIndex();
Assert.that(cpool.getTagAt(cpIndex).isInvokeDynamic(), "CP Entry should be InvokeDynamic");
return cpIndex;
} else if (fmt.contains("JJ")) {
// change byte-ordering and go via cache
return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();
Expand Down