Any scalar that gets dumped to the stack will very likely be shared
with some other memory.
True.
Objects that are real constants should either be promoted to static
memory, or constant propagated.
My concern is the constant pool. You want to be sure that stores to user
variables don't invalidate them.