Commit graph

39 commits

Author SHA1 Message Date
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
Zoltan Herczeg
91dc4ba8f7 Merge ExecutionContext and ExecutionState. (#281)
State without Context is rare, and the merged structure consumes less amount of memory.

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-06-19 10:45:00 +09:00
Roland Takacs
71ed729760 Add memory statistics feature to the project. (#220)
Added a boehm-gc heap usage monitoring feature to the project.
A runtim flag (--mem-stats) helps to show the collected informaion.

Renamed ESCARGOT_PROFILE_MASSIF to ESCARGOT_MEM_STATS in the CMake.
Of course, Valgrind based tools still can be used. In this case, the
project should be compiled with ESCARGOT_VALGRIND definition.

Signed-off-by: Roland Takacs <rtakacs.uszeged@partner.samsung.com>
2019-05-08 13:55:30 +09:00
Patrick Kim
0d2d0bdaf2 Use std::mt19937 instead of rand() function for Math.random() builtin (#207)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-04-23 15:26:39 +09:00
Hyukwoo Park
0b023f8143 Update NullablePtr implementation to include assert statement (#147)
* change to include assert guard code for getValue of NullablePtr
* when exception occurred, the result value is set to undefined which is never used but to avoid guard fail in NullablePtr

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-03-18 18:08:54 +09:00
Akos Kiss
b1911d3d6d Some VENDORTEST-related macro guard cleanup in shell (#12)
Signed-off-by: Akos Kiss <akiss@inf.u-szeged.hu>
2018-12-17 13:28:53 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
6b76791e32 Make compilable in clang (#71)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-04 16:44:19 +09:00
이승수/Tizen Platform Lab(SR)/Senior Engineer/삼성전자
28de827199 Change default license to LGPL license (#60)
* Update build spec file
* Add License files

Signed-off-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
2018-03-07 18:38:28 +09:00
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자
13808ec66a Promise jobs should use it's saved Context value (#29)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-11-23 17:37:21 +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
c4bc84def6 1. optimize esprima_cpp
2. update android bdwgc build flags

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-12 21:28:01 +09:00
seonghyun kim
5d56fd2bb4 1. do not ASTScopeContext explicitly. it is used by ByteCode-genaration
2. alloc esprima::Error as Non-GC type.
 - it can be thrown. but, bdwgc can not see try-catch variable area.
3. Use own context when eval, function are invoked.
4. implement fake-Realm class for v8 vender test

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-24 19:03:27 +09:00
Youngil Choi
e02af7daf8 Add License Clauses
Signed-off-by: Youngil Choi <duddlf.choi@samsung.com>
2017-03-10 18:06:20 +09:00
Sanggyu Lee
834696d331 Add evaluateScript and EscargotAPICast.h
- Also renamed shell.cpp to Shell.cpp.
- Next, I will add StringRef APIs and expose ScriptSandboxExecuteResult
and add testcase for evaluateScript.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
2017-03-09 13:58:31 +09:00
Renamed from src/shell/shell.cpp (Browse further)