src/hotspot/share/classfile/stackMapTable.cpp
changeset 49449 ef5d5d343e2a
parent 47216 71c04702a3d5
child 53838 c8c9bd65c198
--- a/src/hotspot/share/classfile/stackMapTable.cpp	Fri Mar 16 08:26:53 2018 -0400
+++ b/src/hotspot/share/classfile/stackMapTable.cpp	Fri Mar 16 09:12:13 2018 -0400
@@ -144,6 +144,20 @@
   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;