annotate agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Registers.java @ 1552:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents a61af66fc99e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.asm.amd64;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import sun.jvm.hotspot.utilities.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 public class AMD64Registers {
a61af66fc99e Initial load
duke
parents:
diff changeset
30 public static final int NUM_REGISTERS = 16;
a61af66fc99e Initial load
duke
parents:
diff changeset
31
a61af66fc99e Initial load
duke
parents:
diff changeset
32 public static final AMD64Register RAX;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 public static final AMD64Register RCX;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public static final AMD64Register RDX;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public static final AMD64Register RBX;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public static final AMD64Register RSP;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public static final AMD64Register RBP;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public static final AMD64Register RSI;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 public static final AMD64Register RDI;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public static final AMD64Register R8;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public static final AMD64Register R9;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 public static final AMD64Register R10;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public static final AMD64Register R11;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 public static final AMD64Register R12;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 public static final AMD64Register R13;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public static final AMD64Register R14;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public static final AMD64Register R15;
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 private static final AMD64Register[] registers;
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 RAX = new AMD64Register(0, "rax");
a61af66fc99e Initial load
duke
parents:
diff changeset
53 RCX = new AMD64Register(1, "rcx");
a61af66fc99e Initial load
duke
parents:
diff changeset
54 RDX = new AMD64Register(2, "rdx");
a61af66fc99e Initial load
duke
parents:
diff changeset
55 RBX = new AMD64Register(3, "rbx");
a61af66fc99e Initial load
duke
parents:
diff changeset
56 RSP = new AMD64Register(4, "rsp");
a61af66fc99e Initial load
duke
parents:
diff changeset
57 RBP = new AMD64Register(5, "rbp");
a61af66fc99e Initial load
duke
parents:
diff changeset
58 RSI = new AMD64Register(6, "rsi");
a61af66fc99e Initial load
duke
parents:
diff changeset
59 RDI = new AMD64Register(7, "rdi");
a61af66fc99e Initial load
duke
parents:
diff changeset
60 R8 = new AMD64Register(8, "r8" );
a61af66fc99e Initial load
duke
parents:
diff changeset
61 R9 = new AMD64Register(9, "r9" );
a61af66fc99e Initial load
duke
parents:
diff changeset
62 R10 = new AMD64Register(10,"r10");
a61af66fc99e Initial load
duke
parents:
diff changeset
63 R11 = new AMD64Register(11,"r11");
a61af66fc99e Initial load
duke
parents:
diff changeset
64 R12 = new AMD64Register(12,"r12");
a61af66fc99e Initial load
duke
parents:
diff changeset
65 R13 = new AMD64Register(13,"r13");
a61af66fc99e Initial load
duke
parents:
diff changeset
66 R14 = new AMD64Register(14,"r14");
a61af66fc99e Initial load
duke
parents:
diff changeset
67 R15 = new AMD64Register(15,"r15");
a61af66fc99e Initial load
duke
parents:
diff changeset
68 registers = new AMD64Register[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI,
a61af66fc99e Initial load
duke
parents:
diff changeset
70 R8, R9, R10, R11, R12, R13, R14, R15
a61af66fc99e Initial load
duke
parents:
diff changeset
71 };
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 public static int getNumberOfRegisters() {
a61af66fc99e Initial load
duke
parents:
diff changeset
75 return NUM_REGISTERS;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 }
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public static AMD64Register getRegister(int regNum) {
a61af66fc99e Initial load
duke
parents:
diff changeset
79 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 return registers[regNum];
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 //Return the register name
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public static String getRegisterName(int regNum) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90 return registers[regNum].toString();
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }