Path: blob/master/test/lib/sun/hotspot/code/NMethod.java
66644 views
/*1* Copyright (c) 2014, 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*/2223package sun.hotspot.code;2425import java.lang.reflect.Executable;26import sun.hotspot.WhiteBox;2728@Deprecated29public class NMethod extends CodeBlob {30private static final WhiteBox wb = WhiteBox.getWhiteBox();31public static NMethod get(Executable method, boolean isOsr) {32Object[] obj = wb.getNMethod(method, isOsr);33return obj == null ? null : new NMethod(obj);34}35private NMethod(Object[] obj) {36super((Object[])obj[0]);37assert obj.length == 5;38comp_level = (Integer) obj[1];39insts = (byte[]) obj[2];40compile_id = (Integer) obj[3];41entry_point = (Long) obj[4];42}43public final byte[] insts;44public final int comp_level;45public final int compile_id;46public final long entry_point;4748@Override49public String toString() {50return "NMethod{"51+ super.toString()52+ ", insts=" + insts53+ ", comp_level=" + comp_level54+ ", compile_id=" + compile_id55+ ", entry_point=" + entry_point56+ '}';57}58}596061