You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
storing the object template out of band (like on JSFunctionBytecode) makes it hard-to-impossible to (de)serialize function objects with JS_WriteObject
storing it in the bytecode stream itself turns define_object into a variable-length opcode (the only one we have) and dealing with that gets finicky. Not impossible but definitely finicky.
There's no big difference in performance in my limited testing, although I don't pre-allocate the final JSShape yet. It definitely shrinks the bytecode for large object literals though, but how common are those?
Activity
bnoordhuis commentedon Sep 8, 2026
I experimented with this:
storing the object template out of band (like on
JSFunctionBytecode) makes it hard-to-impossible to (de)serialize function objects withJS_WriteObjectstoring it in the bytecode stream itself turns
define_objectinto a variable-length opcode (the only one we have) and dealing with that gets finicky. Not impossible but definitely finicky.There's no big difference in performance in my limited testing, although I don't pre-allocate the final
JSShapeyet. It definitely shrinks the bytecode for large object literals though, but how common are those?