Path: blob/master/test/lib/sun/hotspot/code/NMethod.java
41149 views
/*1* Copyright (c) 2014, 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;2728public class NMethod extends CodeBlob {29private static final WhiteBox wb = WhiteBox.getWhiteBox();30public static NMethod get(Executable method, boolean isOsr) {31Object[] obj = wb.getNMethod(method, isOsr);32return obj == null ? null : new NMethod(obj);33}34private NMethod(Object[] obj) {35super((Object[])obj[0]);36assert obj.length == 5;37comp_level = (Integer) obj[1];38insts = (byte[]) obj[2];39compile_id = (Integer) obj[3];40entry_point = (Long) obj[4];41}42public final byte[] insts;43public final int comp_level;44public final int compile_id;45public final long entry_point;4647@Override48public String toString() {49return "NMethod{"50+ super.toString()51+ ", insts=" + insts52+ ", comp_level=" + comp_level53+ ", compile_id=" + compile_id54+ ", entry_point=" + entry_point55+ '}';56}57}585960