* `initializeFunctionScript` API is added
* unlike dynamically created function, `initializeFunctionScript` supports debugger
* origin line offset is added for correct source code calculation in debugger
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* we can choose JS source code for debugging target
* selectively generating debugging byte code (breakpoint)
* add debugger init option (--skip=) to exclude certain source code from debugging
* rename debugger functions
* explicitly present the python version for debugger tool
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* turn on parserEnable flag in ScriptParser only
* Always store breakpointLocations in debugger(debugger can be turn on later)
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
- The debugger callbacks are implemented as class
- Using std::vector for storing data
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
* Each chain piece represents one of class
* User can uses private member with same name parent with child class
* We should check nearest [[homeObject]] of function to find where function is located
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* remove JumpByteCode and add JumpFlowRecord which has no pointer value
* simplify JumpFlowRecord data caching
* fix coverity issue
* add log message for code cache
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* wrap initializer expr into virtual arrow function like instance field
* users can access super property in eval
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* remove unused functions
* remove unused variables
* mark necessary but unused variables with UNUSED_VARIABLE
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* first, try to lock cache directory to enable CodeCache
* if file I/O fails, stop caching and remove all cache files
* flush and sync files when writing cache
* add tests to check file error cases
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* calculate cache file directory based on $HOME env
* handle all cache list in one file
* use source code's hash value for its cache data file name
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* CodeCache generates one meta file and data file for each JS file
* enable coverity scan to check CodeCache too
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* ByteCodeBlock does not hold location data info anymore
* location data of each bytecode is manually allocated only for stack-tracing or debugger mode
* duplicated String allocation for source code is removed
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* extract infrequently used m_rareData member from InterpretedCodeBlock
* InterpretedCodeBlockWithRareData handles InterpretedCodeBlockRareData inside itself
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Set value as undefined when there is SyntaxError
* Fix memory leak related with throwing esprima::Error
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* When there is arrow function on class ctor, we should use heap-allocated lex env for class ctor.
because we need to compute this variable on run-time
* when there is super expression with computed case, we should load this binding first for testing binding
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Fix parser error related with async arrow function
* CodeBlock may have diffrent source code start position data(from `function` keyword)
- new ECMAScript spec says we should make function source string from `function` keyword
* Apply new spec on builtin Function constructor
* AsyncFunctions must have correct initial properties
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Initialize function name binding in interpreter
* If there are so many var variables on function, we should make hash map for finding var fast
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Fixup canDeclareName in ASTContext
* Add more callstack information on API
* Add onDelete callback on VMInstance
* Add BloomFilter as util
* Use BloomFilter in ASTFunctionContext for find out variable name existence
* Optimize parser using InlineStorageVector
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* parsing of function including parameter list and function body is skipped in scanner mode
* m_bodySrc in InterpretedCodeBlock is removed because it is no longer necessary
* some operator overloading in FreeableNode and DestructibleNode is fixed
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* 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>