scratch0-5 / utils /VMMakerJS.package /JSMethod.class /instance /addVarsDeclarationsAndLabelsOf..st
soiz1's picture
Upload folder using huggingface_hub
8f3f8db verified
raw
history blame contribute delete
639 Bytes
inlining support
addVarsDeclarationsAndLabelsOf: methodToBeInlined
"Prepare to inline the body of the given method into the receiver by making the args and locals of the argument to the receiver be locals of the receiver. Record any type declarations for these variables. Record labels. Assumes that the variables have already be renamed to avoid name clashes."
methodToBeInlined args, methodToBeInlined locals do: [ :v |
(locals includes: v) ifFalse: [ locals addLast: v ].
].
methodToBeInlined declarations associationsDo: [ :assoc |
declarations add: assoc.
].
methodToBeInlined labels do: [ :label |
labels add: label.
].