mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
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:
parent
0f144eafed
commit
13343f8417
131 changed files with 1339 additions and 1106 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue