mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-08 23:50:04 +00:00
optimized OP_INVOKE, embedded the identifier in the instruction
This commit is contained in:
@@ -667,12 +667,11 @@ static void dot(CParseState *pstate, bool canAssign, Precedence prec) {
|
||||
writeu8(pstate, 128 - 1);
|
||||
writeu16(pstate, name);
|
||||
} else if (match(pstate, TOKEN_LEFT_PAREN)) { // it's an invoked call
|
||||
writeu8(pstate, OP_LOADCONST);
|
||||
writeu16(pstate, name);
|
||||
uint8_t args = parseArguments(pstate);
|
||||
writeu8(pstate, OP_INVOKE);
|
||||
writeu8(pstate, args);
|
||||
writeu8(pstate, pstate->compiler->expectedValues);
|
||||
writeu16(pstate, name);
|
||||
valuePopped(pstate, args+1); // args + function
|
||||
valuePushed(pstate, pstate->compiler->expectedValues);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user