Improve the performance of the interpreter. (#3344)

Registers are stored immediately after the frame pointer and an argument is dropped from vm_run.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-11-22 12:47:11 +01:00
committed by Robert Fancsik
parent 996bf76f59
commit d006f068f4
4 changed files with 148 additions and 122 deletions
+11 -3
View File
@@ -43,13 +43,10 @@ typedef struct vm_frame_ctx_t
const ecma_compiled_code_t *bytecode_header_p; /**< currently executed byte-code data */
uint8_t *byte_code_p; /**< current byte code pointer */
uint8_t *byte_code_start_p; /**< byte code start pointer */
ecma_value_t *registers_p; /**< register start pointer */
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) || ENABLED (JERRY_LINE_INFO)
struct vm_frame_ctx_t *prev_context_p; /**< previous context */
#endif /* defined (JERRY_DEBUGGER) || ENABLED (JERRY_LINE_INFO) */
ecma_value_t this_binding; /**< this binding */
ecma_value_t block_result; /**< block result */
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ES2015_MODULE_SYSTEM)
@@ -61,8 +58,19 @@ typedef struct vm_frame_ctx_t
uint16_t context_depth; /**< current context depth */
uint8_t is_eval_code; /**< eval mode flag */
uint8_t call_operation; /**< perform a call or construct operation */
/* Registers start immediately after the frame context. */
} vm_frame_ctx_t;
/**
* Get register list corresponding to the frame context.
*/
#define VM_GET_REGISTERS(frame_ctx_p) ((ecma_value_t *) (frame_ctx_p + 1))
/**
* Read or write a specific register.
*/
#define VM_GET_REGISTER(frame_ctx_p, i) (((ecma_value_t *) (frame_ctx_p + 1))[i])
/**
* @}
* @}