327 && index < _cp_patches->length()
328 && _cp_patches->adr_at(index)->not_null());
329 }
330 Handle cp_patch_at(int index) {
331 assert(has_cp_patch_at(index), "oob");
332 return _cp_patches->at(index);
333 }
334 Handle clear_cp_patch_at(int index) {
335 Handle patch = cp_patch_at(index);
336 _cp_patches->at_put(index, Handle());
337 assert(!has_cp_patch_at(index), "");
338 return patch;
339 }
340 void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
341
342 // Wrapper for constantTag.is_klass_[or_]reference.
343 // In older versions of the VM, Klass*s cannot sneak into early phases of
344 // constant pool construction, but in later versions they can.
345 // %%% Let's phase out the old is_klass_reference.
346 bool is_klass_reference(constantPoolHandle cp, int index) {
347 return ((LinkWellKnownClasses || EnableInvokeDynamic)
348 ? cp->tag_at(index).is_klass_or_reference()
349 : cp->tag_at(index).is_klass_reference());
350 }
351
352 public:
353 // Constructor
354 ClassFileParser(ClassFileStream* st) { set_stream(st); }
355
356 // Parse .class file and return new Klass*. The Klass* is not hooked up
357 // to the system dictionary or any other structures, so a .class file can
358 // be loaded several times if desired.
359 // The system dictionary hookup is done by the caller.
360 //
361 // "parsed_name" is updated by this method, and is the name found
362 // while parsing the stream.
363 instanceKlassHandle parseClassFile(Symbol* name,
364 Handle class_loader,
365 Handle protection_domain,
366 TempNewSymbol& parsed_name,
367 bool verify,
|
327 && index < _cp_patches->length()
328 && _cp_patches->adr_at(index)->not_null());
329 }
330 Handle cp_patch_at(int index) {
331 assert(has_cp_patch_at(index), "oob");
332 return _cp_patches->at(index);
333 }
334 Handle clear_cp_patch_at(int index) {
335 Handle patch = cp_patch_at(index);
336 _cp_patches->at_put(index, Handle());
337 assert(!has_cp_patch_at(index), "");
338 return patch;
339 }
340 void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
341
342 // Wrapper for constantTag.is_klass_[or_]reference.
343 // In older versions of the VM, Klass*s cannot sneak into early phases of
344 // constant pool construction, but in later versions they can.
345 // %%% Let's phase out the old is_klass_reference.
346 bool is_klass_reference(constantPoolHandle cp, int index) {
347 return (EnableInvokeDynamic
348 ? cp->tag_at(index).is_klass_or_reference()
349 : cp->tag_at(index).is_klass_reference());
350 }
351
352 public:
353 // Constructor
354 ClassFileParser(ClassFileStream* st) { set_stream(st); }
355
356 // Parse .class file and return new Klass*. The Klass* is not hooked up
357 // to the system dictionary or any other structures, so a .class file can
358 // be loaded several times if desired.
359 // The system dictionary hookup is done by the caller.
360 //
361 // "parsed_name" is updated by this method, and is the name found
362 // while parsing the stream.
363 instanceKlassHandle parseClassFile(Symbol* name,
364 Handle class_loader,
365 Handle protection_domain,
366 TempNewSymbol& parsed_name,
367 bool verify,
|