* declarations of block scoped variables are correctly handled
* const variable check is added to GlobalEnvironmentRecord::setMutableBindingByBindingSlot
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* simplify bytecode generation of ArrayPatternNode and ObjectPatternNode by implementing generateStoreByteCode method
* fix bugs related to variable declarations by patterns
* remove unnecessary members in pattern
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* We can use try-catch with yield together now.
* Implement return, throw function in GeneratorObject correctly
* yield expression parsing in esprima 3.1.1 is wrong. so I get right version of yield parsing from newer version of esprima
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* CodeBlock has essential parameter name list only
* toString builtin function is fixed to use the entire source instead of body source
* some TCs are fixed upto the spec
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* each parameter is initialized by bytecode execution
* patterns in parameter list are no longer allocated in the heap in default
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* check duplicated parameter names at once
* temporal nodes are allocated on stack
* remove unnecessary structs and flags
* sync parsing part of default parameter to that of esprima code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
- We should not heap allocated env on...
* functions uses variable on upper function
* functions have `typeof` operation
* functions have unmapped arguments object
- Improve calling function performance by remove accessing vtable once in interpreter(from isCallable, call to just call)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Add ESCARGOT_ASAN options for debug
* Throw statement should have correct line:column number
* Fix bug in sunspider-js in test driver. if we want to run sunspider test cases at once, excution order is important because some test ruins GlobalObject
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* arrow function body is skipped in scan mode to match parseSingleFunctionChildIndex consistently with normal function body block
* extract parameter names right after pushing a scope context
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* we should parse the parameter list together for each function calls to treat argument initializers such as rest, default parameters
* for each function calls, we first parse the parameter list and then, parse the function body sequentially
* also remove and clearup some unnecessary parsing modules
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
Fixed a bug when an arrow function with block braces is inside an arrow function without braces handled incorrently during an outer function lazy instantiation.
The inner arrow function treated the most outer simple function as its parent instead of the outer arrow function due to the invalid use of config.parseSingleFunction.
Also the 0 parseFunctionIndex must be valid for arrow functions as well during the lazy instantiation.
This patch fixes#343.
Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
* CreateRestElement bytecode is newly added for generating a rest parameter
* RestElementNode is added to handle patterns in rest parameter later
* rest parameter is created at the first part of the function body execution
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
There are so many features in FunctionObject. so I separate FunctionObject into multiple classes.
* Implement FunctionObjectProcessCallGenerator class for generate processCall code for each derived FunctionObject and implement [[call]], [[construct]] separately
* Implement NativeFunctionObject, BuiltinFunctionObject for process NativeCall separately
* Implement ScriptArrowFunctionObject for process `this` separately
* TODO : ScriptClassMethodFunctionObject, ScriptGeneratorFunctionObject.
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>
* ScanExpresionResult stores additional AtomicString info to sync with esprima code more intuitively
* scanner for groupExpression module is updated
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
* each ScannerResult is now allocated on the stack if it is really necessary
* reduce the reference count overhead for each ScannerResult
* ALLOC_TOKEN macro is newly added for allocation of each ScannerResult token
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* left should not be assignmentexpression in for-of statement
* this object for iterator operation fixed
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* scanner should be indexed on the relative position to the start position of each parsing unit, so Marker is used instead
* test cases for arrow-function are newly added
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>