Mercurial > hg > graal-jvmci-8
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTargetMethod.java @ 1437:9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Mon, 25 Oct 2010 16:47:52 +0200 |
parents | abc670a709dc |
children | 177398c6147d |
comparison
equal
deleted
inserted
replaced
1436:9dae1aae168a | 1437:9e5e83ca2259 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. | 2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. |
3 * | 3 * |
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is | 4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product |
5 * described in this document. In particular, and without limitation, these intellectual property rights may include one | 5 * that is described in this document. In particular, and without limitation, these intellectual property |
6 * or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent | 6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or |
7 * applications in the U.S. and in other countries. | 7 * more additional patents or pending patent applications in the U.S. and in other countries. |
8 * | 8 * |
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard | 9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun |
10 * license agreement and applicable provisions of the FAR and its supplements. | 10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its |
11 * supplements. | |
11 * | 12 * |
12 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or registered | 13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or |
13 * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and | 14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks |
14 * are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. | 15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the |
16 * U.S. and other countries. | |
15 * | 17 * |
16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. | 18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open |
19 * Company, Ltd. | |
17 */ | 20 */ |
18 package com.sun.hotspot.c1x; | 21 package com.sun.hotspot.c1x; |
19 | 22 |
20 import java.util.*; | 23 import java.util.*; |
21 | 24 |
26 /** | 29 /** |
27 * CiTargetMethod augmented with HotSpot-specific information. | 30 * CiTargetMethod augmented with HotSpot-specific information. |
28 * | 31 * |
29 * @author Lukas Stadler | 32 * @author Lukas Stadler |
30 */ | 33 */ |
31 public class HotSpotTargetMethod implements CompilerObject { | 34 public final class HotSpotTargetMethod implements CompilerObject { |
32 | 35 |
33 public final CiTargetMethod targetMethod; | 36 public final CiTargetMethod targetMethod; |
34 public final HotSpotMethodResolved method; // used only for methods | 37 public final HotSpotMethodResolved method; // used only for methods |
35 public final String name; // used only for stubs | 38 public final String name; // used only for stubs |
36 | 39 |
59 assert targetMethod.exceptionHandlers == null || targetMethod.exceptionHandlers.size() == 0; | 62 assert targetMethod.exceptionHandlers == null || targetMethod.exceptionHandlers.size() == 0; |
60 exceptionHandlers = null; | 63 exceptionHandlers = null; |
61 } | 64 } |
62 | 65 |
63 private Site[] getSortedSites(CiTargetMethod target) { | 66 private Site[] getSortedSites(CiTargetMethod target) { |
64 List<?>[] lists = new List<?>[] { target.directCalls, target.indirectCalls, target.safepoints, target.dataReferences, target.marks}; | 67 List<?>[] lists = new List<?>[] {target.directCalls, target.indirectCalls, target.safepoints, target.dataReferences, target.marks}; |
65 int count = 0; | 68 int count = 0; |
66 for (List<?> list : lists) { | 69 for (List<?> list : lists) { |
67 count += list.size(); | 70 count += list.size(); |
68 } | 71 } |
69 Site[] result = new Site[count]; | 72 Site[] result = new Site[count]; |
80 return s1 instanceof Mark ? -1 : 1; | 83 return s1 instanceof Mark ? -1 : 1; |
81 } | 84 } |
82 return s1.pcOffset - s2.pcOffset; | 85 return s1.pcOffset - s2.pcOffset; |
83 } | 86 } |
84 }); | 87 }); |
85 if (Logger.ENABLED) | 88 if (Logger.ENABLED) { |
86 for (Site site : result) | 89 for (Site site : result) { |
87 Logger.log(site.pcOffset + ": " + site); | 90 Logger.log(site.pcOffset + ": " + site); |
91 } | |
92 } | |
88 return result; | 93 return result; |
89 } | 94 } |
90 | 95 |
91 public static void installMethod(HotSpotMethodResolved method, CiTargetMethod targetMethod) { | 96 public static void installMethod(HotSpotMethodResolved method, CiTargetMethod targetMethod) { |
92 Compiler.getVMEntries().installMethod(new HotSpotTargetMethod(method, targetMethod)); | 97 Compiler.getVMEntries().installMethod(new HotSpotTargetMethod(method, targetMethod)); |