ciConstant.java revision 9883:903a2e023ffb
165543Scg/*
2137573Sru * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
365543Scg * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
465543Scg *
565543Scg * This code is free software; you can redistribute it and/or modify it
665543Scg * under the terms of the GNU General Public License version 2 only, as
765543Scg * published by the Free Software Foundation.
865543Scg *
965543Scg * This code is distributed in the hope that it will be useful, but WITHOUT
1065543Scg * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1165543Scg * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1265543Scg * version 2 for more details (a copy is included in the LICENSE file that
1365543Scg * accompanied this code).
1465543Scg *
1565543Scg * You should have received a copy of the GNU General Public License version
1665543Scg * 2 along with this work; if not, write to the Free Software Foundation,
1765543Scg * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1865543Scg *
1965543Scg * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2065543Scg * or visit www.oracle.com if you need additional information or have any
2165543Scg * questions.
2265543Scg *
2365543Scg */
2465543Scg
2565543Scgpackage sun.jvm.hotspot.ci;
26137500Sjulian
2765543Scgimport java.io.PrintStream;
2865543Scgimport java.util.*;
2965543Scgimport sun.jvm.hotspot.debugger.*;
3065543Scgimport sun.jvm.hotspot.runtime.*;
3165543Scgimport sun.jvm.hotspot.oops.*;
3265543Scgimport sun.jvm.hotspot.types.*;
3365543Scg
3465543Scgpublic class ciConstant extends VMObject {
3565543Scg  static {
3665543Scg    VM.registerVMInitializedObserver(new Observer() {
3765543Scg        public void update(Observable o, Object data) {
38119853Scg          initialize(VM.getVM().getTypeDataBase());
3965543Scg        }
4065543Scg      });
4165543Scg  }
4265543Scg
4365543Scg  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
4465543Scg    Type type      = db.lookupType("ciConstant");
45137500Sjulian    valueObjectField = type.getAddressField("_value._object");
46137500Sjulian    valueDoubleField = type.getJDoubleField("_value._double");
47137500Sjulian    valueFloatField = type.getJFloatField("_value._float");
4865543Scg    valueLongField = type.getJLongField("_value._long");
4965543Scg    valueIntField = type.getJIntField("_value._int");
50193640Sariff    typeField = new CIntField(type.getCIntegerField("_type"), 0);
51193640Sariff  }
52193640Sariff
53193640Sariff  private static AddressField valueObjectField;
5465543Scg  private static JDoubleField valueDoubleField;
5565543Scg  private static JFloatField valueFloatField;
56119287Simp  private static JLongField valueLongField;
57119287Simp  private static JIntField valueIntField;
5865543Scg  private static CIntField typeField;
5965543Scg
6065543Scg  public ciConstant(Address addr) {
6182180Scg    super(addr);
6282180Scg  }
6365543Scg
6465543Scg  public void dumpReplayData(PrintStream out) {
6565543Scg    // Nothing to be done
6665543Scg  }
6765543Scg}
6865543Scg