128 bool match = match_stackmap( |
128 bool match = match_stackmap( |
129 frame, target, true, false, false, &ctx, CHECK_VERIFY(frame->verifier())); |
129 frame, target, true, false, false, &ctx, CHECK_VERIFY(frame->verifier())); |
130 if (!match || (target < 0 || target >= _code_length)) { |
130 if (!match || (target < 0 || target >= _code_length)) { |
131 frame->verifier()->verify_error(ctx, |
131 frame->verifier()->verify_error(ctx, |
132 "Inconsistent stackmap frames at branch target %d", target); |
132 "Inconsistent stackmap frames at branch target %d", target); |
133 return; |
|
134 } |
|
135 // check if uninitialized objects exist on backward branches |
|
136 check_new_object(frame, target, CHECK_VERIFY(frame->verifier())); |
|
137 } |
|
138 |
|
139 void StackMapTable::check_new_object( |
|
140 const StackMapFrame* frame, int32_t target, TRAPS) const { |
|
141 if (frame->offset() > target && frame->has_new_object()) { |
|
142 frame->verifier()->verify_error( |
|
143 ErrorContext::bad_code(frame->offset()), |
|
144 "Uninitialized object exists on backward branch %d", target); |
|
145 return; |
|
146 } |
133 } |
147 } |
134 } |
148 |
135 |
149 void StackMapTable::print_on(outputStream* str) const { |
136 void StackMapTable::print_on(outputStream* str) const { |
150 str->indent().print_cr("StackMapTable: frame_count = %d", _frame_count); |
137 str->indent().print_cr("StackMapTable: frame_count = %d", _frame_count); |