hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/cInterpreter.java
author trims
Thu, 27 May 2010 19:08:38 -0700
changeset 5547 f4b087cbb361
parent 1 489c9b5090e2
permissions -rw-r--r--
6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
     2
 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
package sun.jvm.hotspot.runtime.ia64;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
import java.util.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// import sun.jvm.hotspot.asm.ia64.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
import sun.jvm.hotspot.code.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
import sun.jvm.hotspot.compiler.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
import sun.jvm.hotspot.debugger.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
import sun.jvm.hotspot.oops.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
import sun.jvm.hotspot.runtime.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
import sun.jvm.hotspot.types.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
import sun.jvm.hotspot.utilities.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
/** Specialization of and implementation of abstract methods of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    Frame class for the ia64 family of CPUs. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
public class cInterpreter extends VMObject {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  private static final boolean DEBUG = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  private static AddressField bcpField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  private static AddressField localsField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  private static AddressField constantsField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  private static AddressField methodField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  private static AddressField stackField;       // i.e. tos
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  private static AddressField stackBaseField;   // ultimate bottom of stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  private static AddressField stackLimitField;  // ultimate top of stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  private static AddressField monitorBaseField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  private static CIntegerField messageField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  private static AddressField prevFieldField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  private static AddressField wrapperField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  private static AddressField prevField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  private static int NO_REQUEST;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  private static int INITIALIZE;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  private static int METHOD_ENTRY;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  private static int METHOD_RESUME;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  private static int GOT_MONITORS;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  private static int RETHROW_EXCEPTION;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  private static int CALL_METHOD;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  private static int RETURN_FROM_METHOD;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  private static int RETRY_METHOD;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  private static int MORE_MONITORS;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  private static int THROWING_EXCEPTION;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  private static int POPPING_FRAME;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  static {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    VM.registerVMInitializedObserver(new Observer() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
        public void update(Observable o, Object data) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
          initialize(VM.getVM().getTypeDataBase());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
      });
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  private static synchronized void initialize(TypeDataBase db) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    Type cInterpreterType = db.lookupType("cInterpreter");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    bcpField = cInterpreterType.getAddressField("_bcp");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    localsField = cInterpreterType.getAddressField("_locals");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    constantsField = cInterpreterType.getAddressField("_constants");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    methodField = cInterpreterType.getAddressField("_method");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    stackField = cInterpreterType.getAddressField("_stack");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    stackBaseField = cInterpreterType.getAddressField("_stack_base");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    stackLimitField = cInterpreterType.getAddressField("_stack_limit");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    monitorBaseField = cInterpreterType.getAddressField("_monitor_base");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    // messageField = cInterpreterType.getCIntegerField("_msg");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    messageField = null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    wrapperField = cInterpreterType.getAddressField("_wrapper");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    prevField = cInterpreterType.getAddressField("_prev_link");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    /*
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    NO_REQUEST = db.lookupIntConstant("no_request").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    INITIALIZE = db.lookupIntConstant("initialize").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    METHOD_ENTRY = db.lookupIntConstant("method_entry").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
    METHOD_RESUME = db.lookupIntConstant("method_resume").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    GOT_MONITORS = db.lookupIntConstant("got_monitors").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    RETHROW_EXCEPTION = db.lookupIntConstant("rethrow_exception").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    CALL_METHOD = db.lookupIntConstant("call_method").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    RETURN_FROM_METHOD = db.lookupIntConstant("return_from_method").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    RETRY_METHOD = db.lookupIntConstant("retry_method").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    MORE_MONITORS = db.lookupIntConstant("more_monitors").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    THROWING_EXCEPTION = db.lookupIntConstant("throwing_exception").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    POPPING_FRAME = db.lookupIntConstant("popping_frame").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  public cInterpreter(Address addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
    super(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  public Address prev() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    return prevField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  public Address locals() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    Address val = localsField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  public Address localsAddr() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    Address localsAddr = localsField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    return localsAddr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  public Address bcp() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    Address val = bcpField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  public Address bcpAddr() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    Address bcpAddr = addr.addOffsetTo(bcpField.getOffset());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    return bcpAddr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  public Address constants() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    Address val = constantsField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  public Address constantsAddr() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    Address constantsAddr = constantsField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    return constantsAddr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  public Address method() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    Address val = methodField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  public Address methodAddr() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
    Address methodAddr = addr.addOffsetTo(methodField.getOffset());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    return methodAddr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  public Address stack() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    Address val = stackField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  public Address stackBase() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    Address val = stackBaseField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  public Address stackLimit() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
    Address val = stackLimitField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  public Address monitorBase() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    Address val = monitorBaseField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  public Address wrapper() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    return wrapperField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  public int message() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
    int val = (int) messageField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    return val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
}