Commit graph

169 commits

Author SHA1 Message Date
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
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
bence gabor kis
94c74a0c3d Newfeature - DotAll flag
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-01-17 10:45:43 +09:00
Seonghyun Kim
caa0fbc3fe Implement compress CompressibleStrings on GC reclaim end event
* Compress CompressibleStrings on GC reclaim end event
  - if there is reference about data of CompressibleString on stack, we should give up compressing.
    we don't need to search heap space because I redesigned StringView
    (we should not store string buffer data on heap without owner)
* Redesign StringView
  - Don't save string buffer address as its member. because buffer of CompressibleString can be deleted
  - If we don't save string buffer address on StringView, parser performance may dropped.
    becuase parser access string data a lot.
    so I introduce ParserStringView. it saves buffer address. we should ParserStringView on parser only.
    we can save string buffer address while parsing. because GC is disabled while parsing.

* Enable CompressibleString always
* Implement cache of RegExpOptionStrings
* Implement finding system locale function on RuntimeICUBinder avoiding call uloc_getDefault.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-01-10 17:37:00 +09:00
seonghyun kim
98d4ef6942 Reduce memory usage
* Store array length property in its member variable not value vector
  - This can reduce one of GC_MALLOC call if there is not value in ArrayObject other than fastmode value
* Prevent memory leak from VMInstance, Context
* Change vector capacity reserve strategy

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2019-12-24 14:38:09 +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
0a9ec4f9eb Rename PropertyName into ObjectStructurePropertyName
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-05 15:04:20 +09:00
seonghyun kim
875b1aa056 Improving object property accessing performance
* Finding & read desc at once in ObjectStructure
* Improve findProperty performance in ObjectStructure

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-02 16:44:27 +09:00
HyukWoo Park
b0a31717c5 Update spread element in Object initialization
* EnumerateObject is reworked and two derived classes are newly added
* Object spread element is handled through EnumerateObjectWithDestruction
* for-in operation is handled through EnumerateObjectWithIteration

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-11-18 15:56:15 +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
seonghyun kim
82c99fc298 Refactor ObjectStructure
* Divide ObjectStructure into 3 types
* Add transition look up hash map into ObjectStructureWithTransition
* Use faster version of log2 on Vector

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-11-12 10:03:03 +09:00
Patrick Kim
e91d0f0fe7 Improve execution performance (#491)
* Make ArgumentsObject light
* Implement lazy-creation of FunctionObject.prototype
* Don't copy ObjectStructor when executing Object::enumeration
* Use GC_REALLOC on Object, ArrayObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-11-04 11:18:03 +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
20a1704abe Reduce the size of ObjectPropertyName on x64 (#460)
Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
2019-10-14 10:49:18 +09:00
Boram Bae
b9bb171eac Fix some bugs related to Propertydescriptor and Array (#457)
* Create a property only when each field of desc presents at fromObjectPropertyDescriptor
* Add a ArrayIteratorPrototypeObject
* Call iteratorClose correctly at Array.from

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-14 09:50:09 +09:00
Tóth Béla
44e90a6b91 Implement the @@match well-known Symbol (#157)
Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2019-10-11 14:46:27 +09:00
Boram Bae
069921b3b9 Fix some bugs related to Array and TypedArray (#450)
* Close iterator when throwing an error
* Clamp the Uint8ClampedArray value properly.
* pass more spidermonkey tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-08 09:37:31 +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
Patrick Kim
2173fa4b25 Pass more test262 testcases (#426)
* in ES6, we need to set function name when object literal has function expression on right side
* in ES6, we should not check duplicated property name on object literal
* Refactor Object::hasInstance & Object::getMethod

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-16 13:25:56 +09:00
Hyukwoo Park
c2352d1722 Fix Spread (#421)
* spread is allocated on an array object in advance to know the entire length of array when it is used in array initializer
* spread array is fixed fast mode array which means that Array.prototype could not affect any array operation of spread array
* pass v8 TCs

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-09-10 16:59:57 +09:00