src/share/vm/classfile/stackMapFrame.cpp

changeset 2497
3582bf76420e
parent 2314
f95d63e2154a
child 2585
c1a6154012c8
     1.1 --- a/src/share/vm/classfile/stackMapFrame.cpp	Thu Jan 27 13:42:28 2011 -0800
     1.2 +++ b/src/share/vm/classfile/stackMapFrame.cpp	Thu Jan 27 16:11:27 2011 -0800
     1.3 @@ -27,7 +27,7 @@
     1.4  #include "classfile/verifier.hpp"
     1.5  #include "memory/resourceArea.hpp"
     1.6  #include "oops/oop.inline.hpp"
     1.7 -#include "oops/symbolOop.hpp"
     1.8 +#include "oops/symbol.hpp"
     1.9  #include "runtime/handles.inline.hpp"
    1.10  #include "utilities/globalDefinitions.hpp"
    1.11  
    1.12 @@ -90,8 +90,7 @@
    1.13  
    1.14  VerificationType StackMapFrame::set_locals_from_arg(
    1.15      const methodHandle m, VerificationType thisKlass, TRAPS) {
    1.16 -  symbolHandle signature(THREAD, m->signature());
    1.17 -  SignatureStream ss(signature);
    1.18 +  SignatureStream ss(m->signature());
    1.19    int init_local_num = 0;
    1.20    if (!m->is_static()) {
    1.21      init_local_num++;
    1.22 @@ -118,8 +117,14 @@
    1.23      case T_OBJECT:
    1.24      case T_ARRAY:
    1.25      {
    1.26 -      symbolOop sig = ss.as_symbol(CHECK_(VerificationType::bogus_type()));
    1.27 -      return VerificationType::reference_type(symbolHandle(THREAD, sig));
    1.28 +      Symbol* sig = ss.as_symbol(CHECK_(VerificationType::bogus_type()));
    1.29 +      // Create another symbol to save as signature stream unreferences
    1.30 +      // this symbol.
    1.31 +      Symbol* sig_copy =
    1.32 +        verifier()->create_temporary_symbol(sig, 0, sig->utf8_length(),
    1.33 +                                 CHECK_(VerificationType::bogus_type()));
    1.34 +      assert(sig_copy == sig, "symbols don't match");
    1.35 +      return VerificationType::reference_type(sig_copy);
    1.36      }
    1.37      case T_INT:     return VerificationType::integer_type();
    1.38      case T_BYTE:    return VerificationType::byte_type();
    1.39 @@ -157,7 +162,7 @@
    1.40      VerificationType* from, VerificationType* to, int32_t len, TRAPS) const {
    1.41    for (int32_t i = 0; i < len; i++) {
    1.42      bool subtype = to[i].is_assignable_from(
    1.43 -      from[i], verifier()->current_class(), THREAD);
    1.44 +      from[i], verifier(), THREAD);
    1.45      if (!subtype) {
    1.46        return false;
    1.47      }
    1.48 @@ -187,7 +192,7 @@
    1.49    }
    1.50    VerificationType top = _stack[--_stack_size];
    1.51    bool subtype = type.is_assignable_from(
    1.52 -    top, verifier()->current_class(), CHECK_(VerificationType::bogus_type()));
    1.53 +    top, verifier(), CHECK_(VerificationType::bogus_type()));
    1.54    if (!subtype) {
    1.55      verifier()->verify_error(_offset, "Bad type on operand stack");
    1.56      return VerificationType::bogus_type();
    1.57 @@ -203,7 +208,7 @@
    1.58      return VerificationType::bogus_type();
    1.59    }
    1.60    bool subtype = type.is_assignable_from(_locals[index],
    1.61 -    verifier()->current_class(), CHECK_(VerificationType::bogus_type()));
    1.62 +    verifier(), CHECK_(VerificationType::bogus_type()));
    1.63    if (!subtype) {
    1.64      verifier()->verify_error(_offset, "Bad local variable type");
    1.65      return VerificationType::bogus_type();
    1.66 @@ -221,9 +226,9 @@
    1.67      return;
    1.68    }
    1.69    bool subtype1 = type1.is_assignable_from(
    1.70 -    _locals[index], verifier()->current_class(), CHECK);
    1.71 +    _locals[index], verifier(), CHECK);
    1.72    bool subtype2 = type2.is_assignable_from(
    1.73 -    _locals[index+1], verifier()->current_class(), CHECK);
    1.74 +    _locals[index+1], verifier(), CHECK);
    1.75    if (!subtype1 || !subtype2) {
    1.76      verifier()->verify_error(_offset, "Bad local variable type");
    1.77      return;

mercurial