rewriter.hpp revision 1580
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
// The Rewriter adds caches to the constant pool and rewrites bytecode indices
// pointing into the constant pool for better interpreter performance.
private:
bool _have_invoke_dynamic;
void init_cp_map(int length) {
// Choose an initial value large enough that we don't get frequent
// calls to grow().
}
int maybe_add_cp_cache_entry(int i) { return has_cp_cache(i) ? _cp_map[i] : add_cp_cache_entry(i); }
int add_cp_cache_entry(int cp_index) {
return cache_index;
}
int add_secondary_cp_cache_entry(int main_cpc_entry) {
return cache_index;
}
// Access the contents of _cp_cache_map to determine CP cache layout.
int cp_cache_entry_pool_index(int cache_index) {
if ((cp_index & _secondary_entry_tag) != 0)
return -1;
else
return cp_index;
}
int cp_cache_secondary_entry_main_index(int cache_index) {
if ((cp_index & _secondary_entry_tag) == 0)
return -1;
else
return (cp_index - _secondary_entry_tag);
}
// All the work goes in here:
void compute_index_maps();
void make_constant_pool_cache(TRAPS);
void scan_method(methodOop m);
public:
// Driver routine:
static void rewrite(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS);
enum {
};
};