Tracking variables to reduce the memory consumption of scope chain. (#1819)

Currently we keep all local variables in the scope chain as long as
a nested function is alive. These variables consume memory although
several of them are never used. This patch focuses on removing those
unused ones whose can be detected at parsing time.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-05-15 09:00:57 +02:00
committed by GitHub
parent 8143a0cc10
commit f5b385ca6c
7 changed files with 168 additions and 44 deletions
+4 -2
View File
@@ -67,10 +67,12 @@ typedef enum
#define LEXER_FLAG_FUNCTION_NAME 0x08
/* This local identifier is a function argument. */
#define LEXER_FLAG_FUNCTION_ARGUMENT 0x10
/* This local identifier is not used in the current context. */
#define LEXER_FLAG_UNUSED_IDENT 0x20
/* No space is allocated for this character literal. */
#define LEXER_FLAG_SOURCE_PTR 0x20
#define LEXER_FLAG_SOURCE_PTR 0x40
/* Initialize this variable after the byte code is freed. */
#define LEXER_FLAG_LATE_INIT 0x40
#define LEXER_FLAG_LATE_INIT 0x80
/**
* Literal data.