/* * Copyright (c) 1999, 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. *
*/
// An XHandler is a C1 internal description for an exception handler
class XHandler: public CompilationResourceObj { private:
ciExceptionHandler* _desc;
BlockBegin* _entry_block; // Entry block of xhandler
LIR_List* _entry_code; // LIR-operations that must be executed before jumping to entry_block int _entry_pco; // pco where entry_code (or entry_block if no entry_code) starts int _phi_operand; // For resolving of phi functions at begin of entry_block int _scope_count; // for filling ExceptionRangeEntry::scope_count
#ifdef ASSERT int _lir_op_id; // op_id of the LIR-operation throwing to this handler #endif
class IRScope; typedef GrowableArray<IRScope*> IRScopeList;
class Compilation; class IRScope: public CompilationResourceObj { private: // hierarchy
Compilation* _compilation; // the current compilation
IRScope* _caller; // the caller scope, or NULL int _level; // the inlining level
ciMethod* _method; // the corresponding method
IRScopeList _callees; // the inlined method scopes
// graph
XHandlers* _xhandlers; // the exception handlers int _number_of_locks; // the number of monitor lock slots needed bool _monitor_pairing_ok; // the monitor pairing info bool _wrote_final; // has written final field bool _wrote_fields; // has written fields bool _wrote_volatile; // has written volatile field
BlockBegin* _start; // the start block, successsors are method entries
ResourceBitMap _requires_phi_function; // bit is set if phi functions at loop headers are necessary for a local variable
// helper functions
BlockBegin* build_graph(Compilation* compilation, int osr_bci);
// // IRScopeDebugInfo records the debug information for a particular IRScope // in a particular CodeEmitInfo. This allows the information to be computed // once early enough for the OopMap to be available to the LIR and also to be // reemited for different pcs using the same CodeEmitInfo without recomputing // everything. //
class IRScopeDebugInfo: public CompilationResourceObj { private:
IRScope* _scope; int _bci;
GrowableArray<ScopeValue*>* _locals;
GrowableArray<ScopeValue*>* _expressions;
GrowableArray<MonitorValue*>* _monitors;
IRScopeDebugInfo* _caller;
//Whether we should reexecute this bytecode for deopt bool should_reexecute();
void record_debug_info(DebugInformationRecorder* recorder, int pc_offset, bool reexecute, bool is_method_handle_invoke = false) { if (caller() != NULL) { // Order is significant: Must record caller first.
caller()->record_debug_info(recorder, pc_offset, false/*reexecute*/);
}
DebugToken* locvals = recorder->create_scope_values(locals());
DebugToken* expvals = recorder->create_scope_values(expressions());
DebugToken* monvals = recorder->create_monitor_values(monitors()); // reexecute allowed only for the topmost frame bool return_oop = false; // This flag will be ignored since it used only for C2 with escape analysis. bool rethrow_exception = false; bool has_ea_local_in_scope = false; bool arg_escape = false;
recorder->describe_scope(pc_offset, methodHandle(), scope()->method(), bci(),
reexecute, rethrow_exception, is_method_handle_invoke, return_oop,
has_ea_local_in_scope, arg_escape, locvals, expvals, monvals);
}
};
class CodeEmitInfo: public CompilationResourceObj { friendclass LinearScan; private:
IRScopeDebugInfo* _scope_debug_info;
IRScope* _scope;
XHandlers* _exception_handlers;
OopMap* _oop_map;
ValueStack* _stack; // used by deoptimization (contains also monitors bool _is_method_handle_invoke; // true if the associated call site is a MethodHandle call site. bool _deoptimize_on_exception; bool _force_reexecute; // force the reexecute flag on, used for patching stub
class IR: public CompilationResourceObj { private:
Compilation* _compilation; // the current compilation
IRScope* _top_scope; // the root of the scope hierarchy int _num_loops; // Total number of loops
BlockList* _code; // the blocks in code generation order w/ use counts
public: // creation
IR(Compilation* compilation, ciMethod* method, int osr_bci);
// The linear-scan order and the code emission order are equal, but // this may change in future
BlockList* linear_scan_order() { assert(_code != NULL, "not computed"); return _code; }
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.