Branch: Tag:

2014-09-23

2014-09-23 14:12:23 by Per Hedbor <ph@opera.com>

Added F_SIZEOF_STRING and F_SIZEOF_LOCAL_STRING

We really should pass on the type to the code generator instead, I
think.

There should also be a "#pragma promise_correct_types" or something
that would guarantee that the types are correct, and crash and burn if
they are not.

The generated code would be significantly smaller and faster.

2179:    push_int(val);   });    + OPCODE0(F_SIZEOF_STRING, "sizeof(string)", 0, { +  INT_TYPE val = pike_sizeof(Pike_sp-1); +  pop_stack(); +  push_int(val); + }); +    OPCODE1(F_SIZEOF_LOCAL, "sizeof local", I_UPDATE_SP, {    push_int(pike_sizeof(Pike_fp->locals+arg1));   });    -  + OPCODE1(F_SIZEOF_LOCAL_STRING, "sizeof local string", I_UPDATE_SP, { +  push_int(pike_sizeof(Pike_fp->locals+arg1)); + }); +    OPCODE2_ALIAS(F_SSCANF, "sscanf", I_UPDATE_SP, o_sscanf);      #define MKAPPLY(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \