  In this paper we determine the percolation threshold for an arbitrary
sequence of dense graphs $(G_n)$. Let $\lambda_n$ be the largest eigenvalue of
the adjacency matrix of $G_n$, and let $G_n(p_n)$ be the random subgraph of
$G_n$ obtained by keeping each edge independently with probability $p_n$. We
show that the appearance of a giant component in $G_n(p_n)$ has a sharp
threshold at $p_n=1/\lambda_n$. In fact, we prove much more: if $(G_n)$
converges to an irreducible limit, then the density of the largest component of
$G_n(c/n)$ tends to the survival probability of a multi-type branching process
defined in terms of this limit. Here the notions of convergence and limit are
those of Borgs, Chayes, Lov\'asz, S\'os and Vesztergombi. In addition to using
basic properties of convergence, we make heavy use of the methods of
Bollob\'as, Janson and Riordan, who used multi-type branching processes to
study the emergence of a giant component in a very broad family of sparse
inhomogeneous random graphs.
