/* * Copyright (c) 1997, 2022, 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 * 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. *
*/
#ifndef ZERO // All the necessary definitions used for (bytecode) template generation. Instead of // spreading the implementation functionality for each bytecode in the interpreter // and the snippet generator, a template is assigned to each bytecode which can be // used to generate the bytecode's implementation if needed.
class InterpreterMacroAssembler;
// A Template describes the properties of a code template for a given bytecode // and provides a generator to generate the code template.
classTemplate { private: enum Flags {
uses_bcp_bit, // set if template needs the bcp pointing to bytecode
does_dispatch_bit, // set if template dispatches on its own
calls_vm_bit, // set if template calls the vm
wide_bit // set if template belongs to a wide instruction
};
typedefvoid (*generator)(int arg);
int _flags; // describes interpreter template properties (bcp unknown)
TosState _tos_in; // tos cache state before template execution
TosState _tos_out; // tos cache state after template execution
generator _gen; // template code generator int _arg; // argument for template code generator
staticTemplate* _desc; // the current template to be generated static Bytecodes::Code bytecode() { return _desc->bytecode(); } public: //%note templates_1 static InterpreterMacroAssembler* _masm; // the assembler used when generating templates
private:
// special registers staticinline Address at_bcp(int offset);
// debugging of TemplateGenerator staticvoid transition(TosState tos_in, TosState tos_out);// checks if in/out states expected by template generator correspond to table entries
// initialization helpers staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)( ), char filler ); staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(intarg ), int arg ); staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(LdcType ldct), LdcType ldct); staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos); staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op); staticvoid def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc);
friendclassTemplate;
// InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM(). friendclass InterpreterMacroAssembler;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.