Mercurial > hg > truffle
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 3636:c7d4198a9bce
Use GraalEnv for installing code.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 15 Nov 2011 22:06:02 +0100 |
parents | 5e9645341ec3 |
children | 0e8a2a629afb |
comparison
equal
deleted
inserted
replaced
3635:cb1181db8bec | 3636:c7d4198a9bce |
---|---|
25 #include "graal/graalCompiler.hpp" | 25 #include "graal/graalCompiler.hpp" |
26 #include "graal/graalCodeInstaller.hpp" | 26 #include "graal/graalCodeInstaller.hpp" |
27 #include "graal/graalJavaAccess.hpp" | 27 #include "graal/graalJavaAccess.hpp" |
28 #include "graal/graalVMEntries.hpp" | 28 #include "graal/graalVMEntries.hpp" |
29 #include "graal/graalVmIds.hpp" | 29 #include "graal/graalVmIds.hpp" |
30 #include "graal/graalEnv.hpp" | |
30 #include "c1/c1_Runtime1.hpp" | 31 #include "c1/c1_Runtime1.hpp" |
31 #include "classfile/vmSymbols.hpp" | 32 #include "classfile/vmSymbols.hpp" |
32 #include "vmreg_x86.inline.hpp" | 33 #include "vmreg_x86.inline.hpp" |
33 | 34 |
34 | 35 |
230 } | 231 } |
231 | 232 |
232 // constructor used to create a method | 233 // constructor used to create a method |
233 CodeInstaller::CodeInstaller(Handle target_method, nmethod*& nm, bool install_code) { | 234 CodeInstaller::CodeInstaller(Handle target_method, nmethod*& nm, bool install_code) { |
234 _env = CURRENT_ENV; | 235 _env = CURRENT_ENV; |
235 ciMethod *ciMethodObject = NULL; | 236 methodOop method = NULL; |
236 { | 237 { |
237 methodOop method = getMethodFromHotSpotMethod(HotSpotTargetMethod::method(target_method)); | 238 method = getMethodFromHotSpotMethod(HotSpotTargetMethod::method(target_method)); |
238 ciMethodObject = (ciMethod *) _env->get_object(method); | |
239 _parameter_count = method->size_of_parameters(); | 239 _parameter_count = method->size_of_parameters(); |
240 | 240 |
241 No_Safepoint_Verifier no_safepoint; | 241 No_Safepoint_Verifier no_safepoint; |
242 | 242 |
243 initialize_fields(target_method); | 243 initialize_fields(target_method); |
253 initialize_buffer(buffer); | 253 initialize_buffer(buffer); |
254 process_exception_handlers(); | 254 process_exception_handlers(); |
255 | 255 |
256 int stack_slots = (_frame_size / HeapWordSize) + 2; // conversion to words, need to add two slots for ret address and frame pointer | 256 int stack_slots = (_frame_size / HeapWordSize) + 2; // conversion to words, need to add two slots for ret address and frame pointer |
257 ThreadToNativeFromVM t((JavaThread*) Thread::current()); | 257 ThreadToNativeFromVM t((JavaThread*) Thread::current()); |
258 nm = _env->register_method(ciMethodObject, -1, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, | 258 nm = GraalEnv::register_method(method, -1, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, |
259 &_implicit_exception_table, GraalCompiler::instance(), _env->comp_level(), false, false, install_code); | 259 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, false, false, install_code); |
260 } | 260 } |
261 | 261 |
262 // constructor used to create a stub | 262 // constructor used to create a stub |
263 CodeInstaller::CodeInstaller(Handle target_method, jlong& id) { | 263 CodeInstaller::CodeInstaller(Handle target_method, jlong& id) { |
264 No_Safepoint_Verifier no_safepoint; | 264 No_Safepoint_Verifier no_safepoint; |