1. A method for speculative object shapes, comprising: obtaining a first value for a first object and a second value for a second object, wherein the first object is of a first shape, and wherein the second object is of a second shape; determining, by a processor and during runtime, a first speculative type for the first value and a second speculative type for the second value; generating, based on the first speculative type and the second speculative type, a shape tree comprising a first subtree for the first shape and a second subtree for the second shape; marking, by the processor, the first subtree as obsolete based on a determination that the first speculative type is incorrect and that the second shape is a super shape of the first shape; transforming, in response to marking, the first object from the first shape to the second shape by: merging the first subtree into the second subtree; obtaining a third value for a third object, wherein the third object is of a third shape; determining, by the processor and during runtime, a third speculative type for the third value; generating, based on the third speculative type, a third subtree for the shape tree; and marking, in response to determining that the third shape causes polymorphism, the third subtree as obsolete based on a determination that the second shape is the super shape of the third shape and that the third shape causes polymorphism with the second shape, wherein the third speculative type is correct.