* Implement String with inline buffer. this reduce malloc count & reduce memory usage
* Remove typed-gc-malloc from some classes.
typed malloc classes should have storage for descriptor each malloc.
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* add simple syntax checker method in parser to check parameters and body string
* fix it to check parameters and body string seperately
* add several TCs for this patch too
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* add relocation case for freeze function address
* remove empty strings from ByteCode and ByteCodeBlock literal list
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Enable for await statement for Global Module code
* Disable html comment when parsing module code
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* bf_context_t is now defined as a global variable and maintained during the runtime
* VMInstance::finalize is invoked at the end of program to guarantee the life time of bf_context_t
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Optimize String.prototype.trim method
* Turn off slow tests in test262. these tests are failed on some machine due to timeout
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>
* 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>
Allowing U+2028 (LINE SEPARATOR) and U+2029
(PARAGRAPH SEPARATOR) in string literals
defined in ECMAScript 2019.
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
* Treat single `let` as Identifier in parsing ExpressionStatement
* The `let` contextual keyword must not contain Unicode escape sequences.
* U+180E had been changed to `Other, Format [Cf]` from `Separator, Space [Zs]`
see https://github.com/tc39/ecma262/pull/300, https://github.com/Microsoft/ChakraCore/issues/2120
* The `let` contextual keyword must not contain Unicode escape sequences
* We need to allocate new env on right side of for in-of head when there is lexical decl on left side
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Compress CompressibleStrings on GC reclaim end event
- if there is reference about data of CompressibleString on stack, we should give up compressing.
we don't need to search heap space because I redesigned StringView
(we should not store string buffer data on heap without owner)
* Redesign StringView
- Don't save string buffer address as its member. because buffer of CompressibleString can be deleted
- If we don't save string buffer address on StringView, parser performance may dropped.
becuase parser access string data a lot.
so I introduce ParserStringView. it saves buffer address. we should ParserStringView on parser only.
we can save string buffer address while parsing. because GC is disabled while parsing.
* Enable CompressibleString always
* Implement cache of RegExpOptionStrings
* Implement finding system locale function on RuntimeICUBinder avoiding call uloc_getDefault.
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* check and convert to strict mode ahead of following tokens
* identifier which has a valid keyword in strict mode is also converted to the complete keyword
* fixes#513
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
* 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>
* add empty async related Nodes
* await and async are handled as a normal identifier
* add const keyword for passed NodeList reference in Node constructor
Signed-off-by: HyukWoo Park <hyukwoo.park@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>
* 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>
* 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>