Implement logical assignment operators (#4834)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
Robert Fancsik
2021-11-30 10:44:27 +01:00
committed by GitHub
parent 70e275e92f
commit d69ac0e070
9 changed files with 679 additions and 245 deletions
+8
View File
@@ -3331,6 +3331,14 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
continue;
}
#if JERRY_ESNEXT
case VM_OC_POP_REFERENCE:
{
ecma_free_value (stack_top_p[-2]);
ecma_free_value (stack_top_p[-3]);
stack_top_p[-3] = stack_top_p[-1];
stack_top_p -= 2;
continue;
}
case VM_OC_BRANCH_IF_NULLISH:
{
left_value = stack_top_p[-1];
+2
View File
@@ -166,6 +166,7 @@ typedef enum
VM_OC_JUMP, /**< jump */
#if JERRY_ESNEXT
VM_OC_BRANCH_IF_NULLISH, /** branch if undefined or null */
VM_OC_POP_REFERENCE, /** prop identifier or property reference from the stack */
#endif /* JERRY_ESNEXT */
VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if strict equal */
@@ -325,6 +326,7 @@ typedef enum
#if !JERRY_ESNEXT
VM_OC_EXP = VM_OC_NONE, /**< exponentiation */
VM_OC_BRANCH_IF_NULLISH = VM_OC_NONE, /** branch if undefined or null */
VM_OC_POP_REFERENCE = VM_OC_NONE, /** prop identifier or property reference from the stack */
#endif /* !JERRY_ESNEXT */
#if !JERRY_DEBUGGER
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */