* apparent Identifier name is directly added to getter, setter function
* remove one LoadLiteral bytecode for each name of getter, setter function
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* add symbol name for property method if it is not an empty symbol
* MetaNode in parseLabelledStatement is fixed correctly
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* fix function length to represent the number of consecutive identifiers from the start of parameter list
* collect parameter names including the target names of patterns and rest element
* separate function length and parameter count
* simplify the process of parameter collecting and rename parameter related functions more intuitively
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* fix to compare string/symbol correctly in marking enumerated key
* fix iterator close operation to call 'return' function of iterator and then throw exception
* add implicit name in object property parsing
* resolve each target of pattern first, and then store the value into it
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
* IteratorBind bytecode is newly added to handle the iteratior binding according to the standard (es10)
* iterator binding operations for array element and rest element of array pattern are updated
* IteratorStep related with for-of operation is left as future work
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* handle IteratorRecord and its property by normal Object
* for the ease of accessing and handling in the interpreter
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Many JS Frameworks or librarys use `function.apply(<any>, arguments)` pattern.
but this statement generate arguments object. generateing arguments object is very expensive.
we can optimize simple cases like `function() { fn.apply(this, arguments); }`
* Merge many ByteCode opcodes into CallFunctionComplexCase.
* Do gc when allocate large ArrayBuferObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Implement RuntimeICUBinder
- ICU has verison name on its symbol name like u_tolower_XX.
but, we need to use escargot on various platform(without re-compile)
thus, I implement this library
* add ceil function on IEEE754
- there is an issue with -0 in builtin ceil function
* Use pypy instead of python for running test262(pypy is faster than python)
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Store array length property in its member variable not value vector
- This can reduce one of GC_MALLOC call if there is not value in ArrayObject other than fastmode value
* Prevent memory leak from VMInstance, Context
* Change vector capacity reserve strategy
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Reduce size of RopeString
* Use fit memory if possible for ArrayObject fastModeData
* Re-implement ByteCode pruning logic
* Re-implement inline-cache for reducing memory usage
* Remove std::vector with gc_allocator. it can cause memory leak
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* iterator and its related operations are renewed based on the ECMAScript2019
* disable one incorrect v8 TC
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Finding & read desc at once in ObjectStructure
* Improve findProperty performance in ObjectStructure
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* update exponential operation and exponentiation-equal assignment
* unnecessary header files are removed in some Node files
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* BindingRestElement bytecode handles Iterator and EnumerateObject both
* MarkEnumerateKey bytecode is added to mark visited properties
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* EnumerateObject is reworked and two derived classes are newly added
* Object spread element is handled through EnumerateObjectWithDestruction
* for-in operation is handled through EnumerateObjectWithIteration
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Divide ObjectStructure into 3 types
* Add transition look up hash map into ObjectStructureWithTransition
* Use faster version of log2 on Vector
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* When evaluate for-in, we should call [[Enumerate]] function & we shouldn't literate symbols and non-enumerable names.
* In esprima, we need to reset lastUsingName on {open, close}Block
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
Basically when we iterated an object's keys, it was not in ascending order.
Also when one of the keys enumerable was changed to false, it was still in the list.
Enabled one V8 test.
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
* 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>
* Reimplement finally block in try-statement.
* Replace `ReturnFunction`, `ReturnFunctionWithValue` bytecode with `End`.
* When for-of loop is exited by exception or break, we need to close iterator
* Don't add Return Statement in ByteCodeGenerator. We should add Return Statement in ScriptParser.
* Fix bug in yield expression.
* Implement add implicit class name on class expression.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Also use SuperSetObjectOperation for super node when not a precomputed case in generateStoreByteCode in MemberExpressionNode
* Update vendor test submodule
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
* Process 0x2028, 0x2029 char on template literal correctly
* Object are created by TaggedTemplateLiteral are should frozen
* When eval `super.foo = 1`, use `this` as receiver
* Implement Function.protoype.caller
* Fix processing '\0' char bug in builtinFileReadHelper
* When eval `yield delegate` repect it's result.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* in ES6, we need to set function name when object literal has function expression on right side
* in ES6, we should not check duplicated property name on object literal
* Refactor Object::hasInstance & Object::getMethod
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* spread is allocated on an array object in advance to know the entire length of array when it is used in array initializer
* spread array is fixed fast mode array which means that Array.prototype could not affect any array operation of spread array
* pass v8 TCs
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Fixup class parsing error check in esprima
* Class cannot have property named 'prototype'
* When define {getter, setter} in interpreter, property key can be symbol
* Reorder properties on class constructor
* Fixup public API
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* add check code for ObjectPattern without AssignmentPropertyList
* handle the case when value of PropertyNode is a MemberExpression
* add generateStoreByteCode module for SpreadElement
* pass related TCs in test262
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Test zero started number correctly
* global Date, Number prototypes should have "Object" on [[class]] internal property
* global {*}Error have Error.prototype in [[prototype]] prototype
* Should call iteratorClose function on When get exception on {Map, Set, WeakSet, WeakMap} constructor.
* Math.imul.length is 2
* Some global Object util functions don't require Object as first parameter from ES6.
* Re-implement Promise.{all, race} for using iterator correctly
* Fix template literal token start position bug in Lexer
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Revise hasProperty and apply it everywhere
* Add hasIndexedProperty for performance
* Change Object::nextIndex{Forward, Backward} double parameter types into int for performance
* in String.prototype.replace, Use test fast path correctly & use old method because newer method cannot support regexp correctly(old method is faster)
Signed-off-by: seonghyun kim <sh8281.kim@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>
* 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>
* Inline Object::getPrototypeObject function in inline-cache functions(interpreter)
* Use POINTER_VALUE_STRING_TAG_IN_DATA, POINTER_VALUE_SYMBOL_TAG_IN_DATA for finding PointerValue type quickly
Signed-off-by: seonghyun kim <sh8281.kim@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>