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 #include "utilities/align.hpp"
41
42 // frequently used constants
43 // Allocate them with new so they are never destroyed (otherwise, a
44 // forced exit could destroy these objects while they are still in
45 // use).
46 ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
47 ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
48 ConstantIntValue* CodeInstaller::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
49 ConstantIntValue* CodeInstaller::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
50 ConstantIntValue* CodeInstaller::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
51 LocationValue* CodeInstaller::_illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
52
53 Method* getMethodFromHotSpotMethod(oop hotspot_method) {
54 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass()), "sanity");
55 return CompilerToVM::asMethod(hotspot_method);
56 }
57
58 VMReg getVMRegFromLocation(Handle location, int total_frame_size, TRAPS) {
59 if (location.is_null()) {
60 THROW_NULL(vmSymbols::java_lang_NullPointerException());
61 }
62
63 Handle reg(THREAD, code_Location::reg(location));
64 jint offset = code_Location::offset(location);
65
66 if (reg.not_null()) {
67 // register
68 jint number = code_Register::number(reg);
|
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 #include "utilities/align.hpp"
41
42 // frequently used constants
43 // Allocate them with new so they are never destroyed (otherwise, a
44 // forced exit could destroy these objects while they are still in
45 // use).
46 ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
47 ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
48 ConstantIntValue* CodeInstaller::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue((jint)0);
49 ConstantIntValue* CodeInstaller::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
50 ConstantIntValue* CodeInstaller::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
51 LocationValue* CodeInstaller::_illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
52
53 Method* getMethodFromHotSpotMethod(oop hotspot_method) {
54 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass()), "sanity");
55 return CompilerToVM::asMethod(hotspot_method);
56 }
57
58 VMReg getVMRegFromLocation(Handle location, int total_frame_size, TRAPS) {
59 if (location.is_null()) {
60 THROW_NULL(vmSymbols::java_lang_NullPointerException());
61 }
62
63 Handle reg(THREAD, code_Location::reg(location));
64 jint offset = code_Location::offset(location);
65
66 if (reg.not_null()) {
67 // register
68 jint number = code_Register::number(reg);
|