45 // Used for backward compatibility reasons:
46 // - to check for javac bug fixes that happened after 1.5
47 // - also used as the max version when running in jdk6
48 #define JAVA_6_VERSION 50
49
50 // Used for backward compatibility reasons:
51 // - to check NameAndType_info signatures more aggressively
52 #define JAVA_7_VERSION 51
53
54
55 void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS) {
56 // Use a local copy of ClassFileStream. It helps the C++ compiler to optimize
57 // this function (_current can be allocated in a register, with scalar
58 // replacement of aggregates). The _current pointer is copied back to
59 // stream() when this function returns. DON'T call another method within
60 // this method that uses stream().
61 ClassFileStream* cfs0 = stream();
62 ClassFileStream cfs1 = *cfs0;
63 ClassFileStream* cfs = &cfs1;
64 #ifdef ASSERT
65 u1* old_current = cfs0->current();
66 #endif
67
68 // Used for batching symbol allocations.
69 const char* names[SymbolTable::symbol_alloc_batch_size];
70 int lengths[SymbolTable::symbol_alloc_batch_size];
71 int indices[SymbolTable::symbol_alloc_batch_size];
72 unsigned int hashValues[SymbolTable::symbol_alloc_batch_size];
73 int names_count = 0;
74
75 // parsing Index 0 is unused
76 for (int index = 1; index < length; index++) {
77 // Each of the following case guarantees one more byte in the stream
78 // for the following tag or the access_flags following constant pool,
79 // so we don't need bounds-check for reading tag.
80 u1 tag = cfs->get_u1_fast();
81 switch (tag) {
82 case JVM_CONSTANT_Class :
83 {
84 cfs->guarantee_more(3, CHECK); // name_index, tag/access_flags
|
45 // Used for backward compatibility reasons:
46 // - to check for javac bug fixes that happened after 1.5
47 // - also used as the max version when running in jdk6
48 #define JAVA_6_VERSION 50
49
50 // Used for backward compatibility reasons:
51 // - to check NameAndType_info signatures more aggressively
52 #define JAVA_7_VERSION 51
53
54
55 void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS) {
56 // Use a local copy of ClassFileStream. It helps the C++ compiler to optimize
57 // this function (_current can be allocated in a register, with scalar
58 // replacement of aggregates). The _current pointer is copied back to
59 // stream() when this function returns. DON'T call another method within
60 // this method that uses stream().
61 ClassFileStream* cfs0 = stream();
62 ClassFileStream cfs1 = *cfs0;
63 ClassFileStream* cfs = &cfs1;
64 #ifdef ASSERT
65 assert(cfs->allocated_on_stack(),"should be local");
66 u1* old_current = cfs0->current();
67 #endif
68
69 // Used for batching symbol allocations.
70 const char* names[SymbolTable::symbol_alloc_batch_size];
71 int lengths[SymbolTable::symbol_alloc_batch_size];
72 int indices[SymbolTable::symbol_alloc_batch_size];
73 unsigned int hashValues[SymbolTable::symbol_alloc_batch_size];
74 int names_count = 0;
75
76 // parsing Index 0 is unused
77 for (int index = 1; index < length; index++) {
78 // Each of the following case guarantees one more byte in the stream
79 // for the following tag or the access_flags following constant pool,
80 // so we don't need bounds-check for reading tag.
81 u1 tag = cfs->get_u1_fast();
82 switch (tag) {
83 case JVM_CONSTANT_Class :
84 {
85 cfs->guarantee_more(3, CHECK); // name_index, tag/access_flags
|