5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "code/compiledIC.hpp"
26 #include "compiler/compileBroker.hpp"
27 #include "compiler/disassembler.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "oops/objArrayOop.inline.hpp"
30 #include "runtime/javaCalls.hpp"
31 #include "jvmci/jvmciEnv.hpp"
32 #include "jvmci/jvmciCompiler.hpp"
33 #include "jvmci/jvmciCodeInstaller.hpp"
34 #include "jvmci/jvmciJavaClasses.hpp"
35 #include "jvmci/jvmciCompilerToVM.hpp"
36 #include "jvmci/jvmciRuntime.hpp"
37 #include "asm/register.hpp"
38 #include "classfile/vmSymbols.hpp"
39 #include "code/vmreg.hpp"
40
41 #ifdef TARGET_ARCH_x86
42 # include "vmreg_x86.inline.hpp"
43 #endif
44 #ifdef TARGET_ARCH_sparc
45 # include "vmreg_sparc.inline.hpp"
46 #endif
47 #ifdef TARGET_ARCH_zero
48 # include "vmreg_zero.inline.hpp"
49 #endif
50 #ifdef TARGET_ARCH_arm
51 # include "vmreg_arm.inline.hpp"
52 #endif
53 #ifdef TARGET_ARCH_ppc
54 # include "vmreg_ppc.inline.hpp"
55 #endif
56
57
58 // frequently used constants
59 // Allocate them with new so they are never destroyed (otherwise, a
60 // forced exit could destroy these objects while they are still in
61 // use).
62 ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
63 ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
64 ConstantIntValue* CodeInstaller::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
65 ConstantIntValue* CodeInstaller::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
66 ConstantIntValue* CodeInstaller::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
67 LocationValue* CodeInstaller::_illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
68
69 Method* getMethodFromHotSpotMethod(oop hotspot_method) {
70 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass()), "sanity");
71 return CompilerToVM::asMethod(hotspot_method);
72 }
73
74 VMReg getVMRegFromLocation(Handle location, int total_frame_size, TRAPS) {
75 if (location.is_null()) {
76 THROW_NULL(vmSymbols::java_lang_NullPointerException());
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "asm/register.hpp"
26 #include "classfile/vmSymbols.hpp"
27 #include "code/compiledIC.hpp"
28 #include "code/vmreg.inline.hpp"
29 #include "compiler/compileBroker.hpp"
30 #include "compiler/disassembler.hpp"
31 #include "jvmci/jvmciEnv.hpp"
32 #include "jvmci/jvmciCompiler.hpp"
33 #include "jvmci/jvmciCodeInstaller.hpp"
34 #include "jvmci/jvmciJavaClasses.hpp"
35 #include "jvmci/jvmciCompilerToVM.hpp"
36 #include "jvmci/jvmciRuntime.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "oops/objArrayOop.inline.hpp"
39 #include "runtime/javaCalls.hpp"
40
41 // frequently used constants
42 // Allocate them with new so they are never destroyed (otherwise, a
43 // forced exit could destroy these objects while they are still in
44 // use).
45 ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
46 ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
47 ConstantIntValue* CodeInstaller::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
48 ConstantIntValue* CodeInstaller::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
49 ConstantIntValue* CodeInstaller::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
50 LocationValue* CodeInstaller::_illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
51
52 Method* getMethodFromHotSpotMethod(oop hotspot_method) {
53 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass()), "sanity");
54 return CompilerToVM::asMethod(hotspot_method);
55 }
56
57 VMReg getVMRegFromLocation(Handle location, int total_frame_size, TRAPS) {
58 if (location.is_null()) {
59 THROW_NULL(vmSymbols::java_lang_NullPointerException());
|