Remove the ENABLED/DISABLED macros (#4515)
The removal of these macros enabled cppcheck to reveal new errors. These errors are also fixed by the patch. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
+18
-18
@@ -41,7 +41,7 @@ JERRY_STATIC_ASSERT (PARSER_WITH_CONTEXT_STACK_ALLOCATION == PARSER_TRY_CONTEXT_
|
||||
JERRY_STATIC_ASSERT (PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION == PARSER_FOR_AWAIT_OF_CONTEXT_STACK_ALLOCATION,
|
||||
for_of_context_stack_allocation_must_be_equal_to_for_await_of_context_stack_allocation);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
/**
|
||||
* Abort (finalize) the current variable length stack context, and remove it.
|
||||
*
|
||||
@@ -74,7 +74,7 @@ vm_stack_context_abort_variable_length (vm_frame_ctx_t *frame_ctx_p, /**< frame
|
||||
|
||||
return vm_stack_top_p;
|
||||
} /* vm_stack_context_abort_variable_length */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Abort (finalize) the current stack context, and remove it.
|
||||
@@ -111,16 +111,16 @@ vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
}
|
||||
case VM_CONTEXT_TRY:
|
||||
case VM_CONTEXT_CATCH:
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
case VM_CONTEXT_BLOCK:
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
case VM_CONTEXT_WITH:
|
||||
{
|
||||
VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
|
||||
vm_stack_top_p -= PARSER_WITH_CONTEXT_STACK_ALLOCATION;
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
case VM_CONTEXT_ITERATOR:
|
||||
case VM_CONTEXT_OBJ_INIT:
|
||||
case VM_CONTEXT_OBJ_INIT_REST:
|
||||
@@ -139,7 +139,7 @@ vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
vm_stack_top_p -= PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (VM_GET_CONTEXT_TYPE (vm_stack_top_p[-1]) == VM_CONTEXT_FOR_IN);
|
||||
@@ -199,7 +199,7 @@ vm_decode_branch_offset (const uint8_t *branch_offset_p, /**< start offset of by
|
||||
return branch_offset;
|
||||
} /* vm_decode_branch_offset */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Byte code which resumes an executable object with throw
|
||||
@@ -209,7 +209,7 @@ static const uint8_t vm_stack_resume_executable_object_with_context_end[1] =
|
||||
CBC_CONTEXT_END
|
||||
};
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Find a finally up to the end position.
|
||||
@@ -253,7 +253,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
return VM_CONTEXT_FOUND_EXPECTED;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (stack_top_p[-1] & VM_CONTEXT_HAS_LEX_ENV)
|
||||
{
|
||||
ecma_object_t *lex_env_p = frame_ctx_p->lex_env_p;
|
||||
@@ -261,7 +261,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
frame_ctx_p->lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
|
||||
ecma_deref_object (lex_env_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
byte_code_p = frame_ctx_p->byte_code_start_p + context_end;
|
||||
|
||||
@@ -302,7 +302,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
{
|
||||
JERRY_ASSERT (context_type == VM_CONTEXT_CATCH);
|
||||
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
#if !JERRY_ESNEXT
|
||||
if (stack_top_p[-1] & VM_CONTEXT_HAS_LEX_ENV)
|
||||
{
|
||||
ecma_object_t *lex_env_p = frame_ctx_p->lex_env_p;
|
||||
@@ -310,7 +310,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
frame_ctx_p->lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
|
||||
ecma_deref_object (lex_env_p);
|
||||
}
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
if (byte_code_p[0] == CBC_CONTEXT_END)
|
||||
{
|
||||
@@ -325,7 +325,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
VM_PLUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FINALLY_CONTEXT_EXTRA_STACK_ALLOCATION);
|
||||
stack_top_p += PARSER_FINALLY_CONTEXT_EXTRA_STACK_ALLOCATION;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (JERRY_UNLIKELY (byte_code_p[1] == CBC_EXT_ASYNC_EXIT))
|
||||
{
|
||||
branch_offset = (uint32_t) (byte_code_p - frame_ctx_p->byte_code_start_p);
|
||||
@@ -335,7 +335,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
frame_ctx_p->stack_top_p = stack_top_p;
|
||||
return VM_CONTEXT_FOUND_FINALLY;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
JERRY_ASSERT (byte_code_p[1] >= CBC_EXT_FINALLY
|
||||
&& byte_code_p[1] <= CBC_EXT_FINALLY_3);
|
||||
@@ -353,7 +353,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
frame_ctx_p->stack_top_p = stack_top_p;
|
||||
return VM_CONTEXT_FOUND_FINALLY;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
else if (stack_top_p[-1] & VM_CONTEXT_CLOSE_ITERATOR)
|
||||
{
|
||||
JERRY_ASSERT (context_type == VM_CONTEXT_FOR_OF
|
||||
@@ -455,7 +455,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
jcontext_raise_exception (exception);
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
stack_top_p = vm_stack_context_abort (frame_ctx_p, stack_top_p);
|
||||
}
|
||||
@@ -464,7 +464,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
return VM_CONTEXT_FOUND_EXPECTED;
|
||||
} /* vm_stack_find_finally */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Get the offsets of ecma values corresponding to the passed context.
|
||||
@@ -586,7 +586,7 @@ vm_ref_lex_env_chain (ecma_object_t *lex_env_p, /**< top of lexical environment
|
||||
while (context_top_p > context_end_p);
|
||||
} /* vm_ref_lex_env_chain */
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user