Commit graph

37 commits

Author SHA1 Message Date
HyukWoo Park
26af0cddc6 [return-check] change exception handling to return-check based method in interpreting (runtime) process
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-18 18:36:46 +09:00
HyukWoo Park
d231bc0800 Rename tagging operations
* rename tagging operations to clearly recognize typeTag and tag (vtable address)
* add global tag values for ScriptSimpleFunctionObject

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-22 16:11:56 +09:00
HyukWoo Park
d0716850af Rename required register numbers for ByteCodeBlock
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-06 09:55:14 +09:00
Seonghyun Kim
ebf4756480 Binding function object in interpreter and compute required stack size early
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-28 14:39:52 +09:00
Seonghyun Kim
c9f14d2a87 Implement ScriptSimpleFunctionObject for enhance function call performance
many general function can use ScriptSimpleFunctionObject.
It has simple call operation

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-23 10:53:36 +09:00
HyukWoo Park
bd35e41168 Add setName API of FunctionObject
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-01-13 13:24:09 +09:00
Seonghyun Kim
ba1393c8e1 Add InlineStorage for FunctionEnvironmentRecordOnHeap
for runnung octane, we should make 1.05M copies of FunctionEnvironmentRecordOnHeap.
but almost copies(0.84M) of FunctionEnvironmentRecordOnHeap use under 5 heapStorage.
If we inline heapStorage, we can reduce count of GC_MALLOC.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-12-20 18:04:35 +09:00
HyukWoo Park
aef7ba0c98 Update GC event callback registration
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-07 08:39:04 +09:00
HyukWoo Park
e47add9264 Remove ambiguous NULLABLE macro
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-03-04 15:53:45 +09:00
HyukWoo Park
29c70f7532 Update clang-format version to 6.0
* coding convention fixed following the new clang-format

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-12-18 11:13:15 +09:00
HyukWoo Park
3ebb4ea634 Remove redundant header files
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-06 17:00:18 +09:00
Seungsoo Lee
bbacfbac0d Fix SVace bugs
* Fix uninitialized class member bug
* Change ifdef NDEBUG to ifndef NDEBUG

Signed-off-by: Seungsoo Lee <seugnsoo47.lee@samsung.com>
2020-09-10 14:44:51 +09:00
Seonghyun Kim
25588dcb01 Implement NamedPropertyHandler API to ObjectTemplate
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-07-23 15:19:31 +09:00
HyukWoo Park
2fe9333814 Divide CodeBlock into NativeCodeBlock and InterpretedCodeBlock
* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-07-08 16:56:44 +09:00
Seonghyun Kim
1bd124fc1b Revise function call & Realm
* 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>
2020-04-02 17:06:53 +09:00
HyukWoo Park
39a5922437 Fix [[Prototype]] initialization process for each object creation
* 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>
2020-03-24 18:26:25 +09:00
HyukWoo Park
ed616194d8 Implement OrdinaryCreateFromConstructor
* each builtin constructor of intrinsic object gets prototype from GetPrototypeFromConstructor
* Reflect constructor is fixed to pass newTarget to Construct operation

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-03-16 16:52:44 +09:00
HyukWoo Park
d9a9bcf860 Remove duplicated check code in Construct operation
* 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>
2020-03-12 13:32:31 +09:00
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
Seonghyun Kim
e38424a036 Give correct prototype for instances of AsyncGeneratorFunction
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-02-14 16:37:45 +09:00
Seonghyun Kim
f61ef74973 Implement basic of AsyncGeneratorFunction
* Add ScriptAsyncGeneratorFunctionObject, AsyncGeneatorObject
  * Implement basic behavior of AsyncGeneratorFunction

Update Script Parser
  * Reverse allowYield value.
  * Allow AsyncGenerator
  * In parameter, we should not allow yield, await expression

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-02-03 11:50:26 +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
fba9396ec9 Reduce memory usage
* 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>
2019-12-18 11:11:26 +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
seonghyun kim
42231eba48 Implement basic behavior of async, await.
* Add ExecutionPauser for yield, await
* Add new public API

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-11-15 16:07:03 +09:00
Patrick Kim
98d3c9c26e Fix class bugs (#418)
* Fixup class parsing error check in esprima
* Class cannot have property named 'prototype'
* When define {getter, setter} in interpreter, property key can be symbol
* Reorder properties on class constructor
* Fixup public API

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-09 10:12:47 +09:00
Patrick Kim
b33e7df9a2 Implement MetaProperty(new.target) (#397)
* add some missed public api functions

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-29 20:26:20 +09:00
Patrick Kim
7b7a777f73 Fixup generator (#391)
* we can use let, generator together now.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-27 12:44:36 +09:00
Hyukwoo Park
cc3f7deb8c Remove redundant parameter modules (#390)
* CodeBlock has essential parameter name list only
* toString builtin function is fixed to use the entire source instead of body source
* some TCs are fixed upto the spec

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-08-27 10:40:30 +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
e3a8fba176 Migrate to new bdwgc 8.0 GCutil & use cmake on building gc (#385)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-21 18:14:36 +09:00
Patrick Kim
3c0a1cfddd Don't use heap allocated lexical environment if possible (#378)
- We should not heap allocated env on...
  * functions uses variable on upper function
  * functions have `typeof` operation
  * functions have unmapped arguments object
- Improve calling function performance by remove accessing vtable once in interpreter(from isCallable, call to just call)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-20 10:41:06 +09:00
Patrick Kim
bffa9402b1 Optimize execution speed (#374)
* Set ALWAYS_INLINE flag for SmallValue <-> Value convertor function
* Implement ScriptGeneratorFunctionObject for remove if-statement in FunctionCall
* Remove calling Object::call in CallFunction, CallFunctionWithReceiver opcode
* if function uses global variable only, we should not use heap env for the function
* Don't use bitfield for ExecutionState::m_inStrictMode because we have only one flag at there.
* Remove useless submodules (test262-master, test262-harness)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-19 11:23:23 +09:00
Patrick Kim
ad0cecbd0d Implement lazy-creation of arguments object. (#361)
* Store ArgumentsObject into Env record with functionObject
* Introduce gc memory leak checker
* Don't save stack pointer in ArgumentsObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-13 17:00:03 +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
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