comparison src/share/vm/graal/graalCodeInstaller.cpp @ 18266:ae181ec869c5

converted HotSpotMetaspaceConstant to an interface
author Doug Simon <doug.simon@oracle.com>
date Wed, 05 Nov 2014 21:55:55 +0100
parents f7d45e2426d4
children 56cc1a799a60
comparison
equal deleted inserted replaced
18265:f2d1fbba41b6 18266:ae181ec869c5
186 } 186 }
187 } 187 }
188 188
189 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectTypeImpl.klass()). 189 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectTypeImpl.klass()).
190 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) { 190 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) {
191 if (constant->is_a(HotSpotMetaspaceConstant::klass())) { 191 if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
192 oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant); 192 oop obj = HotSpotMetaspaceConstantImpl::metaspaceObject(constant);
193 jlong prim = HotSpotMetaspaceConstant::primitive(constant); 193 jlong prim = HotSpotMetaspaceConstantImpl::primitive(constant);
194 assert(Kind::typeChar(Value::kind(constant)) == 'j', "must have word kind"); 194 assert(Kind::typeChar(Value::kind(constant)) == 'j', "must have word kind");
195 assert(obj != NULL, "must have an object"); 195 assert(obj != NULL, "must have an object");
196 assert(prim != 0, "must have a primitive value"); 196 assert(prim != 0, "must have a primitive value");
197 197
198 record_metadata_reference(obj, prim, false, oop_recorder); 198 record_metadata_reference(obj, prim, false, oop_recorder);
199 } 199 }
200 } 200 }
201 201
202 static void record_metadata_in_patch(Handle& constant, OopRecorder* oop_recorder) { 202 static void record_metadata_in_patch(Handle& constant, OopRecorder* oop_recorder) {
203 record_metadata_reference(HotSpotMetaspaceConstant::metaspaceObject(constant), HotSpotMetaspaceConstant::primitive(constant), HotSpotMetaspaceConstant::compressed(constant), oop_recorder); 203 record_metadata_reference(HotSpotMetaspaceConstantImpl::metaspaceObject(constant), HotSpotMetaspaceConstantImpl::primitive(constant), HotSpotMetaspaceConstantImpl::compressed(constant), oop_recorder);
204 } 204 }
205 205
206 ScopeValue* CodeInstaller::get_scope_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second, OopRecorder* oop_recorder) { 206 ScopeValue* CodeInstaller::get_scope_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second, OopRecorder* oop_recorder) {
207 second = NULL; 207 second = NULL;
208 if (value == Value::ILLEGAL()) { 208 if (value == Value::ILLEGAL()) {
567 for (int i = 0; i < data_section_patches()->length(); i++) { 567 for (int i = 0; i < data_section_patches()->length(); i++) {
568 Handle patch = data_section_patches()->obj_at(i); 568 Handle patch = data_section_patches()->obj_at(i);
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(HotSpotMetaspaceConstantImpl::klass())) {
573 record_metadata_in_patch(constant, _oop_recorder); 573 record_metadata_in_patch(constant, _oop_recorder);
574 } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) { 574 } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
575 Handle obj = HotSpotObjectConstantImpl::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);
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(HotSpotObjectConstantImpl::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(HotSpotMetaspaceConstantImpl::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");
916 } 916 }
917 } else if (reference->is_a(CompilationResult_DataSectionReference::klass())) { 917 } else if (reference->is_a(CompilationResult_DataSectionReference::klass())) {