Commit graph

64 commits

Author SHA1 Message Date
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
Seonghyun Kim
19298e2216 Implement Atomics.wait, notify
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-08-17 20:03:39 +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
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
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
5c3f60aa47 Add functions what return version info and configure info into Globals class
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-27 15:29:24 +09:00
HyukWoo Park
d3acce83a3 Add optional parameter to represent possible ASCII case for string api
* for non-ASCII case, ASCII string checking is skipped

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-05-12 20:14:36 +09:00
Seonghyun Kim
1a51cff06d Implement module import rejection
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-15 10:58:10 +09:00
Seonghyun Kim
4cd0da1e07 Implement await dynamic import resolution
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-15 10:58:10 +09:00
Seonghyun Kim
2c4174f93b Add ArrayObjectRef::attachExternalBuffer API
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-22 10:36:09 +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
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
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
HyukWoo Park
897a1d2ae5 Fix some minor defects and build errors
* fix defects checked by static analysis
* fix Jenkins and actions build script

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-23 11:28:08 +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
HyukWoo Park
56e3ec638b Fix defects discovered in coverity scan
* fix control flow issues
* fix uninitialized variables

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-09-11 12:34:50 +09:00
HyukWoo Park
f56a557ff5 Reduce memory allocation during bytecode generation
* ByteCodeBlock does not hold location data info anymore
* location data of each bytecode is manually allocated only for stack-tracing or debugger mode
* duplicated String allocation for source code is removed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-08-06 16:23:06 +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
HyukWoo Park
11e469c6fa Implement CodeCache for bytecode
* store/load global ByteCodeBlock

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-08-03 10:40:17 +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
1ab8994711 Update shell & test262 driver for running test262 tests correctly
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-25 18:39:09 +09:00
bence gabor kis
3bb4a39e50 able to send multiple source file to debugger server
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-06-11 17:54:21 +09:00
Seonghyun Kim
9b9f980cfe Reimplement initialize & executing Module according to newer spec
* Update test runner for running module tests in test262

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-22 18:34:57 +09:00
bence gabor kis
e52c7d1b00 Debugger source send by client feature
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-05-12 16:57:32 +09:00
Seonghyun Kim
5fe34d5b04 Implement GlobalObjectProxyObject for support external project
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-17 12:01:49 +09:00
bence gabor kis
e31cfeeada Debugger Client print feature
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-04-06 21:04:54 +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
Seonghyun Kim
a656f7e4dd Implement $262 object and its builtins for passing test
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-03-19 15:01:26 +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
Seonghyun Kim
60594853d2 Optimize function.apply(<any>, arguments) case.
* Many JS Frameworks or librarys use `function.apply(<any>, arguments)` pattern.
  but this statement generate arguments object. generateing arguments object is very expensive.
  we can optimize simple cases like `function() {  fn.apply(this, arguments); }`
* Merge many ByteCode opcodes into CallFunctionComplexCase.
* Do gc when allocate large ArrayBuferObject

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-01-15 10:33:49 +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
HyukWoo Park
b27127c3dd Update CompressibleString
* add CompressibleString to compress/decompress large-sized source code
* add ENABLE_SOURCE_COMPRESSION flag (you can use the CompressibleString by build with -DENABLE_SOURCE_COMPRESSION flag)
* use lz4 compression algorithm (from https://github.com/lz4/lz4, the latest release v1.9.2)
  - add Escargot::LZ4 namespace
  - pull included lib header files out of Escargot::LZ4 namespace
  - code format changed by tools/check_tidy.py
* default outdir in config.cmake removed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-12-24 13:36:12 +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
355c7eff53 Fix errors (#467)
* Fix BDWGC compile option
* Fix build error on ndk
* Global declared function declaration should always create binding

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-17 18:28:00 +09:00
Patrick Kim
4bb343552e Optimize script initialization performance (#458)
* Store child {ASTFunctionContext, InterpretedCodeBlock} as linked-list
* Reduce size of ScannerResult
* Remove Parser::scopeContexts
* Fix compile error in old system

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-14 13:07:28 +09:00
Patrick Kim
03ac100d7f Optmize escargot (#454)
* Don't allocate new StringView on parser if possible
* Store esprima::Context::firstCoverInitializedNameError as pointer. it can reduce copy cost on esprima::*CoverGrammar
* Make Script as reexcutable if possible
* Don't save parsed source codes
  - Remove SourceStringView
  - When create AtomicString from StringView, we should make new string data instead of reference StringView
* Reduce size of StringBufferAccessData
* Fix crash in toString of FunctionObject.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-11 15:32:04 +09:00
Patrick Kim
87ca01b658 Implement indirect export, import (#453)
* Rename ambiguous variables names(src, source, fileName) into src, sourceCode
* Treat 'await' as keyword

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-08 18:25:05 +09:00
Patrick Kim
eceffac4c4 Implement Direct {Import, Export} (#448)
* Rename ESCARGOT_OUTPUT=bin into shell and make shell_test for testing.
* Remove ESCARGOT_SHELL, -SCARGOT_STANDALONE and Rename ESCARGOT_ENABLE_VENDORTEST into ESCARGOT_ENABLE_TEST.
* Fix bug in PersistentRefHolder
* Add DebuggerStatementNode for preventing parsing error even if we cannot support
* Revise Platform layer for supporting es6 module
* Implmenent class constructor toString

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-07 13:11:03 +09:00
Boram Bae
67e18df5f3 Update uneval to handle Symbol (#444)
Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-01 14:48:48 +09:00
Boram Bae
a12e36834c Fix some bugs and add newGlobal builtinFunction to run spiderMonkeyTC (#443)
* Use a byteLength when creating new TypedArray from another TypedArray.
* Keep the isLexicallyDeclaredBindingInitialization value when generating storeBytecode on ArrayPatternNode
* Pass more SpiderMonkeyTCs

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-01 10:00:04 +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
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
Patrick Kim
ad0cecbd0d Implement lazy-creation of arguments object. (#361)
* Store ArgumentsObject into Env record with functionObject
* Introduce gc memory leak checker
* Don't save stack pointer in ArgumentsObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-13 17:00:03 +09:00
Patrick Kim
8c1cd3b2b5 Make to run test cases faster (#351)
* Make to run chakracore, v8, jsc-stress test parallelly
* Make to call backtrace() faster on test262. this improves running speed of debug binary.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-06 18:55:48 +09:00
Patrick Kim
2a54ab5e02 Update lexical environment stuffs (#327)
* treat variable in catch() as let
* add lexical environment record data into global environment for saving global permanently
* re-implement variable access bytecode generation
* re-implement class initialize operation
* re-implement global variable access bytecode for support lexcial variables in global
* fix bugs related with per-iteration lexical environment in for-statement

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-07-26 13:16:44 +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
6577d2dac9 Merge parsing and bytecode generation process (#297)
* in most cases, parsing and bytecode generation process runs sequentially
* parsing error throws SyntaxError exception inside sandbox and this exception will be catched by the sandbox
* clear up some complicated code

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-07-04 15:17:27 +09:00
Hyukwoo Park
0671880845 Update isCallable check function according to call operation (#290)
* isFunction is replaced with isCallable check function
* call operations in Promise / TypedArray are fixed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-06-19 16:51:30 +09:00