annotate jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java @ 22672:1bbd4a7c274b

Rename jdk.internal.jvmci to jdk.vm.ci
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 08 Oct 2015 17:28:41 -0700
parents jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/CompilationRequest.java@545590b1ab83
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: 22625
diff changeset
23 package jdk.vm.ci.code;
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: 22625
diff changeset
25 import jdk.vm.ci.meta.ResolvedJavaMethod;
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 * Represents a request to compile a method.
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
29 */
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 public class 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
31
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 ResolvedJavaMethod method;
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
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 private final int 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
35
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
36 /**
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
37 * Creates a request to compile a method starting at its entry point.
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
38 *
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
39 * @param method the method to be compiled
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
40 */
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 public CompilationRequest(ResolvedJavaMethod method) {
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 this(method, -1);
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
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
45 /**
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 * 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
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 * @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
49 * @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
50 * method's entry point
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
51 */
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
52 public CompilationRequest(ResolvedJavaMethod method, int 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
53 assert method != null;
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
54 this.method = method;
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
55 this.entryBCI = 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
56 }
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
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 /**
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 * Gets the method to be compiled.
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 */
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 public ResolvedJavaMethod 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
62 return method;
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 }
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
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 /**
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 * Gets the bytecode index (BCI) at which to start compiling where -1 denotes a non-OSR
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 * compilation request and all other values denote an on stack replacement (OSR) compilation
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
68 * request.
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
69 */
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 public int getEntryBCI() {
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 return 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
72 }
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
73
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
74 @Override
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
75 public String toString() {
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
76 return method.format("%H.%n(%p)@" + entryBCI);
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
77 }
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
78 }