Commit graph

113 commits

Author SHA1 Message Date
Zoltan Herczeg
6740732ca8 [return-check] Change throws to returns
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2023-11-09 17:14:12 +09:00
HyukWoo Park
3f8ce198c9 Remove trivial try-catch statements
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-18 19:24:13 +09:00
HyukWoo Park
26af0cddc6 [return-check] change exception handling to return-check based method in interpreting (runtime) process
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-18 18:36:46 +09:00
HyukWoo Park
f56ea256b4 Fix minor code defects
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-11 15:07:48 +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
2046b1faa9 Divide Interpreter module into Interpreter and InterpreterSlowPath
* to reduce the total size of Interpreter module

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-28 16:17:00 +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
4c5a226df4 Fix a bug in virtual stack access
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-01-17 13:03:18 +09:00
Zoltan Herczeg
3a0b874a7e Implement JSON module parsing
Currently only the import statement is supported

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-09-13 16:46:36 +09:00
Seonghyun Kim
2678a383ec Improve dealing way of program counter in interpreter
* Use direct address instead of using offset of program when calling interpreter
* We don't need to restore the pointer of program counter in ExecutionState

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-06-24 10:32:13 +09:00
HyukWoo Park
02aac43bcf Minor fix for debugger
* debugger always stops at the start of new Script execution
* BreakpointLocationsInfo is added to debugger when Escargot generates bytecode for execution only

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-18 17:19:19 +09:00
HyukWoo Park
d0716850af Rename required register numbers for ByteCodeBlock
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-06 09:55:14 +09:00
Seonghyun Kim
ebf4756480 Binding function object in interpreter and compute required stack size early
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-28 14:39:52 +09:00
Seonghyun Kim
8fc73a6e13 Update script module API
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-01-21 10:19:49 +09:00
HyukWoo Park
9f156c6dc6 Fix minor gcc build errors
* for gcc version >= 9.3.0
* fix errors about -Werror=class-memaccess and -Werror=ignored-qualifiers

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-08 16:46:59 +09:00
HyukWoo Park
aef7ba0c98 Update GC event callback registration
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-07 08:39:04 +09:00
HyukWoo Park
faa56e648d Fix typo about gotException in ModuleExecutionResult
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-27 16:37:12 +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
77a68579a5 Implement per thread isolating
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-15 17:47:41 +09:00
Seonghyun Kim
025607bddc Implement Dynamic Import resolution, rejection
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-15 10:58:10 +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
5213b1fe11 Implement executeAsyncModule spec
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-12 10:17:09 +09:00
Seonghyun Kim
75c0c4bff2 Update Script Module data for following new spec & remove useless member variable
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-12 10:17:09 +09:00
Seonghyun Kim
161f516c54 Implement basic things of top level await
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-18 14:52:23 +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
3ebb4ea634 Remove redundant header files
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-06 17:00:18 +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
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
HyukWoo Park
773007bec6 Each InterpretedCodeBlock has its children in a vector
* reduce the whole size of InterpretedCodeBlock instances
* iterate fastly on children

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-07-23 15:19:05 +09:00
Seonghyun Kim
6503fc0416 Implement import.meta spec(MetaProperty)
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-07-16 12:51:24 +09:00
HyukWoo Park
2fe9333814 Divide CodeBlock into NativeCodeBlock and InterpretedCodeBlock
* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-07-08 16:56:44 +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
c9e4d5c6fd Implement more things about module
* Implement export * as {name} from {src} feature
* Update Script::resolveExport for following new spec
* Update test262 driver for running test cases correctly
* Implement changes of ModuleNamespaceObject::[[*]]

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-26 12:54:45 +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
Seonghyun Kim
6dec50591f We should create binding even there is virtual ID when executing Script
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-15 17:01:55 +09:00
Seonghyun Kim
a9a41ff5f0 Implement missing part of GlobalDeclarationInstantiation and EvalDeclarationInstantiation
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-11 16:51:29 +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
HyukWoo Park
0f81aa5dce Represent all global error messages by static class members
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-03 11:30:10 +09:00
Seonghyun Kim
5a284d486b Implement additional ECMAScript Features for Web Browsers
* Implement VariableStatement in catch rules
* Implement Function Declation rules

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-03-19 15:01:26 +09:00
Seonghyun Kim
4670a4097f Implement additional ECMAScript Features for Web Browsers
* Implement rules of Global Function declaration

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
HyukWoo Park
a4c5faf323 Fix some potential defect issues
* fix svace issue

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-01-15 11:14:38 +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
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
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
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