* 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>
* Object, Array, Environment record internal space should use 32bit addressing on 64bit
* Rename SmallValue to EncodedValue.
* Implement EncodedSmallValue for using 32bit address on 64bit
* Implement special vectors for EncodedSmallValue.
- we need these special vector. because when push_back or inserting the value what we want to insert
can be removed by GC because the parameter type is 32bit(EncodedSmallValue).
* Update GCutil for 32bit addressing on 64bit
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* add element get/set internal method to TypedArray
* internal methods of TypedArray directly access array buffer
* disable inline cache only when property name is related to "Infinity"
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* If we use Object::nextIndexBackward, Object::nextIndexForward with non ordinal object,
we should not test existence of value for index(we would not call user-defined function)
* Generate more user-friendly callstack
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* remove each unnecessary length method
* getArrayLength and lengthES6 have been renamed
* return type of toLength is changed to uint64_t
* use createListFromArrayLike for more cases
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* type check operations based on tag comparison are updated to be aggresively inlined replacing virtual function calls
* Object, String and Symbol use pre-defined tag values while other uses vtable address as its tag value
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Revise Object::getPrototypeFromConstructor. we should get prototype from context of consturctor
* We should pass Optional<Object*> instead of Value with newTarget.
* Give correct prototype value for function prototypes and functions
* Implement %ThrowTypeError% correctly
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* remove duplicated initialization for [[Prototype]] internal slot
* initialize prototype value directly when each Object created
* each prototype candidate object should be first marked as prototype object
* setGlobalIntrinsicObject marks fixed structure and prototype for global object's intrinsic object initialization
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* caller extension of ArgumentsObject is removed from recent ECMAScript standard
* __proto__ on object expression is changed.
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Object::construct directly calls each internal construct method without any check code
* ByteCodeInterpreter::constructOperation is added to run IsConstructor check code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Implement basic behavior of for-await-of statement
* for statement should allow `for (..) let {}` form
* Fix bug in yield*
* AsyncFromSyncIteratorContinuation is changed on newer drafted spec(11.0). I apply the change.
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Generator is also executed until parameter initialize block when generator function is called
* Generator method in object should indicate correct place to start
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Reimplement yield * expression
We should implement yield* expression by ByteCodes
because we need to pause so many times at single iteration with async generator
* Merge multiple Iteration* ByteCodes into single IterationOperation
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Implement Async-from-Sync Iterator Object
* Replace object that used in iteration with IteratorRecord class
* Implement yield expression in async generator correctly
* Move ECMAScript operaton functions(promise*, await, generator, async) into related class
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
+ if test262 test has both IsNegative and IsAsync, we should consider IsNegativeFirst when figure out it ran successfully
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* 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>