src/share/vm/classfile/classFileParser.cpp

Print this page




2320   u2 sourcefile_index = cfs->get_u2_fast();
2321   check_property(
2322     valid_cp_range(sourcefile_index, cp->length()) &&
2323       cp->tag_at(sourcefile_index).is_utf8(),
2324     "Invalid SourceFile attribute at constant pool index %u in class file %s",
2325     sourcefile_index, CHECK);
2326   k->set_source_file_name(cp->symbol_at(sourcefile_index));
2327 }
2328 
2329 
2330 
2331 void ClassFileParser::parse_classfile_source_debug_extension_attribute(constantPoolHandle cp,
2332                                                                        instanceKlassHandle k,
2333                                                                        int length, TRAPS) {
2334   ClassFileStream* cfs = stream();
2335   u1* sde_buffer = cfs->get_u1_buffer();
2336   assert(sde_buffer != NULL, "null sde buffer");
2337 
2338   // Don't bother storing it if there is no way to retrieve it
2339   if (JvmtiExport::can_get_source_debug_extension()) {
2340     // Optimistically assume that only 1 byte UTF format is used
2341     // (common case)
2342     TempNewSymbol sde_symbol = SymbolTable::new_symbol((const char*)sde_buffer, length, CHECK);
2343     k->set_source_debug_extension(sde_symbol);
2344     // Note that set_source_debug_extension() increments the reference count
2345     // for its copy of the Symbol*, so use a TempNewSymbol here.
2346   }
2347   // Got utf8 string, set stream position forward
2348   cfs->skip_u1(length, CHECK);
2349 }
2350 
2351 
2352 // Inner classes can be static, private or protected (classic VM does this)
2353 #define RECOGNIZED_INNER_CLASS_MODIFIERS (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED | JVM_ACC_STATIC)
2354 
2355 // Return number of classes in the inner classes attribute table
2356 u2 ClassFileParser::parse_classfile_inner_classes_attribute(u1* inner_classes_attribute_start,
2357                                                             bool parsed_enclosingmethod_attribute,
2358                                                             u2 enclosing_method_class_index,
2359                                                             u2 enclosing_method_method_index,
2360                                                             constantPoolHandle cp,
2361                                                             instanceKlassHandle k, TRAPS) {
2362   ClassFileStream* cfs = stream();
2363   u1* current_mark = cfs->current();
2364   u2 length = 0;
2365   if (inner_classes_attribute_start != NULL) {




2320   u2 sourcefile_index = cfs->get_u2_fast();
2321   check_property(
2322     valid_cp_range(sourcefile_index, cp->length()) &&
2323       cp->tag_at(sourcefile_index).is_utf8(),
2324     "Invalid SourceFile attribute at constant pool index %u in class file %s",
2325     sourcefile_index, CHECK);
2326   k->set_source_file_name(cp->symbol_at(sourcefile_index));
2327 }
2328 
2329 
2330 
2331 void ClassFileParser::parse_classfile_source_debug_extension_attribute(constantPoolHandle cp,
2332                                                                        instanceKlassHandle k,
2333                                                                        int length, TRAPS) {
2334   ClassFileStream* cfs = stream();
2335   u1* sde_buffer = cfs->get_u1_buffer();
2336   assert(sde_buffer != NULL, "null sde buffer");
2337 
2338   // Don't bother storing it if there is no way to retrieve it
2339   if (JvmtiExport::can_get_source_debug_extension()) {
2340     k->set_source_debug_extension((char*)sde_buffer, length);





2341   }
2342   // Got utf8 string, set stream position forward
2343   cfs->skip_u1(length, CHECK);
2344 }
2345 
2346 
2347 // Inner classes can be static, private or protected (classic VM does this)
2348 #define RECOGNIZED_INNER_CLASS_MODIFIERS (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED | JVM_ACC_STATIC)
2349 
2350 // Return number of classes in the inner classes attribute table
2351 u2 ClassFileParser::parse_classfile_inner_classes_attribute(u1* inner_classes_attribute_start,
2352                                                             bool parsed_enclosingmethod_attribute,
2353                                                             u2 enclosing_method_class_index,
2354                                                             u2 enclosing_method_method_index,
2355                                                             constantPoolHandle cp,
2356                                                             instanceKlassHandle k, TRAPS) {
2357   ClassFileStream* cfs = stream();
2358   u1* current_mark = cfs->current();
2359   u2 length = 0;
2360   if (inner_classes_attribute_start != NULL) {