* 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>
* 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>
* 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>
* 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>
* Remove some unused function, variables
* Remove LexicalEnvironment from NativeFunctionObject
* Don't save stack-allocated LexicalEnvironment on ScriptFunctionObject. it may cause memory leak from stack
* Don't store newTarget, ThisBinded value on FunctionEnvironmentRecord if possible(we don't need these values except class functions)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
- Introduce INIT_STATIC_STRING macro to make adding new static string much easier.
- Introduce AtomicString::initStaticString to append static string to the static string set directly
without lookup for an already existing name.
- Add a number list and remove the dtoa function call for the initialization of string numbers.
- Split the single character initialization to ASCII and Latin1 string part.
Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
- 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>
* 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>
Rewamped a little bit of code, reported by SonarCloud for code smell.
Redudant parenthesis, and empty if statement code blocks.
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
The code had the place for parsing octal numbers like `0o543` and
`0O543`, but due to an implementation error the code returned with
`Unexpected token ILLEGAL`.
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
There is a lot of code duplication for parser and scanner.
Source code duplications can be reduced by templates without sacrificing performance.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Start hiding private helper functions from outside world. Next step
will be hiding private data members.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Introduce EmptyCodePoint constant to represent the empty case.
Also hex conversion is simplified.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Instead of maintaining a structure in memory simply re-scan the
right brace when a template is parsed.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Currently the parser is a very large file and hard to maintain. This patch is
the first which splits it into smaller files.
During the move some style fixes are applied. The identifer start
detection is improved as well.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com