src/share/vm/oops/constantPool.hpp

changeset 5760
084b21cd0228
parent 5756
a7609ec351d6
child 5971
b8860472c377
     1.1 --- a/src/share/vm/oops/constantPool.hpp	Sun Sep 22 18:07:43 2013 +0200
     1.2 +++ b/src/share/vm/oops/constantPool.hpp	Mon Sep 23 08:56:19 2013 -0700
     1.3 @@ -474,18 +474,42 @@
     1.4      return *int_at_addr(which);
     1.5    }
     1.6  
     1.7 -  int method_handle_ref_kind_at(int which) {
     1.8 -    assert(tag_at(which).is_method_handle(), "Corrupted constant pool");
     1.9 + private:
    1.10 +  int method_handle_ref_kind_at(int which, bool error_ok) {
    1.11 +    assert(tag_at(which).is_method_handle() ||
    1.12 +           (error_ok && tag_at(which).is_method_handle_in_error()), "Corrupted constant pool");
    1.13      return extract_low_short_from_int(*int_at_addr(which));  // mask out unwanted ref_index bits
    1.14    }
    1.15 -  int method_handle_index_at(int which) {
    1.16 -    assert(tag_at(which).is_method_handle(), "Corrupted constant pool");
    1.17 +  int method_handle_index_at(int which, bool error_ok) {
    1.18 +    assert(tag_at(which).is_method_handle() ||
    1.19 +           (error_ok && tag_at(which).is_method_handle_in_error()), "Corrupted constant pool");
    1.20      return extract_high_short_from_int(*int_at_addr(which));  // shift out unwanted ref_kind bits
    1.21    }
    1.22 -  int method_type_index_at(int which) {
    1.23 -    assert(tag_at(which).is_method_type(), "Corrupted constant pool");
    1.24 +  int method_type_index_at(int which, bool error_ok) {
    1.25 +    assert(tag_at(which).is_method_type() ||
    1.26 +           (error_ok && tag_at(which).is_method_type_in_error()), "Corrupted constant pool");
    1.27      return *int_at_addr(which);
    1.28    }
    1.29 + public:
    1.30 +  int method_handle_ref_kind_at(int which) {
    1.31 +    return method_handle_ref_kind_at(which, false);
    1.32 +  }
    1.33 +  int method_handle_ref_kind_at_error_ok(int which) {
    1.34 +    return method_handle_ref_kind_at(which, true);
    1.35 +  }
    1.36 +  int method_handle_index_at(int which) {
    1.37 +    return method_handle_index_at(which, false);
    1.38 +  }
    1.39 +  int method_handle_index_at_error_ok(int which) {
    1.40 +    return method_handle_index_at(which, true);
    1.41 +  }
    1.42 +  int method_type_index_at(int which) {
    1.43 +    return method_type_index_at(which, false);
    1.44 +  }
    1.45 +  int method_type_index_at_error_ok(int which) {
    1.46 +    return method_type_index_at(which, true);
    1.47 +  }
    1.48 +
    1.49    // Derived queries:
    1.50    Symbol* method_handle_name_ref_at(int which) {
    1.51      int member = method_handle_index_at(which);

mercurial