Commit graph

77 commits

Author SHA1 Message Date
HyukWoo Park
a2b62f7c9f Remove trivial try-catch statements
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-18 20:22:40 +09:00
Seonghyun Kim
67216fcac9 Replace gc-allocated std::{unordered_map,unordered_set} with robin-{map,set}
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-07-07 09:20:04 +09:00
HyukWoo Park
e275ba66f5 Remove an unused variable in ALLOCA
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-05-31 12:49:24 +09:00
HyukWoo Park
9f93022d78 Unlink circular dependency between runtime and parser source codes
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-28 16:17:00 +09:00
HyukWoo Park
488de00180 Directly insert properties for builtin objects
* replace defineOwnProperty with directDefineOwnProperty method
* directly insert new properties for builtin objects

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-23 16:02:33 +09:00
HyukWoo Park
8fa6031fec Add DerivedObject for sub classes of Object
* check index property set in DerivedObject::defineOwnProperty method only
* index property check is removed for normal Object because PrototypeObject would check it instead

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-11 15:59:43 +09:00
Seonghyun Kim
3d7bbe9c6a Update function name & init member variables in debug mode
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-03 18:47:43 +09:00
Seonghyun Kim
4ed055e82c Add special method for add property in object what was not existent.
the new method not check the existent of proeprty.
it can used for builtin-functions

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-03 18:47:43 +09:00
Seonghyun Kim
64403a2ea2 Implement get fast source, flags proeprty for RegExpObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-03 18:47:43 +09:00
Seonghyun Kim
705b959d3f Remove useless ObjectRareData allocation in RegExpObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-18 17:15:36 +09:00
Seonghyun Kim
9a1060f48c Refactor basic String classes
* Implement String with inline buffer. this reduce malloc count & reduce memory usage
* Remove typed-gc-malloc from some classes.
  typed malloc classes should have storage for descriptor each malloc.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-08 16:27:33 +09:00
HyukWoo Park
13c774e49f Add ThreadLocal structure
* ThreadLocal manage global values allocated for each thread
* Update PlatformRef to allow users to add thread-local custom data

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-27 16:40:08 +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
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
HyukWoo Park
b605adbb1f Refactor GC allocation with bitmap info
* replace each Object's member marking with Object::fillGCDescriptor
* BigInt allocation is fixed to be handled by simple GC_MALLOC_ATOMIC call

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-05-18 15:34:07 +09:00
HyukWoo Park
e9afc5c595 Update VMInstance global variables
* manage global variables as VMInstance static members
* access global variables through VMInstance static functions

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-03-15 15:24:50 +09:00
HyukWoo Park
42e598f57c Clean up legacy features in RegExp
* refactoring code related to legacy features

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-02-22 10:36:32 +09:00
Bence Gabor Kis
560f1f233d Implement Legacy RegExp features
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2021-02-16 11:59:09 +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
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
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
bence gabor kis
77f9f59e41 New Feature - MatchAll and RegExpStringIterator
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-06-23 16:07:25 +09:00
bence gabor kis
88d055ebeb Minor Fix in RegExpObject escapeSlash
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-05-22 10:43:11 +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
HyukWoo Park
46d8f2060a Rework non-standard properties of RegExp
* directly access RegExpStatus through Context
* define each non-standard property in installRegExp method
* remove GlobalRegExpFunctionObject

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-13 19:51:41 +09:00
HyukWoo Park
5c8c4da50a Remove redundant prototype classes
* GlobalErrorObjectPrototype, DatePrototypeObject, RegExpObjectPrototype, SetPrototypeObject and WeakSetPrototypeObject are removed
* fix some intrinsic prototype object to be an Object instance
* rename prototype class names
* builtin methods of Date are simplified using macro

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-03-25 17:13:58 +09:00
Seonghyun Kim
07a1e2b26f Restore fast path of String.prototype.replace
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-03-24 18:42:34 +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
bence gabor kis
9af435aa26 Minor fix - update RegExp.compile
removed few related test-cases in test262

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-03-19 12:12:01 +09:00
bence gabor kis
32f0cf6a17 New feature - regexp named capture groups
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-03-11 10:59:34 +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
81a0e9e1ca Minor Fix in RegexpObject Match
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-02-19 13:42:49 +09:00
HyukWoo Park
0e93724832 Allocate YarrPattern::m_captureGroupNames on GC heap
* during the parsing of regexp, some string objects are dynamically generated
* fix m_captureGroupNames vector to be allocated on GC heap for capturing of these dynamic strings
* m_captureGroupNames would be cleared when YarrPattern deallocated

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-02-17 17:19:31 +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
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
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
seonghyun kim
0e3e95b3ae Update yarr version to webkitgtk-2.19.92
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-11-04 13:21:11 +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
Patrick Kim
4432709661 Revise RegExp module (#411)
* Update yarr (webkitgtk-2.18.5) & import into repo
* Implement new RegExp ES6 error when unicode flag is on
* Fix ignorecase bug on RegExp

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-04 14:12:01 +09:00
Robert Fancsik
387a30267c Simplify isRegExpObject check (#399)
Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-02 20:26:59 +09:00
Daniel Balla
f1e3df6832 Modify RegExp property getters, isRegExpObject check (#271)
Fixes `regexp-flags.js` testcase in v8.

Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>
Signed-off-by: Daniel Balla <dballa@inf.u-szeged.hu>
2019-05-29 14:44:03 +09:00
Daniel Balla
133bc131c8 Add ES6 RegExp.prototype.exec() method (#112)
Add ES6 support to RegExp.prototype.exec method.
Also fix regexp-lastIndex.js test in v8.

Signed-off-by: Daniel Balla <dballa@inf.u-szeged.hu>
2019-05-22 10:43:12 +09:00
yichoi
329ed6f1da
Resolving Static Analysis Defect (Uninitialization of Constructor) (#169)
Signed-off-by: Youngil Choi <duddlf.choi@samsung.com>
2019-03-27 14:07:56 +09:00
Daniel Balla
84dc59f389 Fix RegExp.prototype.toString() function (#118)
The function had a wrong behaviour expecting `this` value to be a RegExp Object.
However as the standard says `this` value should be an Object, and its `source` and `pattern` values' `toString()`s should be returned in a form of `/<source>/<flags>`.
Fixes #117

Signed-off-by: Daniel Balla <dballa@inf.u-szeged.hu>
2019-03-12 13:56:02 +09:00
Daniel Balla
26ee1718c5 Add RegExp.compile() function (#100)
This patch adds RegExp.compile() function.
Since the given argument can be a RegExp object as well, which already has their option flags parsed there was a need to add a new init function which doesn't parse flags and accepts an `unsigned int` as its parameter.

Signed-off-by: Daniel Balla <dballa@inf.u-szeged.hu>
2019-02-20 16:14:31 +09:00
Daniella Barsony
56b7748c67 Reduce code smells (#82)
Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-02-19 15:48:48 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
d66c4b900b Enhance developer experience (#98)
* Generate more detailed information(+ add related source code info)
* Fix source code line error on exception
* Add DUMP_ERROR_IN_TRY_CATCH option

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-06-19 18:04:19 +09:00