"jail, prison," 1952, perhaps from earlier U.S. slang sense of "door" (by 1943), agent noun from slam (v.). As "one who slams," from 1892.
Entries linking to slammer
slam v.
1690s, "to beat, slap;" 1775, "shut (a door, window, book, etc.) with force," from slam (n.1). The meaning "throw or push with force" is from 1870. The sense of "say uncomplimentary things about" is from 1916. Related: Slammed; slamming.