Optimize memory management in Parsing (#465)

* Revise AST Node allocation through ASTPool

* ASTAllocator is newly added for allocation of AST Nodes
* AST Node is allocated in pool memory and flushed once after bytecode is generated
* All reference counting overhead related to AST Node is removed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>

* Reduce memory operations in Parsing

* empty vector called SyntaxNodeVector is added for SyntaxChecker
* ASTFunctionScopeContext and ASTBlockScopeContext are allocated in ast pool instead of GC heap
* memory leak(ShellPlatform) in shell is fixed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
Hyukwoo Park 2019-10-21 20:01:18 +09:00 committed by Boram Bae
commit 13343f8417
131 changed files with 1339 additions and 1106 deletions

View file

@ -21,6 +21,7 @@
#include <vector>
#include "api/EscargotPublic.h"
#include "malloc.h"
#if defined(ESCARGOT_ENABLE_TEST)
// these header & function below are used for Escargot internal development
@ -526,7 +527,8 @@ int main(int argc, char* argv[])
Memory::setGCFrequency(24);
PersistentRefHolder<VMInstanceRef> instance = VMInstanceRef::create(new ShellPlatform());
ShellPlatform* platform = new ShellPlatform();
PersistentRefHolder<VMInstanceRef> instance = VMInstanceRef::create(platform);
PersistentRefHolder<ContextRef> context = createEscargotContext(instance.get());
bool runShell = true;
@ -599,5 +601,7 @@ int main(int argc, char* argv[])
Globals::finalize();
delete platform;
return 0;
}