comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotVMConfig.java @ 1423:760213a60e8b

* rewrite of the code installation * partial support for safepoints * macro-based CiTargetMethod interface * code stub support
author Lukas Stadler <lukas.stadler@oracle.com>
date Mon, 16 Aug 2010 18:59:36 -0700
parents 3483ec571caf
children 98fffb304868
comparison
equal deleted inserted replaced
1422:3483ec571caf 1423:760213a60e8b
15 * 15 *
16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. 16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.
17 */ 17 */
18 package com.sun.hotspot.c1x; 18 package com.sun.hotspot.c1x;
19 19
20 import com.sun.cri.ci.*;
21
20 /** 22 /**
21 * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod. 23 * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod.
22 * 24 *
23 * @author Lukas Stadler 25 * @author Lukas Stadler
24 */ 26 */
25 public class HotSpotVMConfig { 27 public class HotSpotVMConfig implements CompilerObject {
26 28
27 // os information, register layout, code generation, ... 29 // os information, register layout, code generation, ...
28 public boolean windowsOs; 30 public boolean windowsOs;
29 public int codeEntryAlignment; 31 public int codeEntryAlignment;
30 32
31 // offsets, ... 33 // offsets, ...
32 public int vmPageSize; 34 public int vmPageSize;
33 public int stackShadowPages; 35 public int stackShadowPages;
34 public int hubOffset; 36 public int hubOffset;
35 public int arrayLengthOffset; 37 public int arrayLengthOffset;
38 public int[] arrayOffsets;
39 public int arrayClassElementOffset;
36 40
37 // runtime stubs 41 // runtime stubs
38 public long instanceofStub; 42 public long instanceofStub;
39 public long debugStub; 43 public long debugStub;
44 public long resolveStaticCallStub;
40 45
41 public void check() { 46 public void check() {
42 assert vmPageSize >= 16; 47 assert vmPageSize >= 16;
43 assert codeEntryAlignment > 0; 48 assert codeEntryAlignment > 0;
44 assert stackShadowPages > 0; 49 assert stackShadowPages > 0;
45 assert instanceofStub != 0; 50 }
46 assert debugStub != 0; 51
47 System.out.println("Config::debugStub = " + Long.toHexString(debugStub)); 52 public int getArrayOffset(CiKind kind) {
48 System.out.println("Config::instanceofStub = " + Long.toHexString(instanceofStub)); 53 return arrayOffsets[getKindNumber(kind)];
54 }
55
56 private int getKindNumber(CiKind kind) {
57 if (kind == CiKind.Boolean)
58 return 0;
59 else if (kind == CiKind.Byte)
60 return 1;
61 else if (kind == CiKind.Short)
62 return 2;
63 else if (kind == CiKind.Char)
64 return 3;
65 else if (kind == CiKind.Int)
66 return 4;
67 else if (kind == CiKind.Float)
68 return 5;
69 else if (kind == CiKind.Long)
70 return 6;
71 else if (kind == CiKind.Double)
72 return 7;
73 else if (kind == CiKind.Object)
74 return 8;
75 else
76 throw new RuntimeException(kind + " is not a Java kind");
49 } 77 }
50 78
51 } 79 }