void StackMapFrame::set_local(int32_t index, VerificationType type, TRAPS) { assert(!type.is_check(), "Must be a real type"); if (index >= _max_locals) { verifier()->verify_error( ErrorContext::bad_local_index(_offset, index), "Local variable table overflow"); return; } // If type at index is double or long, set the next location to be unusable if (_locals[index].is_double() || _locals[index].is_long()) { assert((index + 1) < _locals_size, "Local variable table overflow"); _locals[index + 1] = VerificationType::bogus_type(); } // If type at index is double_2 or long_2, set the previous location to be unusable if (_locals[index].is_double2() || _locals[index].is_long2()) { assert(index >= 1, "Local variable table underflow"); _locals[index - 1] = VerificationType::bogus_type(); } _locals[index] = type; if (index >= _locals_size) { #ifdef ASSERT for (int i=_locals_size; i<index; i++) { assert(_locals[i] == VerificationType::bogus_type(), "holes must be bogus type"); } #endif _locals_size = index + 1; } }
// Push type into stack type array. inline void push_stack(VerificationType type, TRAPS) { assert(!type.is_check(), "Must be a real type"); if (_stack_size >= _max_stack) { verifier()->verify_error( ErrorContext::stack_overflow(_offset, this), "Operand stack overflow"); return; } _stack[_stack_size++] = type; }