comparison src/share/vm/graal/graalJavaAccess.cpp @ 17373:467ffc7f01cb

print InstanceKlass information when graalJavaAccess can't find a field
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 08 Oct 2014 11:46:00 -0700
parents 29e3ba750c9e
children c59612b9d110
comparison
equal deleted inserted replaced
17372:4a6e24a8fc2c 17373:467ffc7f01cb
27 #include "classfile/symbolTable.hpp" 27 #include "classfile/symbolTable.hpp"
28 // This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field. 28 // This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field.
29 // It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded. 29 // It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
30 30
31 void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field) { 31 void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field) {
32 InstanceKlass* ik = InstanceKlass::cast(klass);
32 Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name)); 33 Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
33 Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature)); 34 Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
34 if (name_symbol == NULL || signature_symbol == NULL) { 35 if (name_symbol == NULL || signature_symbol == NULL) {
36 #ifndef PRODUCT
37 ik->print_on(tty);
38 #endif
35 guarantee(false, err_msg("symbol with name %s and signature %s was not found in symbol table (klass=%s)", name, signature, klass->name()->as_C_string())); 39 guarantee(false, err_msg("symbol with name %s and signature %s was not found in symbol table (klass=%s)", name, signature, klass->name()->as_C_string()));
36 } 40 }
37 41
38 InstanceKlass* ik = InstanceKlass::cast(klass);
39 fieldDescriptor fd; 42 fieldDescriptor fd;
40 if (!ik->find_field(name_symbol, signature_symbol, &fd)) { 43 if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
41 ResourceMark rm; 44 ResourceMark rm;
42 fatal(err_msg("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name())); 45 fatal(err_msg("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name()));
43 } 46 }