Path: blob/master/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp
40949 views
/*1* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP25#define SHARE_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP2627// This file contains the platform-independent parts28// of the template interpreter generator.2930#ifndef ZERO3132class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {33protected:3435// entry points for shared code sequence36address _unimplemented_bytecode;37address _illegal_bytecode_sequence;3839// shared code sequences40// Converter for native abi result to tosca result41address generate_result_handler_for(BasicType type);42address generate_slow_signature_handler();43address generate_error_exit(const char* msg);44address generate_StackOverflowError_handler();45address generate_exception_handler(const char* name, const char* message) {46return generate_exception_handler_common(name, message, false);47}48address generate_klass_exception_handler(const char* name) {49return generate_exception_handler_common(name, NULL, true);50}51address generate_exception_handler_common(const char* name, const char* message, bool pass_oop);52address generate_ClassCastException_handler();53address generate_ArrayIndexOutOfBounds_handler();54address generate_return_entry_for(TosState state, int step, size_t index_size);55address generate_earlyret_entry_for(TosState state);56address generate_deopt_entry_for(TosState state, int step, address continuation = NULL);57address generate_safept_entry_for(TosState state, address runtime_entry);58void generate_throw_exception();5960void lock_method();6162void bang_stack_shadow_pages(bool native_call);6364// Instruction generation65void generate_and_dispatch (Template* t, TosState tos_out = ilgl);66void set_vtos_entry_points (Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep);67void set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep);68void set_wide_entry_point (Template* t, address& wep);6970void set_entry_points(Bytecodes::Code code);71void set_unimplemented(int i);72void set_entry_points_for_all_bytes();73void set_safepoints_for_all_bytes();7475// Helpers for generate_and_dispatch76address generate_trace_code(TosState state) PRODUCT_RETURN0;77void count_bytecode() PRODUCT_RETURN;78void histogram_bytecode(Template* t) PRODUCT_RETURN;79void histogram_bytecode_pair(Template* t) PRODUCT_RETURN;80void trace_bytecode(Template* t) PRODUCT_RETURN;81void stop_interpreter_at() PRODUCT_RETURN;8283void generate_all();8485// entry point generator86address generate_method_entry(AbstractInterpreter::MethodKind kind);8788address generate_normal_entry(bool synchronized);89address generate_native_entry(bool synchronized);90address generate_abstract_entry(void);91address generate_math_entry(AbstractInterpreter::MethodKind kind);92address generate_Reference_get_entry();93address generate_CRC32_update_entry();94address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind);95address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind);96#ifdef IA3297address generate_Float_intBitsToFloat_entry();98address generate_Float_floatToRawIntBits_entry();99address generate_Double_longBitsToDouble_entry();100address generate_Double_doubleToRawLongBits_entry();101#endif // IA32102// Some platforms don't need registers, other need two. Unused function is103// left unimplemented.104void generate_stack_overflow_check(void);105void generate_stack_overflow_check(Register Rframe_size, Register Rscratch);106107void generate_counter_incr(Label* overflow);108void generate_counter_overflow(Label& continue_entry);109110void generate_fixed_frame(bool native_call);111112#ifdef AARCH64113void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs);114#endif // AARCH64115116#ifdef PPC117void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false);118void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals);119#endif // PPC120121public:122TemplateInterpreterGenerator(StubQueue* _code);123};124125#endif // !ZERO126127#endif // SHARE_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP128129130