Browse Source

Merge pull request #1627 from svaarala/executor-call-trivia

Add missing executor UNUSED dispatch cases, avoid in-place CSREG
pull/438/merge
Sami Vaarala 7 years ago
committed by GitHub
parent
commit
aabf2d42b9
  1. 6
      src-input/duk_js_compiler.c
  2. 2
      src-input/duk_js_executor.c
  3. 2
      tests/api/test-dump-load-basic.c

6
src-input/duk_js_compiler.c

@ -3978,10 +3978,16 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i
DUK_DDD(DUK_DDDPRINT("function call with register base"));
duk__ivalue_toforcedreg(comp_ctx, left, reg_cs + 0);
#if 0
duk__emit_a_bc(comp_ctx,
DUK_OP_CSREG | DUK__EMIT_FLAG_A_IS_SOURCE,
(duk_regconst_t) (reg_cs + 0),
(duk_regconst_t) (reg_cs + 0)); /* in-place setup */
#endif
/* Because of in-place setup, REGCS is equivalent to
* just this LDUNDEF.
*/
duk__emit_bc(comp_ctx, DUK_OP_LDUNDEF, reg_cs + 1);
}
DUK__SETTEMP(comp_ctx, reg_cs + 2);

2
src-input/duk_js_executor.c

@ -5011,6 +5011,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread *
#if !defined(DUK_USE_ES6)
case DUK_OP_NEWTARGET:
#endif
case DUK_OP_UNUSED207:
case DUK_OP_UNUSED208:
case DUK_OP_UNUSED209:
case DUK_OP_UNUSED210:
case DUK_OP_UNUSED211:

2
tests/api/test-dump-load-basic.c

@ -40,7 +40,7 @@
/*===
*** test_basic (duk_safe_call)
dump result type: 7
ff000000000e000000030000000100090000000000010000000118000a8000000007000001ad000103030000049800040500000505ab8001070480020804000502b00005040000020503000103b0000100000000009d00000000057072696e74000000000568656c6c6f0140091eb851eb851f000000030000000000000000000300020000000100000001180c0b80010002340002009d0000009e000000020000000561646465720000000f66616b6546696c656e616d652e6a730000000d03000000010000000c000000000000000178000000000000000179000000010000000000000002000000017800000001790000000000000006676c6f62616c0000000f66616b6546696c656e616d652e6a730000000e0e000000010000000c00000000000000000000000000
ff000000000e000000030000000100090000000000010000000118000a8000000007000001ad000103030000049800040500000600078001070480020804000502b00005040000020503000103b0000100000000009d00000000057072696e74000000000568656c6c6f0140091eb851eb851f000000030000000000000000000300020000000100000001180c0b80010002340002009d0000009e000000020000000561646465720000000f66616b6546696c656e616d652e6a730000000d03000000010000000c000000000000000178000000000000000179000000010000000000000002000000017800000001790000000000000006676c6f62616c0000000f66616b6546696c656e616d652e6a730000000e0e000000010000000c00000000000000000000000000
load result type: 6
hello 3 3.14
call result type: 1

Loading…
Cancel
Save