comparison src/share/vm/graal/graalCodeInstaller.cpp @ 19306:a0a760b0fb5f

pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
author Doug Simon <doug.simon@oracle.com>
date Thu, 12 Feb 2015 01:54:05 +0100
parents 063e8873bd14
children 98592ae4b1fa
comparison
equal deleted inserted replaced
19305:48bdad77afcd 19306:a0a760b0fb5f
382 } 382 }
383 383
384 return new MonitorValue(owner_value, lock_data_loc, eliminated); 384 return new MonitorValue(owner_value, lock_data_loc, eliminated);
385 } 385 }
386 386
387 void CodeInstaller::initialize_assumptions(oop compiled_code) { 387 void CodeInstaller::initialize_dependencies(oop compiled_code) {
388 JavaThread* thread = JavaThread::current(); 388 JavaThread* thread = JavaThread::current();
389 CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL; 389 CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL;
390 _oop_recorder = new OopRecorder(&_arena, true); 390 _oop_recorder = new OopRecorder(&_arena, true);
391 _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL); 391 _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL);
392 objArrayHandle assumptions = CompilationResult::assumptions(HotSpotCompiledCode::comp(compiled_code)); 392 objArrayHandle assumptions = CompilationResult::assumptions(HotSpotCompiledCode::comp(compiled_code));
393 if (!assumptions.is_null()) { 393 if (!assumptions.is_null()) {
394 int length = assumptions->length(); 394 int length = assumptions->length();
395 for (int i = 0; i < length; ++i) { 395 for (int i = 0; i < length; ++i) {
396 Handle assumption = assumptions->obj_at(i); 396 Handle assumption = assumptions->obj_at(i);
397 if (!assumption.is_null()) { 397 if (!assumption.is_null()) {
398 if (assumption->klass() == Assumptions_MethodContents::klass()) { 398 if (assumption->klass() == Assumptions_NoFinalizableSubclass::klass()) {
399 assumption_MethodContents(assumption);
400 } else if (assumption->klass() == Assumptions_NoFinalizableSubclass::klass()) {
401 assumption_NoFinalizableSubclass(assumption); 399 assumption_NoFinalizableSubclass(assumption);
402 } else if (assumption->klass() == Assumptions_ConcreteSubtype::klass()) { 400 } else if (assumption->klass() == Assumptions_ConcreteSubtype::klass()) {
403 assumption_ConcreteSubtype(assumption); 401 assumption_ConcreteSubtype(assumption);
404 } else if (assumption->klass() == Assumptions_ConcreteMethod::klass()) { 402 } else if (assumption->klass() == Assumptions_ConcreteMethod::klass()) {
405 assumption_ConcreteMethod(assumption); 403 assumption_ConcreteMethod(assumption);
410 fatal("unexpected Assumption subclass"); 408 fatal("unexpected Assumption subclass");
411 } 409 }
412 } 410 }
413 } 411 }
414 } 412 }
413 objArrayHandle methods = CompilationResult::methods(HotSpotCompiledCode::comp(compiled_code));
414 if (!methods.is_null()) {
415 int length = methods->length();
416 for (int i = 0; i < length; ++i) {
417 Handle method_handle = methods->obj_at(i);
418 methodHandle method = getMethodFromHotSpotMethod(method_handle());
419 _dependencies->assert_evol_method(method());
420 }
421 }
415 } 422 }
416 423
417 // constructor used to create a method 424 // constructor used to create a method
418 GraalEnv::CodeInstallResult CodeInstaller::install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log) { 425 GraalEnv::CodeInstallResult CodeInstaller::install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log) {
419 BufferBlob* buffer_blob = GraalRuntime::initialize_buffer_blob(); 426 BufferBlob* buffer_blob = GraalRuntime::initialize_buffer_blob();
421 return GraalEnv::cache_full; 428 return GraalEnv::cache_full;
422 } 429 }
423 430
424 CodeBuffer buffer(buffer_blob); 431 CodeBuffer buffer(buffer_blob);
425 jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); 432 jobject compiled_code_obj = JNIHandles::make_local(compiled_code());
426 initialize_assumptions(JNIHandles::resolve(compiled_code_obj)); 433 initialize_dependencies(JNIHandles::resolve(compiled_code_obj));
427 434
428 // Get instructions and constants CodeSections early because we need it. 435 // Get instructions and constants CodeSections early because we need it.
429 _instructions = buffer.insts(); 436 _instructions = buffer.insts();
430 _constants = buffer.consts(); 437 _constants = buffer.consts();
431 438
634 buffer.block_comment(offset, text); 641 buffer.block_comment(offset, text);
635 } 642 }
636 } 643 }
637 #endif 644 #endif
638 return true; 645 return true;
639 }
640
641 void CodeInstaller::assumption_MethodContents(Handle assumption) {
642 Handle method_handle = Assumptions_MethodContents::method(assumption());
643 methodHandle method = getMethodFromHotSpotMethod(method_handle());
644 _dependencies->assert_evol_method(method());
645 } 646 }
646 647
647 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) { 648 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) {
648 Handle receiverType_handle = Assumptions_NoFinalizableSubclass::receiverType(assumption()); 649 Handle receiverType_handle = Assumptions_NoFinalizableSubclass::receiverType(assumption());
649 Klass* receiverType = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(receiverType_handle)); 650 Klass* receiverType = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(receiverType_handle));