Many makes of European guns have serial numbers on the barrel and/or slide, and it is always (or almost always) in a matching set with the frame when the gun is made. The "gun is the frame" is a concept in US federal law, but these other parts (at least the barrel in one case) can be regulated as strictly as frames in the US.
I have not heard of a manufacturer grabbing mismatched parts as part of the normal manufacturing process, though it is possible for old new stock to be assembled into "new guns".
In the case of Glock, any slide or barrel that has a single non-digit character prefix was manufactured as a replacement part and not part of a gun. A part with more than one non-digit in the prefix was made for a complete gun.