Reduce the size of vm_frame_ctx_t. (#2886)

The reference to the previous context is only used by the debugger and the backtrace info,
so this element should not be part of the structure by default.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-06-21 14:04:24 +02:00
committed by Dániel Bátyai
parent 78657e667d
commit b707c3f8da
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -47,7 +47,9 @@ typedef struct vm_frame_ctx_t
ecma_value_t *stack_top_p; /**< stack top pointer */
ecma_value_t *literal_start_p; /**< literal list start pointer */
ecma_object_t *lex_env_p; /**< current lexical environment */
#if defined (JERRY_DEBUGGER) || defined (JERRY_ENABLE_LINE_INFO)
struct vm_frame_ctx_t *prev_context_p; /**< previous context */
#endif /* defined (JERRY_DEBUGGER) || defined (JERRY_ENABLE_LINE_INFO) */
ecma_value_t this_binding; /**< this binding */
ecma_value_t block_result; /**< block result */
#if ENABLED (JERRY_LINE_INFO)
+4 -1
View File
@@ -3552,6 +3552,7 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
JERRY_CONTEXT (status_flags) &= (uint32_t) ~ECMA_STATUS_DIRECT_EVAL;
vm_frame_ctx_t *prev_context_p = JERRY_CONTEXT (vm_top_context_p);
JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p;
vm_init_loop (frame_ctx_p);
@@ -3602,7 +3603,7 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
JERRY_CONTEXT (vm_recursion_counter)++;
#endif /* defined (JERRY_VM_RECURSION_LIMIT) && (JERRY_VM_RECURSION_LIMIT != 0) */
JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p->prev_context_p;
JERRY_CONTEXT (vm_top_context_p) = prev_context_p;
return completion_value;
}
}
@@ -3662,7 +3663,9 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
frame_ctx.byte_code_p = (uint8_t *) literal_p;
frame_ctx.byte_code_start_p = (uint8_t *) literal_p;
frame_ctx.lex_env_p = lex_env_p;
#if defined (JERRY_DEBUGGER) || defined (JERRY_ENABLE_LINE_INFO)
frame_ctx.prev_context_p = JERRY_CONTEXT (vm_top_context_p);
#endif /* defined (JERRY_DEBUGGER) || defined (JERRY_ENABLE_LINE_INFO) */
frame_ctx.this_binding = this_binding_value;
frame_ctx.block_result = ECMA_VALUE_UNDEFINED;
#if ENABLED (JERRY_LINE_INFO)