Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/code/pcDesc.hpp
32285 views
/*1* Copyright (c) 1997, 2010, 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_VM_CODE_PCDESC_HPP25#define SHARE_VM_CODE_PCDESC_HPP2627#include "memory/allocation.hpp"2829// PcDescs map a physical PC (given as offset from start of nmethod) to30// the corresponding source scope and byte code index.3132class nmethod;3334class PcDesc VALUE_OBJ_CLASS_SPEC {35friend class VMStructs;36private:37int _pc_offset; // offset from start of nmethod38int _scope_decode_offset; // offset for scope in nmethod39int _obj_decode_offset;4041enum {42PCDESC_reexecute = 1 << 0,43PCDESC_is_method_handle_invoke = 1 << 1,44PCDESC_return_oop = 1 << 245};4647int _flags;4849void set_flag(int mask, bool z) {50_flags = z ? (_flags | mask) : (_flags & ~mask);51}5253public:54int pc_offset() const { return _pc_offset; }55int scope_decode_offset() const { return _scope_decode_offset; }56int obj_decode_offset() const { return _obj_decode_offset; }5758void set_pc_offset(int x) { _pc_offset = x; }59void set_scope_decode_offset(int x) { _scope_decode_offset = x; }60void set_obj_decode_offset(int x) { _obj_decode_offset = x; }6162// Constructor (only used for static in nmethod.cpp)63// Also used by ScopeDesc::sender()]64PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset);6566enum {67// upper and lower exclusive limits real offsets:68lower_offset_limit = -1,69upper_offset_limit = (unsigned int)-1 >> 170};7172// Flags73bool should_reexecute() const { return (_flags & PCDESC_reexecute) != 0; }74void set_should_reexecute(bool z) { set_flag(PCDESC_reexecute, z); }7576// Does pd refer to the same information as pd?77bool is_same_info(const PcDesc* pd) {78return _scope_decode_offset == pd->_scope_decode_offset &&79_obj_decode_offset == pd->_obj_decode_offset &&80_flags == pd->_flags;81}8283bool is_method_handle_invoke() const { return (_flags & PCDESC_is_method_handle_invoke) != 0; }84void set_is_method_handle_invoke(bool z) { set_flag(PCDESC_is_method_handle_invoke, z); }8586bool return_oop() const { return (_flags & PCDESC_return_oop) != 0; }87void set_return_oop(bool z) { set_flag(PCDESC_return_oop, z); }8889// Returns the real pc90address real_pc(const nmethod* code) const;9192void print(nmethod* code);93bool verify(nmethod* code);94};9596#endif // SHARE_VM_CODE_PCDESC_HPP979899