It'd be a nice optimization if we could remove unnecessary calls to functions like ExpectObjectat compile time. For instance, SetSymbolTransferability calls ExpectObject and it's currently only being called from within Define after that function itself has already called ExpectObject. It's correct for the SetSymbolTransferability to call ExpectObject because this function could be called from different call sights in the future and it can't necessarily depend on always having ExpectObject called before having its arguments passed in.
What would really be great is if the runtime builder could statically analyze and determine at compile time that ExpectObject can be removed from SetSymbolTransferability if it's just going to be redundant.
It'd be a nice optimization if we could remove unnecessary calls to functions like
ExpectObject
at compile time. For instance,SetSymbolTransferability
callsExpectObject
and it's currently only being called from withinDefine
after that function itself has already calledExpectObject
. It's correct for theSetSymbolTransferability
to callExpectObject
because this function could be called from different call sights in the future and it can't necessarily depend on always havingExpectObject
called before having its arguments passed in.What would really be great is if the runtime builder could statically analyze and determine at compile time that
ExpectObject
can be removed fromSetSymbolTransferability
if it's just going to be redundant.I'm not sure how difficult this would be...