125 int32_t size, int32_t max_size, TRAPS) {
126 if (size < 0 || size > max_size) {
127 // Since this error could be caused someone rewriting the method
128 // but not knowing to update the stackmap data, we call the the
129 // verifier's error method, which may not throw an exception and
130 // failover to the old verifier instead.
131 _verifier->class_format_error(
132 "StackMapTable format error: bad type array size");
133 }
134 }
135
136 enum {
137 SAME_LOCALS_1_STACK_ITEM_EXTENDED = 247,
138 SAME_EXTENDED = 251,
139 FULL = 255
140 };
141
142 public:
143 // Constructor
144 StackMapReader(ClassVerifier* v, StackMapStream* stream, char* code_data,
145 int32_t code_len, TRAPS) :
146 _verifier(v), _stream(stream),
147 _code_data(code_data), _code_length(code_len) {
148 methodHandle m = v->method();
149 if (m->has_stackmap_table()) {
150 _cp = constantPoolHandle(THREAD, m->constants());
151 _frame_count = _stream->get_u2(CHECK);
152 } else {
153 // There's no stackmap table present. Frame count and size are 0.
154 _frame_count = 0;
155 }
156 }
157
158 inline int32_t get_frame_count() const { return _frame_count; }
159 StackMapFrame* next(StackMapFrame* pre_frame, bool first,
160 u2 max_locals, u2 max_stack, TRAPS);
161
162 void check_end(TRAPS) {
163 if (!_stream->at_end()) {
164 StackMapStream::stackmap_format_error("wrong attribute size", CHECK);
165 }
166 }
167 };
168
169 #endif // SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
|
125 int32_t size, int32_t max_size, TRAPS) {
126 if (size < 0 || size > max_size) {
127 // Since this error could be caused someone rewriting the method
128 // but not knowing to update the stackmap data, we call the the
129 // verifier's error method, which may not throw an exception and
130 // failover to the old verifier instead.
131 _verifier->class_format_error(
132 "StackMapTable format error: bad type array size");
133 }
134 }
135
136 enum {
137 SAME_LOCALS_1_STACK_ITEM_EXTENDED = 247,
138 SAME_EXTENDED = 251,
139 FULL = 255
140 };
141
142 public:
143 // Constructor
144 StackMapReader(ClassVerifier* v, StackMapStream* stream, char* code_data,
145 int32_t code_len, TRAPS);
146
147 inline int32_t get_frame_count() const { return _frame_count; }
148 StackMapFrame* next(StackMapFrame* pre_frame, bool first,
149 u2 max_locals, u2 max_stack, TRAPS);
150
151 void check_end(TRAPS) {
152 if (!_stream->at_end()) {
153 StackMapStream::stackmap_format_error("wrong attribute size", CHECK);
154 }
155 }
156 };
157
158 #endif // SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
|