Commit graph

10 commits

Author SHA1 Message Date
MuHong Byun
e2f1c3f47d Fix LGPL License verison typo (2.0 -> 2.1)
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
2020-03-10 11:35:20 +09:00
HyukWoo Park
3c6032f8c9 Fix bugs in function parameter
* 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>
2020-02-03 13:49:44 +09:00
Seonghyun Kim
ae35a576f5 Implement more things according to newer ECMAScript spec
* 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>
2020-01-22 18:01:52 +09:00
seonghyun kim
53906a6d81 Optimize runtime performance
* Optimize ObjectStructurePropertyDescriptor
* Don't initialize inline storage of VectorWithInlineStorage
* Add Object::setPrototypeForIntrinsicObjectCreation for fast initialize
* Add ArrayObject::ArrayObject(ExecutionState& state, const uint64_t& size) for fast initialize
* Store stack-limit instead of stack-base
* Reduce size of ExecutionState
* Add fast version of Object::ownPropertyKeys for optimize Object.keys
* Add ValueVectorWithInlineStorage
* Remove some compiler warnings

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-05 15:04:20 +09:00
Patrick Kim
66bd235740 Remove c++ try-catch statement in interpreter function. (#387)
* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-23 16:55:34 +09:00
Patrick Kim
3bc6cb5cca Don't store argc, argv on FunctionEnvironmentRecord. (#358)
Save argc, argv on ExecutionState is enough.
and if function call is end, argv member on env points wrong place.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-09 13:52:17 +09:00
Patrick Kim
864973236d Refactoring source code (#356)
* 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>
2019-08-08 12:20:19 +09:00
Hyukwoo Park
49266b6c9f Create rest parameter through bytecode interpretation (#348)
* CreateRestElement bytecode is newly added for generating a rest parameter
* RestElementNode is added to handle patterns in rest parameter later
* rest parameter is created at the first part of the function body execution

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-08-06 13:38:25 +09:00
Patrick Kim
43f442c560 Revise function call processes (#347)
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
    this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-06 09:58:06 +09:00
Patrick Kim
356a103466 Separate FunctionObject (#344)
There are so many features in FunctionObject. so I separate FunctionObject into multiple classes.
  * Implement FunctionObjectProcessCallGenerator class for generate processCall code for each derived FunctionObject and implement [[call]], [[construct]] separately
  * Implement NativeFunctionObject, BuiltinFunctionObject for process NativeCall separately
  * Implement ScriptArrowFunctionObject for process `this` separately
  * TODO : ScriptClassMethodFunctionObject, ScriptGeneratorFunctionObject.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-01 11:30:40 +09:00