* fix a case that arrow function is located at the first of script
* fix a case that toStringWithoutException is called with no SandBox
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
If the second argument is undefined in endsWith() the position
should be set to the length of the string in question.
Enable corresponding v8 test: es6/string-endsWith
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
* Fix BDWGC compile option
* Fix build error on ndk
* Global declared function declaration should always create binding
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>
* In Proxy's defineOwnProperty, set settingConfigFalse to true if desc has a [[Configurable]] field and if desc.[[Configurable]] is false
* Use a length properly according to spec at each sort implementations
* Ignore tests where the only reason for the test failure is an error message difference
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
* Build numeral literal number in token only if needs
* Build string literal for ast only if needs
* Move NumeralData from ASTContext to ASTNode
* Fix compile error on gcc 7+
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* small-sized SmallScannerResult replaces origin ScannerResult in parsing process to reduce the memory pressure.
* ScannerResultVector in parseBinaryExpression is replaced by GC-independent SmallScannerResultVector to reduce the memory overhead (both the performance and memory usage)
* ParseFormalParametersResult holds SyntaxNodeVector instead of NodeVector because each parameter Node is re-generated when it is really necessary (parsing of function call) and we only needs the name and type of each parameter during the pre-parsing
* parser/scanner of parameter parsing is added
* clear up some unnecessary codes such as each friend class annotation in Nodes and NodeVectors
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>
* Create a property only when each field of desc presents at fromObjectPropertyDescriptor
* Add a ArrayIteratorPrototypeObject
* Call iteratorClose correctly at Array.from
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
* Don't allocate new StringView on parser if possible
* Store esprima::Context::firstCoverInitializedNameError as pointer. it can reduce copy cost on esprima::*CoverGrammar
* Make Script as reexcutable if possible
* Don't save parsed source codes
- Remove SourceStringView
- When create AtomicString from StringView, we should make new string data instead of reference StringView
* Reduce size of StringBufferAccessData
* Fix crash in toString of FunctionObject.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* all parser and scanner methods share common parsing codes, but part of creating a new Node is implemented by two ASTBuilders which are passed as argument
* SyntaxChecker only checks any syntax error
* NodeGenerator checks any syntax error and also creates a new Node
* remove unused Node methods and fix some typo in Node
* esprima::Messages is divided into another header file
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
Few Math functions needed a minor fix (min,max,hypot).
Basily if the first agrument was NaN or infinity, then don't convert the other arguments toNumber.
Also enabled one V8 test.
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
* Close iterator when throwing an error
* Clamp the Uint8ClampedArray value properly.
* pass more spidermonkey tests
Signed-off-by: Boram Bae <boram21.bae@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>
* Use a byteLength when creating new TypedArray from another TypedArray.
* Keep the isLexicallyDeclaredBindingInitialization value when generating storeBytecode on ArrayPatternNode
* Pass more SpiderMonkeyTCs
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
* PointerValueRef should inherit ValueRef
* Implement PersistentRefHolder for easy-rooting
* Remove SandBox interface for public
* Re-implement shell through public API
* Implement Platform for supprot various platform easily
* Add many missed public API methods(Set, Map, Symbol...)
* Add Memory class into public
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* uneval builtinfunction is added to run spidermonkey TCs
* fork from https://github.com/mozilla/gecko-dev/tree/master/js/src/tests (commit 6bd2528448bfb148833e9bb6d9b4084296dd342a)
* remove babel files
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
Related methods:
- Array.isArray
- JSON.stringify
- JSON.parse
- Object.prototype.toString
Also fixed some errors in the Promise builtin rotuines to enable more tests.
Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
* 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>
* add invalid hexadecimal escape sequence error
* lexical declaration cannot appear in a single-statement context
* ASTContext structures are divided into another file
* pass more test262 TCs
Signed-off-by: HyukWoo Park <hyukwoo.park@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>