The great Judi Dench is being killed off as M in the new Bond flick, “Skyfall.”

Which means Dame Judi is free to return to the stage, first in London and then, if all goes well, on Broadway in 2013.

London theater sources tell me Dench has signed on to play an aging Alice in Wonderland in a new play by John Logan, who won the Tony in 2010 for “Red,” his drama about painter Mark Rothko.

Logan is also writing “Skyfall,” so he and Dench have spent a lot of time together in those glamorous Bond locales — Goa, Istanbul, Shanghai — going over his new play.

Ben Whishaw, an up-and-coming young British actor who’s playing Q in “Skyfall,” will also be in Logan’s play. He will, I’m told, be playing Peter Pan.

(I’m not following the plot here, but let’s keep an open mind.)

Michael Grandage, who staged “Red” — and the new “Evita” revival — is directing.

The plan is to open the play, which is as yet untitled, in the West End in the fall and then ship it off to Broadway six months later.

Dench, 77, hasn’t appeared on the New York stage since 1999, when she won a Tony for David Hare’s backstage drama, “Amy’s View.”

She recently disclosed that she’s suffering from macular degeneration and is unable to read scripts. But she doesn’t want to give up acting and relies on friends and family to help her learn her lines.

She is still one of the West End’s most bankable stars. Any production she appears in is bound to open with a healthy advance.

The Bond movies have raised her profile in New York, so she’s sure to be a big draw on Broadway.

(All those old ladies who never miss a rerun of “As Time Goes By” on PBS will be clamoring for tickets as well.)

Details about the play are sketchy. Alice, now an old lady (“Alice’s Adventures in Assisted Living”?), looks back on her life, both real and imagined. She’s visited by various fairy-tale characters from Wonderland, though how Peter Pan figures into all this I’m not sure.

I thought he was from Neverland.

This play sounds twee and a little bonkers — has Logan been taking puffs from the Caterpillar’s hookah? — but I wouldn’t bet against him and Grandage.

They’re a winning combination.

And to have Dench back on Broadway is a good reason to throw a rip-roaring mad tea party.

Another star flirting with Broadway is Tom Hanks.

Nora Ephron wants him to star in her new play “Stories About McAlary,” a collection of scenes from the life of the late Post columnist Mike McAlary.

This isn’t the first time, I’m told, that Ephron and Hanks have discussed the project. It was originally supposed to be a movie in which Hanks was going to star. But it got shelved for various reasons and, last year, Ephron decided to turn it into a play. Hugh Jackman played McAlary in a reading that was staged by Mike Nichols.

But Jackman opted to do his hugely successful one-man show instead, and Nichols decided to direct the revival of “Death of a Salesman” starring Philip Seymour Hoffman.

Hanks hasn’t committed to “Stories About McAlary” yet, and yesterday I heard he might be getting cold feet. Facing New York’s movie star-skeptical drama critics can be daunting for an actor who hasn’t set foot on a stage since 1979, when he appeared in “The Mandrake” at the Riverside Shakespeare Company.

But it’s a good part. McAlary was the last of the rough-and-tumble tabloid city columnists, a group of crusading ink-stained wretches whose ranks included Jack Newfield, Jimmy Breslin and Pete Hamill.

After finishing off some corrupt cop or politician in their columns, they could usually be found at the bar at the old Lion’s Head in the Village, reveling in the fun and power of tabloid journalism.

Ephron, who once worked at The Post, knew McAlary well and has collected a batch of great stories about him. The play is loosely structured but fun, and it captures a time when newspapers — and their columnists — held sway over the city.