We diagram the behavior of 5-dimensional anti-de Sitter spacetime against horizon formation in the gravitational collapse of a scalar field, treating the scalar field mass and width of initial data as free parameters, which we call the stability phase diagram. We find that the class of stable initial data becomes larger and shifts to smaller widths as the field mass increases. In addition to classifying initial data as stable or unstable, we identify two other classes based on nonperturbative behavior. The class of metastable initial data forms a horizon over longer time scales than suggested by the lowest order perturbation theory at computationally accessible amplitudes, and irregular initial data can exhibit non-monotonic and possibly chaotic behavior in the horizon formation times. Our results include evidence for chaotic behavior even in the collapse of a massless scalar field.