Commit graph

189 commits

Author SHA1 Message Date
Boram Bae
3d83a5fd47 Use original desc if this and receiver are same
* This way you can reduce the getOwnProperty calls.

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2022-03-03 18:16:30 +09:00
Seonghyun Kim
b1b505ae42 disable gc while calling Object finalizer 2022-01-05 13:36:36 +09:00
HyukWoo Park
fa052c8902 Refactoring ObjectTemplate's PropertyHandler
* update to common PropertyHandler data and strucuture to represent IndexedProperty and NamedProperty both
* check property name in each ObjectWithPropertyHandler method

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-17 17:22:35 +09:00
HyukWoo Park
f47def1f22 Replace TemplatePropertyName with existing ObjectStructurePropertyName
* usually property name is delivered as Value format
* replace `TemplatePropertyName` with `ObjectStructurePropertyName` to handle Value format nicely

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-10 14:51:47 +09:00
SeongHyun Kim
110359e4db Update source & build files for windows
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Signed-off-by: SeongHyun Kim <sh8281.kim@samsung.com>
2021-10-25 18:48:10 +09:00
HyukWoo Park
81bae461df Handle BigInt type in CreateListFromArrayLike method
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-03 12:55:47 +09:00
HyukWoo Park
0d65ad5e3d Implement lazy builtin initialization
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-08-12 13:43:23 +09:00
Seonghyun Kim
7b77fcd4cd If object has native data accessor with actsLikeJS is true, the object should be non inline cacheable
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-08-11 15:28:35 +09:00
Seonghyun Kim
77a68579a5 Implement per thread isolating
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-15 17:47:41 +09:00
HyukWoo Park
0b0ddee8e1 Refactoring index property handling
* when trying to use index property, we use only 32bit for index value (uint32_t)
* rename ArrayIndex as to Index32 and IndexProperty
* add cctest to verify the new api

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-05 13:20:38 +09:00
Seonghyun Kim
8c3cd2f3b1 Implement chain of ClassPrivateMemberData
* Each chain piece represents one of class
* User can uses private member with same name parent with child class
* We should check nearest [[homeObject]] of function to find where function is located

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
1fbaf749bf Implement ObjectPrivateMemberStructre for reducing memory usage
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
050812963e Implement one of nesting class private rule
- We need to check object value is homeobject if there is same private name on parent class

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
HyukWoo Park
70ecdf0214 Fix minor code defects
* fix to static functions
* fix to const functions
* remove unused variables

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-30 13:55:52 +09:00
HyukWoo Park
dd9e38f2bd Unify getter/setter methods for 32bit and 64bit platforms
* run additional test262 for 32bit-release environment

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-29 17:16:17 +09:00
Seonghyun Kim
25679c9980 Fix negative ValueRef integer bug with ESCARGOT_USE_32BIT_IN_64BIT flag
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-17 11:03:40 +09:00
Seonghyun Kim
7b0a24f1a7 Implement basic of class private field and method
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-08 13:00:26 +09:00
HyukWoo Park
616f32bb79 Remove ESCARGOT_OBJECT_SUBCLASS_MUST_REDEFINE macro
* override keyword specified instead

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-03 10:52:31 +09:00
HyukWoo Park
75d5a1dfb7 Add conversion from ObjectGetResult to ObjectPropertyDescriptor
* update ObjectGetResult::convertToPropertyDescriptor
* directly convert ObjectGetResult to ObjectPropertyDescriptor instead of creating a new Object for descriptor

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-02 10:33:16 +09:00
Seonghyun Kim
8e71c6e208 Pass receiver to Object::get, Object::{get, set}IndexedProperty operation
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-11 11:51:17 +09:00
Seonghyun Kim
5192d33431 Object Data Accessor property can be act like JavaScript getter setter
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-03 19:02:49 +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
Seonghyun Kim
64e24255cb Fix memory bugs
* Init YarrPattern::m_body variable
* Remove Objects finalizer in finalizer of WeakMap,Set
* Use correct finalizer for Intl Objects

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-03-04 09:35:30 +09:00
Seonghyun Kim
390261326e Store m_target of WeakRefObject as weak reference
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-03 12:18:02 +09:00
HyukWoo Park
b30518c41f Update TestIntegrityLevel operation
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-12-23 11:39:06 +09:00
HyukWoo Park
a8e7b7d47d Update SetIntegrityLevel operation
* update freeze and seal builtin methods of Object too

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-12-23 11:39:06 +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
HyukWoo Park
e0bd962e6e Add IsHTMLDDA feature
* https://www.ecma-international.org/ecma-262/#sec-IsHTMLDDA-internal-slot
* IsHTMLDDA internal slot is an ECMAScript feature for Web Browsers
* IsHTMLDDA is currently enabled only for test mode (we can enable it later if it is really used by third party app)
* some related operations are optionally fixed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-30 14:53:23 +09:00
Seonghyun Kim
8821b0e275 Implement basic type operation of BigInt & basic builtin functions of BigInt
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-15 18:55:42 +09:00
HyukWoo Park
714d398364 Fix minor style defects found by cppcheck
* add const keyword for constant functions
* reduce the scope of variables if possible

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-08 14:40:48 +09:00
Seonghyun Kim
93f25c6298 Update gcutil & remove wrong assert macro
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-09-16 18:25:37 +09:00
HyukWoo Park
a96f39f0e6 Unify regular expression notation as RegExp
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-08-24 14:04:52 +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
Seonghyun Kim
ca9b832a77 Introduce Object, FunctionTemplate
* Add cctest for Object, FunctionTemplates
* Fix one of EncodedValue <-> EncodedSmallValue conversion bug

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-29 12:38:39 +09:00
bence gabor kis
f1d8535b92 Optimized createListFromArrayLike
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-06-11 10:45:28 +09:00
HyukWoo Park
94609f3a1a Refactoring ObjectPropertyName structure
* compress the size of ObjectPropertyName to 4byte for 32bit platform
* use tag bit to represent the type of ObjectPropertyName

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-05-08 16:08:49 +09:00
HyukWoo Park
26b8593620 Add hasRareData for Object
* hasRareData is added to reduce repetitive check executions
* rename ensureRareData

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-05-08 16:08:38 +09:00
Seonghyun Kim
a7e53a4524 Fixup minor things
* If we use Object::nextIndexBackward, Object::nextIndexForward with non ordinal object,
  we should not test existence of value for index(we would not call user-defined function)
* Generate more user-friendly callstack

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-06 11:27:31 +09:00
HyukWoo Park
c46957de8c Update length-related operations
* remove each unnecessary length method
* getArrayLength and lengthES6 have been renamed
* return type of toLength is changed to uint64_t
* use createListFromArrayLike for more cases

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-28 14:48:15 +09:00
HyukWoo Park
4d1d55ad44 Fix minor bugs in Proxy and Reflect
* when a Proxy object is allocated as prototype of ArrayObject, fastmode optimization is immediately turn off
* revoker should be anonymous function

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-13 13:45:58 +09:00
HyukWoo Park
d46a365326 Refactoring type check operations using tag comparison
* type check operations based on tag comparison are updated to be aggresively inlined replacing virtual function calls
* Object, String and Symbol use pre-defined tag values while other uses vtable address as its tag value

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-09 16:13:36 +09:00
bence gabor kis
d57d22e964 Minor fixis in DataView Global builtin
related test-cases has been added in test262

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-04-06 21:03:52 +09:00
Seonghyun Kim
27f0af1859 Fix bugs in Intl
* Give correct prototype into Intl Objects
* Implement Array.prototype.toLocalString according spec

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-03 16:20:10 +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
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
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
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