Commit graph

86 commits

Author SHA1 Message Date
HyukWoo Park
e998d04bf6 Implement WebAssembly.validate
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-23 14:05:36 +09:00
Seonghyun Kim
5fae029277 Remove unused variable & Fix memory leak from VMInstance::m_cachedUTC
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-11-23 13:53:29 +09:00
Seonghyun Kim
c6452d6d0c Fix build error related with libbf
* Don't delete generator, asyncs ByteCodeBlock

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-23 13:04:13 +09:00
MuHong Byun
827d09454d Fix several bugs on
* Data object
* ByteCodeInterpreter

(From Seonghyun Kim <sh8281.kim@samsung.com>)

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
2020-10-23 10:52:58 +09:00
Seonghyun Kim
9c9457ea38 Implement BigInt infrastructure
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-14 16:18:53 +09:00
HyukWoo Park
8c41696eec Fix CodeCache clear to be invoked immediately
* CodeCache holds a lock of cache directory that should be released immediately when it is no longer necessary
* since GC may reclaim VMInstance and its CodeCache member lazily, so destructor of CodeCache could be called later too
* invoke CodeCache clear() in clearCachesRelatedWithContext method to resolve this issue

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-12 14:11:38 +09:00
HyukWoo Park
ae21ea534b Update CodeCache file management
* calculate cache file directory based on $HOME env
* handle all cache list in one file
* use source code's hash value for its cache data file name

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-09-16 18:27:30 +09:00
Seonghyun Kim
d4bfe59e64 Update public API for RopeString and update small config
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-08-28 10:26:20 +09:00
Seonghyun Kim
267238ae64 Fix Reloadable string bug
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-08-13 15:17:32 +09:00
Seonghyun Kim
4e9349b999 Implement ReloadableString
* turn off ALWAYS_INLINE in small config
* turn off hidden class transition table in small config

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-08-13 14:07:37 +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
3ec80377db Add new public APIs
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-07-30 15:15:18 +09:00
HyukWoo Park
436fac4423 Implement CodeCache for CodeBlock tree
* update read/write modules for CodeCache
* store and load CodeBlock tree

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-07-30 10:44:40 +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
f82c81a5d2 In 64bit, we should use only 32bit for addressing
* Object, Array, Environment record internal space should use 32bit addressing on 64bit
* Rename SmallValue to EncodedValue.
* Implement EncodedSmallValue for using 32bit address on 64bit
* Implement special vectors for EncodedSmallValue.
  - we need these special vector. because when push_back or inserting the value what we want to insert
  can be removed by GC because the parameter type is 32bit(EncodedSmallValue).
* Update GCutil for 32bit addressing on 64bit

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-11 17:37:43 +09:00
Seonghyun Kim
6bfa3f9fff Apply lazy StaticString on builtin Intl
* Implement FromExternalMemory version of AtomicString

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-04 17:12:07 +09:00
Seonghyun Kim
5b3f0986b1 Implement lazy part of StaticString
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-04 17:12:07 +09:00
Seonghyun Kim
a58a01e02f Implement Intl.RelativeTimeFormat
* Each Context should share supported intl locale array

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-08 18:04:38 +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
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
Seonghyun Kim
cf2c21e023 Implement additional ECMAScript Features for Web Browsers
* caller extension of ArgumentsObject is removed from recent ECMAScript standard
* __proto__ on object expression is changed.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-03-18 16:57:42 +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
Zoltan Herczeg
a555ac52f6 Initial implementation of the Escargot Debugger. 2020-03-05 10:36:55 +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
af9b410fa7 Fix issues in some embedded platforms
* Implement RuntimeICUBinder
 - ICU has verison name on its symbol name like u_tolower_XX.
   but, we need to use escargot on various platform(without re-compile)
   thus, I implement this library
* add ceil function on IEEE754
 - there is an issue with -0 in builtin ceil function
* Use pypy instead of python for running test262(pypy is faster than python)

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-01-09 16:07:51 +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
0a79a6c98c Fix crash
* Fix bug in inline cache
* Fix memory error while exiting

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-19 10:29:27 +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
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
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
Patrick Kim
f75945700a Fix various things (#476)
* Fixup canDeclareName in ASTContext
* Add more callstack information on API
* Add onDelete callback on VMInstance
* Add BloomFilter as util
* Use BloomFilter in ASTFunctionContext for find out variable name existence
* Optimize parser using InlineStorageVector

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-24 14:29:55 +09:00
Hyukwoo Park
13343f8417 Optimize memory management in Parsing (#465)
* Revise AST Node allocation through ASTPool

* ASTAllocator is newly added for allocation of AST Nodes
* AST Node is allocated in pool memory and flushed once after bytecode is generated
* All reference counting overhead related to AST Node is removed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>

* Reduce memory operations in Parsing

* empty vector called SyntaxNodeVector is added for SyntaxChecker
* ASTFunctionScopeContext and ASTBlockScopeContext are allocated in ast pool instead of GC heap
* memory leak(ShellPlatform) in shell is fixed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-10-21 20:01:17 +09:00
Patrick Kim
be2e01a807 Update public API & Remove SandBoxStack (#469)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-18 09:40:00 +09:00
Patrick Kim
e820e0b969 Revise public API (#442)
* PointerValueRef should inherit ValueRef
* Implement PersistentRefHolder for easy-rooting
* Remove SandBox interface for public
* Re-implement shell through public API
* Implement Platform for supprot various platform easily
* Add many missed public API methods(Set, Map, Symbol...)
* Add Memory class into public

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-30 10:55:27 +09:00
Patrick Kim
98d3c9c26e Fix class bugs (#418)
* Fixup class parsing error check in esprima
* Class cannot have property named 'prototype'
* When define {getter, setter} in interpreter, property key can be symbol
* Reorder properties on class constructor
* Fixup public API

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-09 10:12:47 +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
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
Boram Bae
de65761ac7 Implement GeneratorFunction constructor (#350)
* Fix some bugs
* Pass more test262 tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-08-06 22:12:49 +09:00
Hyukwoo Park
af42a80f6b Rework ArgumentsObject based on ES2015 (#334)
* implement mapped/unmapped ArgumentsObject
* passed arguments-related test262 TCs
* ArgumentsObject initially stores its matched values in an inner array (fast mode)
* when a property descriptor changed, ArgumentsObject manages the arg value as its property (slow mode)

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-07-31 12:38:20 +09:00
Boram Bae
aedb6b490a Pass more test262 tests (#339)
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-07-30 18:08:03 +09:00
Boram Bae
2677e970f9 Fix some bugs related to ES6 and memory (#328)
* Pass more test262 tests
* Removes some unnecessary default structures
* Adds missing explicitly typed GC member at GeneratorObject

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-07-26 09:49:21 +09:00
Boram Bae
392a9207c3 Add restricted function properties at Function.prototype (#320)
* Pass more TC in test262

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-07-22 10:22:04 +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
106b9c8152 Revise bound function based on ES6 (#284)
* add BoundFunctionObject class to represent bound function object
* fix hasInstance operation according to ES6

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-06-13 13:02:39 +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