@Override
	public int getParameterSize() {
		function.manager.lock.acquire();
		try {
			checkIsValid();

			// NOTE: This logic is sensitive to the existance of Local variables at the incorrect
			// stack offset placed before parameters.  This can occur when adjustments are made to
			// the prototype model's stack pentry specification.  Unfortunately, the distinction
			// between a parameter and a local is locked-in at the time of creation due to the
			// use of distinct symbol types.

			int baseOffset = 0;
			Integer base = VariableUtilities.getBaseStackParamOffset(function);
			if (base != null) {
				baseOffset = (int) base.longValue();
			}

			// Negative growth
			if (stackGrowsNegative) {
				int index = variables.length - 1;
				if (index < 0) {
					return 0;
				}
				if (variables[index] instanceof Parameter) {
					Varnode stackVarnode = variables[index].getLastStorageVarnode();
					int len = stackVarnode.getSize();
					int stackOffset = (int) stackVarnode.getOffset();
					return stackOffset - baseOffset + len;
				}
				return 0;
			}

			// Positive growth
			if (variables.length != 0 && (variables[0] instanceof Parameter)) {
				int stackOffset = (int) variables[0].getLastStorageVarnode().getOffset();
				return baseOffset - stackOffset;
			}
			return 0;
		}
		finally {
			function.manager.lock.release();
		}
	}
Construct a function stack frame.
@param function
@param variables
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionStackFrame.java