8241006: Cleanup TemplateInterpreter initialization

Reviewed-by: coleenp
This commit is contained in:
Claes Redestad 2020-03-13 15:59:27 +01:00
parent afbe2286e2
commit 37629673e7
6 changed files with 15 additions and 37 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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
@ -26,7 +26,6 @@
#include "gc/shared/barrierSet.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/templateTable.hpp"
#include "runtime/timerTrace.hpp"
#ifdef CC_INTERP
@ -168,13 +167,11 @@ void TemplateTable::transition(TosState tos_in, TosState tos_out) {
//----------------------------------------------------------------------------------------------------
// Implementation of TemplateTable: Initialization
bool TemplateTable::_is_initialized = false;
Template TemplateTable::_template_table [Bytecodes::number_of_codes];
Template TemplateTable::_template_table_wide[Bytecodes::number_of_codes];
Template* TemplateTable::_desc;
InterpreterMacroAssembler* TemplateTable::_masm;
BarrierSet* TemplateTable::_bs;
void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(), char filler) {
@ -185,9 +182,6 @@ void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState o
void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(int arg), int arg) {
// should factor out these constants
const int ubcp = 1 << Template::uses_bcp_bit;
const int disp = 1 << Template::does_dispatch_bit;
const int clvm = 1 << Template::calls_vm_bit;
const int iswd = 1 << Template::wide_bit;
// determine which table to use
bool is_wide = (flags & iswd) != 0;
@ -223,12 +217,11 @@ void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState o
}
void TemplateTable::initialize() {
if (_is_initialized) return;
// Initialize table
TraceTime timer("TemplateTable initialization", TRACETIME_LOG(Info, startuptime));
_bs = BarrierSet::barrier_set();
#ifdef ASSERT
static bool is_initialized = false;
assert(!is_initialized, "must only initialize once");
is_initialized = true;
#endif
// For better readability
const char _ = ' ';
@ -507,15 +500,8 @@ void TemplateTable::initialize() {
def(Bytecodes::_shouldnotreachhere , ____|____|____|____, vtos, vtos, shouldnotreachhere , _ );
// platform specific bytecodes
pd_initialize();
_is_initialized = true;
}
void templateTable_init() {
TemplateTable::initialize();
}
void TemplateTable::unimplemented_bc() {
_masm->unimplemented( Bytecodes::name(_desc->bytecode()));
}