* 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>
* Store child {ASTFunctionContext, InterpretedCodeBlock} as linked-list
* Reduce size of ScannerResult
* Remove Parser::scopeContexts
* Fix compile error in old system
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Rename ESCARGOT_OUTPUT=bin into shell and make shell_test for testing.
* Remove ESCARGOT_SHELL, -SCARGOT_STANDALONE and Rename ESCARGOT_ENABLE_VENDORTEST into ESCARGOT_ENABLE_TEST.
* Fix bug in PersistentRefHolder
* Add DebuggerStatementNode for preventing parsing error even if we cannot support
* Revise Platform layer for supporting es6 module
* Implmenent class constructor toString
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* we should replace block context before executing update expression in for statement
* merge ObjectDefineGetter, ObjectDefineSetter byte code into one code
* add some missed scan operation in parser
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Optmize String.protype.split function.
when separator comes to RegExpObject split function, we have to call @@split function when there is a @@split function.
old one is correct implementation but performance is bad...
but we already have optmized split function with RegExp in builtinStringSplit.
I make to use old one when if user didn't defined own @@split function.
RegExp test score is changed from 57 to 280 in my computer.
* Make Value::isCallable inline-able.
* Make to use shared data among {Get,Set}GlobalVariable. this may reduce usage & improve performance
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* treat variable in catch() as let
* add lexical environment record data into global environment for saving global permanently
* re-implement variable access bytecode generation
* re-implement class initialize operation
* re-implement global variable access bytecode for support lexcial variables in global
* fix bugs related with per-iteration lexical environment in for-statement
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
- Store lexcial block informantion in InterpretedCodeBlock.
- If lexcial block has no lexcial variables, we should collapse the block.
- If there is no heap-allocated variables in lexcial environment, we can skip allocation of the environment.
- Implement Indexed storage for lexcial environment.
- Allocate lexcial variables in function stack storage if possible.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* in most cases, parsing and bytecode generation process runs sequentially
* parsing error throws SyntaxError exception inside sandbox and this exception will be catched by the sandbox
* clear up some complicated code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
Pass null pointers for ByteCodeInterpreter::interpret to indicate
the OpcodeTable initialization. In this case the FillOpcodeTable
opcode can be removed.
Signed-off-by: Roland Takacs <rtakacs.uszeged@partner.samsung.com>
To support snapshots in the future, ByteCode class should not have any virtual methods.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
* add icu as submodule
* Fix some wrong implemations
* Remove functions defined on ctypes.h. its implemations slightly different on POSIX and Windows.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. divide CodeBlock into CodeBlock and InterpretedCodeBlock for saving memory
3. expand SCANNER_RESULT_POOL_INITIAL_SIZE to 128
4. connect String -> AtomicString with remaining space of String::m_tag
5. optimize Function.bind
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. when function name explicitly declared in its scope, initial value of function name is undefined
3. Function ctor should consider comments correctly
4. evaluate MemberExpression correctly
5. reset RegExpObject::lastIndex correctly
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. evalute function decl in catch correctly
3. give receiver of get, set in interpreter correctly
4. give right StackTrace information in with, try-catch for user
5. fix bug in argument object around get, set variable
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. optimize function calling performance
- change local variable binding order (this, function name first)
- revise opcode table init method
3. remove OpcodeTable::m_reverseTable
4. use shared thrower JSGetterSetter instance for arguments, function object
5. revise Function.prototype.toString for to print function's source
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. implement DeclareFunctionDeclarationsInGlobal, ReturnFunctionSlowCase
3. remove m_canUseDisalignedRegister in ByteCodeGenerator
4. remove ExectuionResult in ExecutionState
5. do multiple array initialization in ArrayDefineOwnPropertyOperation
6. revise FunctionObject::call, UpdateExpressions
7. fix wrong global codeBlock decision in GlobalObject::eval
8. arguments binding can be added in non-indexed mode
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. use direct memory reference instead of in-direct memory reference in GetObjectPrecomputedCase
3. use StringView with String::subString if needed
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. implement selective clearing Stack
- only blockes have object, array, new expression are cleared by ClearStack function now
3. improve get object inline cache
4. remove CodeBlock::hasNonConfiguableNameOnGlobal
5. add thisValue in ExecutionState
6. optimize Value::abstractEqualsToSlowCase
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. disable thread function in bdwgc
3. remove m_version from ObjectStructure
4. add rawBuffer in TypedArrayObject
5. remove wrong usage of Value::toArrayIndex and Value::toIndex
6. optimize String::tryToUseAsArrayIndex, String::tryToUseAsIndex
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Manage a corner case in computing node LOC from bytecode
* Change the VM's timezoneID setting to be lazy (because of a memory usage)
* Fix some bugs on DateObject operation
Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2. use stackStorage for "arguments" object
3. do not insert empty name for ASTScopeContext when comes emptyString in FunctionExpression name
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. store ByteCodeLOC in ByteCodeBlock & lazy store loc
3. optimize builtin Array.prototype.splice
4. optimize Value::toNumberSlowCase
5. optimize arguments object
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2. implicitly delete AST when ast is useless
3. allocate String::emptyString correctly
4. hide ptr in LeakChecker for better tracing
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>