From 4c77cddec3b74696e2d8cdbd28f3d630b6d8fab1 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Fri, 24 Apr 2015 13:23:21 +0300 Subject: [PATCH] Adding configuration option to execute GC after each opcode. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com --- jerry-core/config.h | 5 +++++ jerry-core/vm/vm.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/jerry-core/config.h b/jerry-core/config.h index 6d39bd58f..89c4b3b62 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -170,4 +170,9 @@ */ #define CONFIG_EXTENSION_MAX_ARGUMENTS_IN_FUNCTION 16 +/** + * Run GC after execution of each opcode + */ +// #define CONFIG_VM_RUN_GC_AFTER_EACH_OPCODE + #endif /* !CONFIG_H */ diff --git a/jerry-core/vm/vm.cpp b/jerry-core/vm/vm.cpp index 846c0d0c3..4cf9b073d 100644 --- a/jerry-core/vm/vm.cpp +++ b/jerry-core/vm/vm.cpp @@ -439,6 +439,10 @@ run_int_loop (int_data_t *int_data) completion = __opfuncs[curr->op_idx] (*curr, int_data); +#ifdef CONFIG_VM_RUN_GC_AFTER_EACH_OPCODE + ecma_gc_run (); +#endif /* CONFIG_VM_RUN_GC_AFTER_EACH_OPCODE */ + #ifdef MEM_STATS interp_mem_stats_opcode_exit (int_data, opcode_pos,