Commit graph

55 commits

Author SHA1 Message Date
HyukWoo Park
ab15bd5574 Implement setIndexedPropertyHandler for ObjectTemplate
* rename data related to PropertyHandler
* refactoring ObjectWithPropertyHandler to handle NamedProperty and IndexedProperty both
* add cctest

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-17 17:22:35 +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
c295ee69e1 Refactoring createFunctionSourceFromScriptSource
* use memcpy for string merging
* remove unused functions

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-10 14:52:54 +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
HyukWoo Park
30f3b3a348 Revise createFunctionSourceFromScriptSource
* add simple syntax checker method in parser to check parameters and body string
* fix it to check parameters and body string seperately
* add several TCs for this patch too

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-01 17:03:58 +09:00
HyukWoo Park
78b1aa7d2e Update lint checker to include cctest file
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-29 12:30:32 +09:00
HyukWoo Park
01d6ed1047 Fix Template to inherit parent's NativeDataAccessorProperties
* according to api, ObjectTemplate should inherit its parent's NativeDataAccessorProperties of InstanceTemplate too

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-18 15:16:25 +09:00
Seonghyun Kim
848873c6c7 Implement special case for Function constructor with ReloadableString
* Add new api for Function::create

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-10-18 13:34:28 +09:00
Ryan Hyun Choi
e479b456a9 Fix SharedArrayBuffer's create()
* Enable threading in api-test
* Add a SharedArrayBuffer test

Signed-off-by: Ryan Choi <ryan.choi@samsung.com>
2021-10-14 16:43:10 +09:00
Seonghyun Kim
a30b318b4a Implement GenericIteratorObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-09-29 16:15:21 +09:00
HyukWoo Park
843f4af78e Assign source name for dynamically created functions
* get source name through outer lexical scope

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-27 16:37:12 +09:00
HyukWoo Park
07c91a33e6 Add callback for Error creation
* registered callback is triggered for each Error constructor call

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-14 16:39:15 +09:00
HyukWoo Park
f864d828fb Refactoring BackingStore structure
* divide BackingStore structure into NonShared and Shared
* update BackingStoreRef API to clarify its usage

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-14 15:54:17 +09:00
Seonghyun Kim
7692878218 Add try-catch-finally condition variable into ExecutionState
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-09-09 15:17:12 +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
HyukWoo Park
84451fd28e Add setLength method to FunctionTemplate
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-29 13:37:54 +09:00
Seonghyun Kim
dbae3ae8fe Implement Serialization of SharedArrayBufferObject & $262.agent.* functions for testing
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-29 13:36:15 +09:00
HyukWoo Park
98bc107937 Add Global object shared by all threads
* Platform is also managed in Global object
* Global has life time same to program

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-27 16:40:08 +09:00
Seonghyun Kim
dff3ddd475 Add new api test related with Serializing Symbol, BigInt
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-27 15:29:24 +09:00
Seonghyun Kim
878e911e7d Implement value Serializer test
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-27 15:29:24 +09:00
HyukWoo Park
703c0edecc Update PromiseHook for Promise API
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-21 15:17:06 +09:00
HyukWoo Park
ac2bb84b6f Update PromiseHook
* PromiseHook is triggered for each Promise event
* PromiseHook is registered and used by third party app

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-15 10:54:18 +09:00
Seonghyun Kim
f43d845975 Implement BackingStore::reallocate
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-08 16:38:00 +09:00
HyukWoo Park
f2fd751c1e Fix EncodedSmallValue encoding
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-08 15:31:21 +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
HyukWoo Park
43577f33e3 Fix a bug in array index conversion
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-02 12:54:09 +09:00
HyukWoo Park
324baba180 Update basic SharedArrayBuffer features (threading)
* add SharedArrayBuffer object
* update BackingStore to represent shared data block

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-17 11:09:33 +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
HyukWoo Park
dfdb1203d6 Fix a bug when a native function instantiated from FunctionTemplate is called as super
* create a new object of which proto is set based on newTarget

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-07 14:53:15 +09:00
HyukWoo Park
006b189d5f Update ObjectRef::enumerateObjectOwnProperties api
* add tryToUseAsArrayIndex api for enumeration
* fix UInt-naming

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-03 10:52:31 +09:00
Ryan Hyun Choi
b0cace6695 Add RegExpObjectRef::match() in public API
Signed-off-by: Ryan Choi <ryan.choi@samsung.com>
2021-05-27 17:08:24 +09:00
Ryan Hyun Choi
c6562e7940 Add RegExpObjectRef::create() in public API
* Make create() to accept options in enum

Signed-off-by: Ryan Choi <ryan.choi@samsung.com>
2021-05-27 14:52:12 +09:00
Hosung Kim
c05f35930f Fix ObjectPropertyDescriptor
Signed-off-by: Hosung Kim hs852.kim@samsung.com
2021-05-12 16:35:45 +09:00
Seonghyun Kim
8444ae515f Add receiver parameter to NamedPropertyHandlers
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-11 11:51:17 +09:00
Seonghyun Kim
480d567c1e Add a test for new public API ObjectTemplateRef::installTo
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-06 15:47:07 +09:00
Seonghyun Kim
f6760e1974 Add new NativeDataAccessor property test
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-03 19:02:49 +09:00
Seonghyun Kim
a30990e351 Add BackingStore test first
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-21 16:27:46 +09:00
Seonghyun Kim
11ff71be71 Implement TemplateNamedPropertyHandlerGetPropertyDescriptorCallback on ObjectTemplate
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-03-30 09:03:42 +09:00
Seonghyun Kim
ec3fd74882 Update public API
* Add const for ObjectPropertyDescriptorRef member functions
* Add FunctionTemplateRef::setName

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-03-30 09:03:42 +09:00
HyukWoo Park
90522697eb Refactoring Job
* all types of job now handled in the task queue

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-02-16 09:34:31 +09:00
Seonghyun Kim
ccdf475f9b Implement new config for smaller device
* In small config, we turn off SyntaxChecker for small binary size
* CompressibleString should get VMInstance instead of Context
* If ICU is disabled, we don't need unicode information in yarr
* Remove unused variable in yarr(RegExpJitTables)
* Fix lz4 compile error

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-08-06 14:07:11 +09:00
Seonghyun Kim
ba4763e888 Implement runtime part of dynamic-import
* Implement one of parsing error of module
* Fix one of stack usage error on FunctionObjectInlines

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-07-30 11:56:17 +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
906dbc6409 Add new api for Template
* Embedders can control (ESCARGOT_COMPRESSIBLE_COMPRESS_*) when compiling

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-07-17 11:30:04 +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
Youngil Choi
3148b0a2b1 Update license clauses
Signed-off-by: Youngil Choi <duddlf.choi@samsung.com>
2017-06-12 11:14:17 +09:00
seonghyun kim
dbc21192e3 implement Promise, gc, virtual property, virtual id things
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-25 13:15:38 +09:00
seonghyun kim
b5eb18a2dc implement more basic things in api layer
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-23 20:53:26 +09:00
Sanggyu Lee
7731895659 Add ObjectRef.getProperty and revise ValueRef, ObjectRef.
I changed the interface class implementation (using inheritance).

It has folowing benefit:
- It is easy to understand and intuitive.
  every objectref is valueref.
- It get rid of stuffs like
  member field intptr_t v, operator ValueRef() ...

Also, I added StringRef.fromUTF8().

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
2017-03-20 19:48:26 +09:00
Sanggyu Lee
80b6581b57 Add ObjectRef.makeObject, ValueRef.to(Boolean|Number),isObject
Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
2017-03-14 16:16:08 +09:00