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
The EV3 VM can only run one copy of each bytecode object (vmthread/block/subcall) because of the way the local variables are allocated. However, you can emit multiple object headers that point to the same instructions to duplicate an object.
Currently, there is a compiler "optimization" that detects duplicate objects. However, it would be nice to be able to write an object once in the assembly code instead of multiple times.
We will need to come up with a syntax for this. For example, we could use the common array notation:
// declare a subroutine with two instances
subcall MySub[2] {
// do suff
}
vmthread Thread1 {
// call the first instance
CALL(MySub[0])
}
vmthread Thread2 {
// call the second instance
CALL(MySub[1])
}
vmthread Thread2 {
// compiler error: missing index
CALL(MySub)
}
vmthread Thread2 {
// compiler error: index out of range
CALL(MySub[3])
}
The text was updated successfully, but these errors were encountered:
The EV3 VM can only run one copy of each bytecode object (vmthread/block/subcall) because of the way the local variables are allocated. However, you can emit multiple object headers that point to the same instructions to duplicate an object.
Currently, there is a compiler "optimization" that detects duplicate objects. However, it would be nice to be able to write an object once in the assembly code instead of multiple times.
We will need to come up with a syntax for this. For example, we could use the common array notation:
The text was updated successfully, but these errors were encountered: