agent/src/share/classes/sun/jvm/hotspot/code/Location.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6706829 Cdiff agent/src/share/classes/sun/jvm/hotspot/code/Location.java

agent/src/share/classes/sun/jvm/hotspot/code/Location.java

Print this page

        

*** 1,7 **** /* ! * Copyright 2000-2005 Sun Microsystems, Inc. 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. --- 1,7 ---- /* ! * Copyright 2000-2008 Sun Microsystems, Inc. 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.
*** 37,49 **** nmethods. </P> <P> Encoding: </P> <PRE> bits: ! Where: [15] ! Type: [14..12] ! Offset: [11..0] </PRE> */ public class Location { static { --- 37,49 ---- nmethods. </P> <P> Encoding: </P> <PRE> bits: ! Type: [3..0] ! Where: [4] ! Offset: [31..5] </PRE> */ public class Location { static {
*** 67,76 **** --- 67,77 ---- WHERE_SHIFT = db.lookupIntConstant("Location::WHERE_SHIFT").intValue(); // Location::Type constants TYPE_NORMAL = db.lookupIntConstant("Location::normal").intValue(); TYPE_OOP = db.lookupIntConstant("Location::oop").intValue(); + TYPE_NARROWOOP = db.lookupIntConstant("Location::narrowoop").intValue(); TYPE_INT_IN_LONG = db.lookupIntConstant("Location::int_in_long").intValue(); TYPE_LNG = db.lookupIntConstant("Location::lng").intValue(); TYPE_FLOAT_IN_DBL = db.lookupIntConstant("Location::float_in_dbl").intValue(); TYPE_DBL = db.lookupIntConstant("Location::dbl").intValue(); TYPE_ADDR = db.lookupIntConstant("Location::addr").intValue();
*** 113,122 **** --- 114,125 ---- public static class Type { /** Ints, floats, double halves */ public static final Type NORMAL = new Type("normal"); /** Oop (please GC me!) */ public static final Type OOP = new Type("oop"); + /** NarrowOop (please GC me!) */ + public static final Type NARROWOOP = new Type("narrowoop"); /** Long held in one register */ public static final Type INT_IN_LONG = new Type("int_in_long"); /** Long held in one register */ public static final Type LNG = new Type("lng"); /** Float held in double register */
*** 140,149 **** --- 143,154 ---- public int getValue() { if (this == NORMAL) { return TYPE_NORMAL; } else if (this == OOP) { return TYPE_OOP; + } else if (this == NARROWOOP) { + return TYPE_NARROWOOP; } else if (this == INT_IN_LONG) { return TYPE_INT_IN_LONG; } else if (this == LNG) { return TYPE_LNG; } else if (this == FLOAT_IN_DBL) {
*** 168,177 **** --- 173,183 ---- private static int WHERE_SHIFT; // constants in Type enum private static int TYPE_NORMAL; private static int TYPE_OOP; + private static int TYPE_NARROWOOP; private static int TYPE_INT_IN_LONG; private static int TYPE_LNG; private static int TYPE_FLOAT_IN_DBL; private static int TYPE_DBL; private static int TYPE_ADDR;
*** 183,193 **** /** Create a bit-packed Location */ Location(Where where, Type type, int offset) { setWhere(where); setType(type); ! setOffset(offset & 0x0000FFFF); } public Where getWhere() { int where = (value & WHERE_MASK) >> WHERE_SHIFT; if (where == WHERE_ON_STACK) { --- 189,199 ---- /** Create a bit-packed Location */ Location(Where where, Type type, int offset) { setWhere(where); setType(type); ! setOffset(offset); } public Where getWhere() { int where = (value & WHERE_MASK) >> WHERE_SHIFT; if (where == WHERE_ON_STACK) {
*** 203,212 **** --- 209,220 ---- int type = (value & TYPE_MASK) >> TYPE_SHIFT; if (type == TYPE_NORMAL) { return Type.NORMAL; } else if (type == TYPE_OOP) { return Type.OOP; + } else if (type == TYPE_NARROWOOP) { + return Type.NARROWOOP; } else if (type == TYPE_INT_IN_LONG) { return Type.INT_IN_LONG; } else if (type == TYPE_LNG) { return Type.LNG; } else if (type == TYPE_FLOAT_IN_DBL) {
*** 236,245 **** --- 244,257 ---- public boolean holdsOop() { return getType() == Type.OOP; } + public boolean holdsNarrowOop() { + return getType() == Type.NARROWOOP; + } + public boolean holdsInt() { return getType() == Type.INT_IN_LONG; } public boolean holdsLong() {
*** 264,274 **** public int getStackOffset() { if (Assert.ASSERTS_ENABLED) { Assert.that(getWhere() == Where.ON_STACK, "wrong Where"); } ! return getOffset() << VM.getVM().getLogAddressSize(); } public int getRegisterNumber() { if (Assert.ASSERTS_ENABLED) { Assert.that(getWhere() == Where.IN_REGISTER, "wrong Where"); --- 276,286 ---- public int getStackOffset() { if (Assert.ASSERTS_ENABLED) { Assert.that(getWhere() == Where.ON_STACK, "wrong Where"); } ! return getOffset() * (int)VM.getVM().getIntSize(); } public int getRegisterNumber() { if (Assert.ASSERTS_ENABLED) { Assert.that(getWhere() == Where.IN_REGISTER, "wrong Where");
*** 294,303 **** --- 306,317 ---- Type type = getType(); if (type == Type.NORMAL) { } else if (type == Type.OOP) { tty.print(",oop"); + } else if (type == Type.NARROWOOP) { + tty.print(",narrowoop"); } else if (type == Type.INT_IN_LONG) { tty.print(",int"); } else if (type == Type.LNG) { tty.print(",long"); } else if (type == Type.FLOAT_IN_DBL) {
*** 312,339 **** } } /** Serialization of debugging information */ public Location(DebugInfoReadStream stream) { ! value = (0x0000FFFF & stream.readInt()); } // FIXME: not yet implementable // void write_on(DebugInfoWriteStream* stream); ! //-------------------------------------------------------------------------------- // Internals only below this point // private void setWhere(Where where) { ! value |= (where.getValue() << WHERE_SHIFT); } private void setType(Type type) { ! value |= (type.getValue() << TYPE_SHIFT); } private void setOffset(int offset) { ! value |= (offset << OFFSET_SHIFT); } } --- 326,353 ---- } } /** Serialization of debugging information */ public Location(DebugInfoReadStream stream) { ! value = stream.readInt(); } // FIXME: not yet implementable // void write_on(DebugInfoWriteStream* stream); ! //----------------------------------------------------------------------------- // Internals only below this point // private void setWhere(Where where) { ! value |= ((where.getValue() << WHERE_SHIFT) & WHERE_MASK); } private void setType(Type type) { ! value |= ((type.getValue() << TYPE_SHIFT) & TYPE_MASK); } private void setOffset(int offset) { ! value |= ((offset << OFFSET_SHIFT) & OFFSET_MASK); } }
agent/src/share/classes/sun/jvm/hotspot/code/Location.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File