< prev index next >

src/hotspot/share/classfile/stackMapTable.cpp

Print this page

        

@@ -142,10 +142,24 @@
     }
   }
   str->print_cr(" }");
 }
 
+StackMapReader::StackMapReader(ClassVerifier* v, StackMapStream* stream, char* code_data,
+                               int32_t code_len, TRAPS) :
+                               _verifier(v), _stream(stream),
+                               _code_data(code_data), _code_length(code_len) {
+  methodHandle m = v->method();
+  if (m->has_stackmap_table()) {
+    _cp = constantPoolHandle(THREAD, m->constants());
+    _frame_count = _stream->get_u2(CHECK);
+  } else {
+    // There's no stackmap table present. Frame count and size are 0.
+    _frame_count = 0;
+  }
+}
+
 int32_t StackMapReader::chop(
     VerificationType* locals, int32_t length, int32_t chops) {
   if (locals == NULL) return -1;
   int32_t pos = length - 1;
   for (int32_t i=0; i<chops; i++) {
< prev index next >