comparison src/share/vm/graal/graalCodeInstaller.cpp @ 18262:f7d45e2426d4

converted HotSpotObjectConstant to an interface
author Doug Simon <doug.simon@oracle.com>
date Wed, 05 Nov 2014 21:07:59 +0100
parents 4221c8332c34
children ae181ec869c5
comparison
equal deleted inserted replaced
18261:d66c79acfeac 18262:f7d45e2426d4
313 } else { 313 } else {
314 assert(reference, "unexpected object constant type"); 314 assert(reference, "unexpected object constant type");
315 if (value->is_a(NullConstant::klass()) || value->is_a(HotSpotCompressedNullConstant::klass())) { 315 if (value->is_a(NullConstant::klass()) || value->is_a(HotSpotCompressedNullConstant::klass())) {
316 return _oop_null_scope_value; 316 return _oop_null_scope_value;
317 } else { 317 } else {
318 assert(value->is_a(HotSpotObjectConstant::klass()), "unexpected constant type"); 318 assert(value->is_a(HotSpotObjectConstantImpl::klass()), "unexpected constant type");
319 oop obj = HotSpotObjectConstant::object(value); 319 oop obj = HotSpotObjectConstantImpl::object(value);
320 assert(obj != NULL, "null value must be in NullConstant"); 320 assert(obj != NULL, "null value must be in NullConstant");
321 return new ConstantOopWriteValue(JNIHandles::make_local(obj)); 321 return new ConstantOopWriteValue(JNIHandles::make_local(obj));
322 } 322 }
323 } 323 }
324 } else if (value->is_a(VirtualObject::klass())) { 324 } else if (value->is_a(VirtualObject::klass())) {
569 Handle reference = CompilationResult_DataPatch::reference(patch); 569 Handle reference = CompilationResult_DataPatch::reference(patch);
570 assert(reference->is_a(CompilationResult_ConstantReference::klass()), err_msg("patch in data section must be a ConstantReference")); 570 assert(reference->is_a(CompilationResult_ConstantReference::klass()), err_msg("patch in data section must be a ConstantReference"));
571 Handle constant = CompilationResult_ConstantReference::constant(reference); 571 Handle constant = CompilationResult_ConstantReference::constant(reference);
572 if (constant->is_a(HotSpotMetaspaceConstant::klass())) { 572 if (constant->is_a(HotSpotMetaspaceConstant::klass())) {
573 record_metadata_in_patch(constant, _oop_recorder); 573 record_metadata_in_patch(constant, _oop_recorder);
574 } else if (constant->is_a(HotSpotObjectConstant::klass())) { 574 } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
575 Handle obj = HotSpotObjectConstant::object(constant); 575 Handle obj = HotSpotObjectConstantImpl::object(constant);
576 jobject value = JNIHandles::make_local(obj()); 576 jobject value = JNIHandles::make_local(obj());
577 int oop_index = _oop_recorder->find_index(value); 577 int oop_index = _oop_recorder->find_index(value);
578 578
579 address dest = _constants->start() + CompilationResult_Site::pcOffset(patch); 579 address dest = _constants->start() + CompilationResult_Site::pcOffset(patch);
580 if (HotSpotObjectConstant::compressed(constant)) { 580 if (HotSpotObjectConstantImpl::compressed(constant)) {
581 #ifdef _LP64 581 #ifdef _LP64
582 _constants->relocate(dest, oop_Relocation::spec(oop_index), relocInfo::narrow_oop_in_const); 582 _constants->relocate(dest, oop_Relocation::spec(oop_index), relocInfo::narrow_oop_in_const);
583 #else 583 #else
584 fatal("unexpected compressed oop in 32-bit mode"); 584 fatal("unexpected compressed oop in 32-bit mode");
585 #endif 585 #endif
905 905
906 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) { 906 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
907 oop reference = CompilationResult_DataPatch::reference(site); 907 oop reference = CompilationResult_DataPatch::reference(site);
908 if (reference->is_a(CompilationResult_ConstantReference::klass())) { 908 if (reference->is_a(CompilationResult_ConstantReference::klass())) {
909 Handle constant = CompilationResult_ConstantReference::constant(reference); 909 Handle constant = CompilationResult_ConstantReference::constant(reference);
910 if (constant->is_a(HotSpotObjectConstant::klass())) { 910 if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
911 pd_patch_OopConstant(pc_offset, constant); 911 pd_patch_OopConstant(pc_offset, constant);
912 } else if (constant->is_a(HotSpotMetaspaceConstant::klass())) { 912 } else if (constant->is_a(HotSpotMetaspaceConstant::klass())) {
913 record_metadata_in_patch(constant, _oop_recorder); 913 record_metadata_in_patch(constant, _oop_recorder);
914 } else { 914 } else {
915 fatal("unknown constant type in data patch"); 915 fatal("unknown constant type in data patch");