Commit graph

42 commits

Author SHA1 Message Date
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
Seonghyun Kim
402adf5e3f Update proxyCreate function in order to implementing new ECMAScript spec
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-12-17 14:01:25 +09:00
HyukWoo Park
f168e4bd7b Remove unused codes found by cppcheck
* remove unused functions
* remove unused variables
* mark necessary but unused variables with UNUSED_VARIABLE

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-06 13:11:07 +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
bence gabor kis
1c7a1c3e06 Update proxy object to ES2020
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-07-02 10:23:02 +09:00
HyukWoo Park
0f81aa5dce Represent all global error messages by static class members
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-03 11:30:10 +09:00
HyukWoo Park
32f6f6938e Update Object.prototype.toString based on ES10
* isArray is updated as an internal method of Object
* legacy internalClassProperty is nowhere to be used

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-01 14:29:19 +09:00
bence gabor kis
295c4c21e5 ProxyObject fix in ownPropertyKeys
Related test-cases in test262 added

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-03-26 18:18:38 +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
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
Boram Bae
2dc9b08ea7 Implement getFunctionRealm and Fix some bugs related to Array (#474)
* Pass more spidermonkey tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-23 18:38:14 +09:00
Boram Bae
5b43165375 Fix various bugs detected from vendor tests. (#464)
* 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>
2019-10-15 17:17:51 +09:00
Robert Fancsik
8095a934d6 Add Proxy object support for several builtin operations (#435)
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>
2019-09-26 12:33:37 +09:00
Boram Bae
35bf5c2768 Implement IsCompatiblePropertyDescriptor and CompletePropertyDescriptor (#398)
* Pass more test262 tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-29 20:27:56 +09:00
Patrick Kim
b656248ce4 Refactor code (#396)
* Revise hasProperty and apply it everywhere
* Add hasIndexedProperty for performance
* Change Object::nextIndex{Forward, Backward} double parameter types into int for performance
* in String.prototype.replace, Use test fast path correctly & use old method because newer method cannot support regexp correctly(old method is faster)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-29 14:35:50 +09:00
Boram Bae
c5081ab463 Fix bugs related to ProxyObject (#394)
* Use a 'hasValue' to check whether desc is undefined or not.
* Throw a TypeError if the target descriptor's setter is undefined In ProxyObject's [[set]]
* Add an internal Test

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-28 13:59:15 +09:00
Tóth Béla
7a52184fc5 Fix ProxyObject to call with proper Property type (#365)
Before the patch escargot called while doing `P.toPlainValue` which causes `[number]`
property names to be converted into numbers, instead of using them as property keys
and passing them along as string, while it should pass string or symbol by definition
in:
http://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey

Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2019-08-27 18:36:26 +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
Boram Bae
8e4f170f3f Reimplement [[SetPrototypeOf]](V) and Object.setPrototypeOf(O, proto) according to 6.0 (#377)
* Don't throw type error with Reflect.setPrototypeOf
* Pass more test262 tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-19 16:52:09 +09:00
Boram Bae
31dec6a7b9 Implement OrdinaryHasProperty (O, P), Fix some bugs in ProxyObject (#371)
* Use OrdinaryHasProperty at Object::hasProperty
* Override enumeration for ProxyObject
* Pass more test262 tests
* Exclude test262 tests related to Proxy's enumerate because of that is deprecated in ECMAScript 8.0

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-14 18:25:35 +09:00
Boram Bae
ea38d7d96e Implement an '[[OwnPropertyKeys]]()' internal method of Object and refactor some codes (#364)
* Refactor some Object's builtin functions
* Add an ownPropertyKeys public api (getOwnPropertyKeys is deprecated)
* Reimplement Object::enumerateObjectOwnProperies according to spec
* Implement createListFromArrayLike
* Pass more test262 tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-14 09:47:36 +08:00
Hyukwoo Park
77731dda5e Add Proxy APIs (#363)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-08-13 17:01:07 +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
c0c83ad0d6 Prepare for implementing es2015 specs (#304)
* Remove ES2015, PROMISE, PROXY, TYPEDARRAY defines
* Change test262 from 5.1 to 2015

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-07-04 15:18:23 +09:00
Hyukwoo Park
2b145ef54c
Update coding style guide (#296)
* reformat all single logical expression based on the new rule

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-07-03 15:42:41 +09:00
Hyukwoo Park
0671880845 Update isCallable check function according to call operation (#290)
* isFunction is replaced with isCallable check function
* call operations in Promise / TypedArray are fixed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-06-19 16:51:30 +09:00
Hyukwoo Park
e4a8b22032 Revise call and construct operation based on ES6 (#278)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-06-10 20:04:15 +09:00
Daniel Balla
94f8bfa24c Add missing checks for targetDescriptor in ProxyObject::get (#245)
Check if the descriptor is dataDescriptor / accessorDescriptor.

Signed-off-by: Daniel Balla <dballa@inf.u-szeged.hu>
2019-05-10 15:13:59 +09:00
Tóth Béla
47dce1c42b Merge collapsible if statements (#171)
Merged Collapsible if statements reported by SonarCloud.
Also unified some code in Lexer, to follow this ruleset.

https://sonarcloud.io/project/issues?branch=travisMoka&id=Achie72_escargot&resolved=false&rules=cpp%3AS1066&severities=MAJOR

Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2019-03-28 16:53:51 +09:00
Hyukwoo Park
cc546ca624 Update the rest of TypedArray builtin functions Part 4. (#159)
* from, of, get species builtin methods of TypedArray updated
* isCallable and isConstructor modified to commonly used in Value
* Symbol species also updated

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-03-25 15:54:30 +09:00
Daniella Barsony
4afdf61b2b Pass const primitive values by value rather than reference (#115)
Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-03-18 15:00:31 +09:00
Hyukwoo Park
dbccca6f3a Update Reflect object and internal methods [es2015] (#78)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-02-11 15:49:16 +09:00
Hyukwoo Park
871829c0fa Fix setPrototypeOf method of Object and Proxy (#76)
* fix setPrototypeOf internal method according to the es2015 spec

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-01-31 18:16:17 +09:00
Hyukwoo Park
9a9b376229 Update Call and Construct method of Proxy (#64)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-01-23 14:05:30 +09:00
Hyukwoo Park
40d4fa40c6 Implement Proxy object internal methods (#39)
* updated proxy methods
GetPrototypeOf
SetPrototypeOf
IsExtensible
PreventExtensions
GetOwnProperty
DefineOwnProperty
HasProperty
Get
Set
Delete
ProxyCreate

* TODO
Enumerate and OwnPropertyKeys
Call and Construct

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-01-21 12:22:40 +09:00
Akos Kiss
7c72ec9bc3 Fix format errors (#16)
Note: These errors are reported by check-tidy.py on Travis CI but
the job still completes successfully.

Signed-off-by: Akos Kiss <akiss@inf.u-szeged.hu>
2018-12-21 09:18:29 +09:00
박혁우/Common Platform Lab./Staff Engineer/삼성전자
f3f0fdd73b Implement 'get' and 'set' for 'Proxy' (#106) (#179)
* also update vendortest to handle es6 features

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2018-12-18 09:54:02 +09:00
이승수/Tizen Platform Lab(SR)/Senior Engineer/삼성전자
28de827199 Change default license to LGPL license (#60)
* Update build spec file
* Add License files

Signed-off-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
2018-03-07 18:38:28 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
0d5bf035e7 Update class experession error message (#57)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-02-28 12:55:10 +09:00
김현준/Tizen Platform Lab(SR)/Engineer/삼성전자
9d1a166dcf Make files to implement Proxy objects(26.2) (#52)
TODO : Implement new Proxy(target, handler)
2018-02-05 11:10:38 +09:00