/* * Copyright (c) 2015, 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. *
*/
class Dependencies; class ExceptionHandlerTable; class ImplicitExceptionTable; class AbstractCompiler; class xmlStream; class CompiledStaticCall; class NativeCallWrapper; class ScopeDesc; class CompiledIC; class MetadataClosure;
// This class is used internally by nmethods, to cache // exception/pc/handler information.
// cache pc descs found in earlier inquiries class PcDescCache { friendclass VMStructs; private: enum { cache_size = 4 }; // The array elements MUST be volatile! Several threads may modify // and read from the cache concurrently. find_pc_desc_internal has // returned wrong results. C++ compiler (namely xlC12) may duplicate // C++ field accesses if the elements are not volatile. typedef PcDesc* PcDescPtr; volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found public:
PcDescCache() { debug_only(_pc_descs[0] = NULL); } void reset_to(PcDesc* initial_pc_desc);
PcDesc* find_pc_desc(int pc_offset, bool approximate); void add_pc_desc(PcDesc* pc_desc);
PcDesc* last_pc_desc() { return _pc_descs[0]; }
};
MarkForDeoptimizationStatus _mark_for_deoptimization_status; // Used for stack deoptimization
// set during construction unsignedint _has_unsafe_access:1; // May fault due to unsafe access. unsignedint _has_method_handle_invokes:1; // Has this method MethodHandle invokes? unsignedint _has_wide_vectors:1; // Preserve wide vectors at safepoints unsignedint _has_monitors:1; // Fastpath monitor detection for continuations
Method* _method;
address _scopes_data_begin; // All deoptee's will resume execution at this location described by // this address.
address _deopt_handler_begin; // All deoptee's at a MethodHandle call site will resume execution // at this location described by this offset.
address _deopt_mh_handler_begin;
enum { not_installed = -1, // in construction, only the owner doing the construction is // allowed to advance state
in_use = 0, // executable nmethod
not_used = 1, // not entrant, but revivable
not_entrant = 2, // marked for deoptimization but activations may still exist
};
// ScopeDesc retrieval operation
PcDesc* pc_desc_at(address pc) { return find_pc_desc(pc, false); } // pc_desc_near returns the first PcDesc at or after the given pc.
PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
// ScopeDesc for an instruction
ScopeDesc* scope_desc_at(address pc);
ScopeDesc* scope_desc_near(address pc);
bool update_recompile_counts() const { // Update recompile counts when either the update is explicitly requested (deoptimize) // or the nmethod is not marked for deoptimization at all (not_marked). // The latter happens during uncommon traps when deoptimized nmethod is made not entrant. return _mark_for_deoptimization_status != deoptimize_noupdate &&
_mark_for_deoptimization_status != deoptimize_done;
}
// tells whether frames described by this nmethod can be deoptimized // note: native wrappers cannot be deoptimized. bool can_be_deoptimized() const { return is_java_method(); }
address deopt_handler_begin() const { return _deopt_handler_begin; }
address* deopt_handler_begin_addr() { return &_deopt_handler_begin; } // Deopt // Return true is the PC is one would expect if the frame is being deopted. inlinebool is_deopt_pc(address pc); inlinebool is_deopt_mh_entry(address pc); inlinebool is_deopt_entry(address pc);
// Accessor/mutator for the original pc of a frame before a frame was deopted.
address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } void set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
// Execute nmethod barrier code, as if entering through nmethod call. void run_nmethod_entry_barrier();
// Verify and count cached icholder relocations. int verify_icholder_relocations(); void verify_oop_relocations();
bool has_evol_metadata();
// Fast breakpoint support. Tells if this compiled method is // dependent on the given method. Returns true if this nmethod // corresponds to the given method as well. virtualbool is_dependent_on_method(Method* dependee) = 0;
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.