comparison src/share/vm/jvmci/jvmciCodeInstaller.cpp @ 21561:ce2113326bc8

Merge.
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 17:13:22 +0200
parents src/share/vm/graal/graalCodeInstaller.cpp@5cbaf1e9ff2e src/share/vm/graal/graalCodeInstaller.cpp@be896a1983c0
children b9f9b8af17ff
comparison
equal deleted inserted replaced
21560:a9fba0dfb155 21561:ce2113326bc8
388 void CodeInstaller::initialize_dependencies(oop compiled_code) { 388 void CodeInstaller::initialize_dependencies(oop compiled_code) {
389 JavaThread* thread = JavaThread::current(); 389 JavaThread* thread = JavaThread::current();
390 CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL; 390 CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL;
391 _oop_recorder = new OopRecorder(&_arena, true); 391 _oop_recorder = new OopRecorder(&_arena, true);
392 _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL); 392 _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL);
393 objArrayHandle assumptions = CompilationResult::assumptions(HotSpotCompiledCode::comp(compiled_code)); 393 objArrayHandle assumptions = HotSpotCompiledCode::assumptions(compiled_code);
394 if (!assumptions.is_null()) { 394 if (!assumptions.is_null()) {
395 int length = assumptions->length(); 395 int length = assumptions->length();
396 for (int i = 0; i < length; ++i) { 396 for (int i = 0; i < length; ++i) {
397 Handle assumption = assumptions->obj_at(i); 397 Handle assumption = assumptions->obj_at(i);
398 if (!assumption.is_null()) { 398 if (!assumption.is_null()) {
411 fatal("unexpected Assumption subclass"); 411 fatal("unexpected Assumption subclass");
412 } 412 }
413 } 413 }
414 } 414 }
415 } 415 }
416 objArrayHandle methods = CompilationResult::methods(HotSpotCompiledCode::comp(compiled_code)); 416 objArrayHandle methods = HotSpotCompiledCode::methods(compiled_code);
417 if (!methods.is_null()) { 417 if (!methods.is_null()) {
418 int length = methods->length(); 418 int length = methods->length();
419 for (int i = 0; i < length; ++i) { 419 for (int i = 0; i < length; ++i) {
420 Handle method_handle = methods->obj_at(i); 420 Handle method_handle = methods->obj_at(i);
421 methodHandle method = getMethodFromHotSpotMethod(method_handle()); 421 methodHandle method = getMethodFromHotSpotMethod(method_handle());
449 449
450 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words 450 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words
451 451
452 JVMCIEnv::CodeInstallResult result; 452 JVMCIEnv::CodeInstallResult result;
453 if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) { 453 if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
454 oop stubName = CompilationResult::name(HotSpotCompiledCode::comp(compiled_code_obj)); 454 oop stubName = HotSpotCompiledCode::name(compiled_code_obj);
455 char* name = strdup(java_lang_String::as_utf8_string(stubName)); 455 char* name = strdup(java_lang_String::as_utf8_string(stubName));
456 cb = RuntimeStub::new_runtime_stub(name, 456 cb = RuntimeStub::new_runtime_stub(name,
457 &buffer, 457 &buffer,
458 CodeOffsets::frame_never_safe, 458 CodeOffsets::frame_never_safe,
459 stack_slots, 459 stack_slots,
481 } 481 }
482 return result; 482 return result;
483 } 483 }
484 484
485 void CodeInstaller::initialize_fields(oop compiled_code) { 485 void CodeInstaller::initialize_fields(oop compiled_code) {
486 Handle comp_result = HotSpotCompiledCode::comp(compiled_code);
487 if (compiled_code->is_a(HotSpotCompiledNmethod::klass())) { 486 if (compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
488 Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code); 487 Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code);
489 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod()); 488 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod());
490 _parameter_count = method->size_of_parameters(); 489 _parameter_count = method->size_of_parameters();
491 TRACE_jvmci_1("installing code for %s", method->name_and_sig_as_C_string()); 490 TRACE_jvmci_1("installing code for %s", method->name_and_sig_as_C_string());
495 _parameter_count = 0; 494 _parameter_count = 0;
496 } 495 }
497 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); 496 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code));
498 _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code)); 497 _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code));
499 498
500 _code_handle = JNIHandles::make_local(CompilationResult::targetCode(comp_result)); 499 _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code));
501 _code_size = CompilationResult::targetCodeSize(comp_result); 500 _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code);
502 _total_frame_size = CompilationResult::totalFrameSize(comp_result); 501 _total_frame_size = HotSpotCompiledCode::totalFrameSize(compiled_code);
503 _custom_stack_area_offset = CompilationResult::customStackAreaOffset(comp_result); 502 _custom_stack_area_offset = HotSpotCompiledCode::customStackAreaOffset(compiled_code);
504 503
505 // Pre-calculate the constants section size. This is required for PC-relative addressing. 504 // Pre-calculate the constants section size. This is required for PC-relative addressing.
506 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code)); 505 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code));
507 guarantee(HotSpotCompiledCode::dataSectionAlignment(compiled_code) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin"); 506 guarantee(HotSpotCompiledCode::dataSectionAlignment(compiled_code) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin");
508 _constants_size = data_section()->length(); 507 _constants_size = data_section()->length();