comparison src/share/vm/graal/graalCodeInstaller.cpp @ 18855:82e5b5ccdb0c

fix format string Contributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
author Doug Simon <doug.simon@oracle.com>
date Tue, 13 Jan 2015 13:04:37 +0100
parents aa4f2e3629ca
children 3fc907b46313
comparison
equal deleted inserted replaced
18854:b8d3f84740c7 18855:82e5b5ccdb0c
167 167
168 static void record_metadata_reference(oop obj, jlong prim, jboolean compressed, OopRecorder* oop_recorder) { 168 static void record_metadata_reference(oop obj, jlong prim, jboolean compressed, OopRecorder* oop_recorder) {
169 if (obj->is_a(HotSpotResolvedObjectTypeImpl::klass())) { 169 if (obj->is_a(HotSpotResolvedObjectTypeImpl::klass())) {
170 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(obj)); 170 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(obj));
171 if (compressed) { 171 if (compressed) {
172 assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ " INTPTR_FORMAT " != " INTPTR_FORMAT, klass->name()->as_C_string(), p2i(klass), prim)); 172 assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
173 } else { 173 } else {
174 assert((Klass*) prim == klass, err_msg("%s @ " INTPTR_FORMAT " != " INTPTR_FORMAT, klass->name()->as_C_string(), p2i(klass), prim)); 174 assert((Klass*) prim == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
175 } 175 }
176 int index = oop_recorder->find_index(klass); 176 int index = oop_recorder->find_index(klass);
177 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string()); 177 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string());
178 } else if (obj->is_a(HotSpotResolvedJavaMethodImpl::klass())) { 178 } else if (obj->is_a(HotSpotResolvedJavaMethodImpl::klass())) {
179 Method* method = (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(obj); 179 Method* method = (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(obj);
180 assert(!compressed, err_msg("unexpected compressed method pointer %s @ " INTPTR_FORMAT " = " INTPTR_FORMAT, method->name()->as_C_string(), p2i(method), prim)); 180 assert(!compressed, err_msg("unexpected compressed method pointer %s @ " INTPTR_FORMAT " = " PTR64_FORMAT, method->name()->as_C_string(), p2i(method), prim));
181 int index = oop_recorder->find_index(method); 181 int index = oop_recorder->find_index(method);
182 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), method->name()->as_C_string()); 182 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), method->name()->as_C_string());
183 } else { 183 } else {
184 assert(java_lang_String::is_instance(obj), 184 assert(java_lang_String::is_instance(obj),
185 err_msg("unexpected metadata reference (%s) for constant " JLONG_FORMAT " (" INTPTR_FORMAT ")", obj->klass()->name()->as_C_string(), prim, prim)); 185 err_msg("unexpected metadata reference (%s) for constant " JLONG_FORMAT " (" PTR64_FORMAT ")", obj->klass()->name()->as_C_string(), prim, prim));
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) {
561 if (!_instructions->allocates2(end_pc)) { 561 if (!_instructions->allocates2(end_pc)) {
562 return false; 562 return false;
563 } 563 }
564 memcpy(_instructions->start(), code()->base(T_BYTE), _code_size); 564 memcpy(_instructions->start(), code()->base(T_BYTE), _code_size);
565 _instructions->set_end(end_pc); 565 _instructions->set_end(end_pc);
566 566
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);
868 868
869 assert(!!hotspot_method ^ !!foreign_call, "Call site needs exactly one type"); 869 assert(!!hotspot_method ^ !!foreign_call, "Call site needs exactly one type");
870 870
871 NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset); 871 NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
872 jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method); 872 jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method);
873 873
874 if (debug_info != NULL) { 874 if (debug_info != NULL) {
875 oop frame = DebugInfo::bytecodePosition(debug_info); 875 oop frame = DebugInfo::bytecodePosition(debug_info);
876 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info)); 876 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));
877 if (frame != NULL) { 877 if (frame != NULL) {
878 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>()); 878 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>());