MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

disable SPECIAL_OP(0) arguments

+31 -1
+6 -1
src/silver/swarm.c
··· 1054 1054 case OP_RETURN: case OP_RETURN_UNDEF: 1055 1055 case OP_GET_FIELD: case OP_GET_FIELD2: case OP_GET_GLOBAL: 1056 1056 case OP_SPECIAL_OBJ: 1057 + if (op == OP_SPECIAL_OBJ && sv_get_u8(ip + 1) == 0 && 1058 + !f->is_strict && f->param_count > 0) return false; 1057 1059 case OP_NOP: case OP_LINE_NUM: case OP_COL_NUM: case OP_LABEL: 1058 1060 break; 1059 1061 default: ··· 2002 2004 case OP_STR_ALC_SNAPSHOT: 2003 2005 case OP_TO_PROPKEY: 2004 2006 case OP_RETURN: case OP_RETURN_UNDEF: 2005 - case OP_SPECIAL_OBJ: 2007 + case OP_SPECIAL_OBJ: if ( 2008 + op == OP_SPECIAL_OBJ && sv_get_u8(ip + 1) == 0 2009 + && !func->is_strict && func->param_count > 0 2010 + ) eligible = false; 2006 2011 case OP_SET_NAME: 2007 2012 case OP_TRY_PUSH: case OP_TRY_POP: 2008 2013 case OP_THROW: case OP_THROW_ERROR:
+25
tests/test_jit_arguments_object.cjs
··· 1 + function assertEq(actual, expected, msg) { 2 + if (actual !== expected) { 3 + throw new Error(`${msg}: expected ${expected}, got ${actual}`); 4 + } 5 + } 6 + 7 + function mappedRead(a) { 8 + a = 2; 9 + return arguments[0]; 10 + } 11 + 12 + function mappedWrite(a) { 13 + arguments[0] = 2; 14 + return a; 15 + } 16 + 17 + for (let i = 0; i < 500; i++) { 18 + assertEq(mappedRead(1), 2, "warm mapped read"); 19 + assertEq(mappedWrite(1), 2, "warm mapped write"); 20 + } 21 + 22 + assertEq(mappedRead(1), 2, "hot mapped read"); 23 + assertEq(mappedWrite(1), 2, "hot mapped write"); 24 + 25 + console.log("OK: test_jit_arguments_object");