src/hotspot/share/classfile/classFileParser.cpp
changeset 54042 6dd6f988b4e4
parent 53908 45a23c64d0f6
child 54257 21702e87efdf
equal deleted inserted replaced
54041:bba6644b6fe3 54042:6dd6f988b4e4
    50 #include "oops/instanceKlass.hpp"
    50 #include "oops/instanceKlass.hpp"
    51 #include "oops/instanceMirrorKlass.hpp"
    51 #include "oops/instanceMirrorKlass.hpp"
    52 #include "oops/klass.inline.hpp"
    52 #include "oops/klass.inline.hpp"
    53 #include "oops/klassVtable.hpp"
    53 #include "oops/klassVtable.hpp"
    54 #include "oops/metadata.hpp"
    54 #include "oops/metadata.hpp"
    55 #include "oops/method.hpp"
    55 #include "oops/method.inline.hpp"
    56 #include "oops/oop.inline.hpp"
    56 #include "oops/oop.inline.hpp"
    57 #include "oops/symbol.hpp"
    57 #include "oops/symbol.hpp"
    58 #include "prims/jvmtiExport.hpp"
    58 #include "prims/jvmtiExport.hpp"
    59 #include "prims/jvmtiThreadState.hpp"
    59 #include "prims/jvmtiThreadState.hpp"
    60 #include "runtime/arguments.hpp"
    60 #include "runtime/arguments.hpp"
  1970                           "Invalid index %u in %s in class file %s",
  1970                           "Invalid index %u in %s in class file %s",
  1971                           index, tbl_name, CHECK_NULL);
  1971                           index, tbl_name, CHECK_NULL);
  1972     }
  1972     }
  1973   }
  1973   }
  1974   return localvariable_table_start;
  1974   return localvariable_table_start;
  1975 }
       
  1976 
       
  1977 
       
  1978 void ClassFileParser::parse_type_array(u2 array_length,
       
  1979                                        u4 code_length,
       
  1980                                        u4* const u1_index,
       
  1981                                        u4* const u2_index,
       
  1982                                        u1* const u1_array,
       
  1983                                        u2* const u2_array,
       
  1984                                        TRAPS) {
       
  1985   const ClassFileStream* const cfs = _stream;
       
  1986   u2 index = 0; // index in the array with long/double occupying two slots
       
  1987   u4 i1 = *u1_index;
       
  1988   u4 i2 = *u2_index + 1;
       
  1989   for(int i = 0; i < array_length; i++) {
       
  1990     const u1 tag = u1_array[i1++] = cfs->get_u1(CHECK);
       
  1991     index++;
       
  1992     if (tag == ITEM_Long || tag == ITEM_Double) {
       
  1993       index++;
       
  1994     } else if (tag == ITEM_Object) {
       
  1995       const u2 class_index = u2_array[i2++] = cfs->get_u2(CHECK);
       
  1996       guarantee_property(valid_klass_reference_at(class_index),
       
  1997                          "Bad class index %u in StackMap in class file %s",
       
  1998                          class_index, CHECK);
       
  1999     } else if (tag == ITEM_Uninitialized) {
       
  2000       const u2 offset = u2_array[i2++] = cfs->get_u2(CHECK);
       
  2001       guarantee_property(
       
  2002         offset < code_length,
       
  2003         "Bad uninitialized type offset %u in StackMap in class file %s",
       
  2004         offset, CHECK);
       
  2005     } else {
       
  2006       guarantee_property(
       
  2007         tag <= (u1)ITEM_Uninitialized,
       
  2008         "Unknown variable type %u in StackMap in class file %s",
       
  2009         tag, CHECK);
       
  2010     }
       
  2011   }
       
  2012   u2_array[*u2_index] = index;
       
  2013   *u1_index = i1;
       
  2014   *u2_index = i2;
       
  2015 }
  1975 }
  2016 
  1976 
  2017 static const u1* parse_stackmap_table(const ClassFileStream* const cfs,
  1977 static const u1* parse_stackmap_table(const ClassFileStream* const cfs,
  2018                                       u4 code_attribute_length,
  1978                                       u4 code_attribute_length,
  2019                                       bool need_verify,
  1979                                       bool need_verify,