annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java @ 24127:6d70d9c43369

added ResolvedJavaType.isPlatformType (JDK-8177845)
author Doug Simon <doug.simon@oracle.com>
date Sat, 15 Apr 2017 23:54:19 +0200
parents 1bbd4a7c274b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22623
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22669
diff changeset
23 package jdk.vm.ci.hotspot;
22623
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22669
diff changeset
25 import jdk.vm.ci.code.CompilationRequest;
22623
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 /**
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 * A compilation request with extra HotSpot specific context such as a compilation identifier and
22625
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
29 * the address of a {@code JVMCIEnv} object that provides native context for a compilation.
22623
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 */
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 public class HotSpotCompilationRequest extends CompilationRequest {
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 private final long jvmciEnv;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 private final int id;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34
22625
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
35 /**
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
36 * Creates a request to compile a method starting at a given BCI and allocates an identifier to
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
37 * the request.
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
38 *
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
39 * @param method the method to be compiled
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
40 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
41 * method's entry point
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
42 * @param jvmciEnv address of a native {@code JVMCIEnv} object or 0L
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
43 */
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
44 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv) {
22669
e1ec715b88d0 Fix HotSpotCompilationRequest constructor
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22625
diff changeset
45 this(method, entryBCI, jvmciEnv, method.allocateCompileId(entryBCI));
22625
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
46 }
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
47
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
48 /**
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
49 * Creates a request to compile a method starting at a given BCI.
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
50 *
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
51 * @param method the method to be compiled
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
52 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
53 * method's entry point
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
54 * @param jvmciEnv address of a native {@code JVMCIEnv} object or 0L
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
55 * @param id an identifier for the request
545590b1ab83 expanded CodeCacheProvider so that it supports all forms of code installation and made CompilerToVM.installCode package-private
Doug Simon <doug.simon@oracle.com>
parents: 22623
diff changeset
56 */
22623
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) {
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 super(method, entryBCI);
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 this.jvmciEnv = jvmciEnv;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 this.id = id;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 }
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 @Override
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 public HotSpotResolvedJavaMethod getMethod() {
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 return (HotSpotResolvedJavaMethod) super.getMethod();
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 }
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 /**
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
69 * Gets the address of the native {@code JVMCIEnv} object or 0L if no such object exists.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 */
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 public long getJvmciEnv() {
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 return jvmciEnv;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 }
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 /**
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
76 * Gets the VM allocated identifier for this compilation.
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 */
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 public int getId() {
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79 return id;
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80 }
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81
bec9cd4e731a added CompilationRequest to package up a compilation request and be able to add VM specific context
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 }