feat: replace single CODE_CALL with argument-count opcodes and update primitives signature
Replace the monolithic CODE_CALL instruction with ten distinct opcodes CODE_CALL_0 through CODE_CALL_10 to encode argument count directly in the bytecode. Update the VM interpreter to extract numArgs from the opcode offset and adjust stack indexing to retrieve the receiver relative to arguments. Change the Primitive function pointer typedef to accept a Value* array and numArgs parameter, and update all existing primitives (metaclass_new, num_abs, string_count) to the new signature. Add a new string_contains primitive and register it in the VM initialization.
This commit is contained in:
+1
-1
@@ -5,4 +5,4 @@ class Foo { // line comment
|
||||
}
|
||||
var a = Foo.new
|
||||
a.bar
|
||||
"a string"
|
||||
"something".contains("meth")
|
||||
|
||||
Reference in New Issue
Block a user