Commit graph

61 commits

Author SHA1 Message Date
Seonghyun Kim
c2ef5b9e12 Reduce calling count of String::charAt
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2025-05-12 09:56:33 +09:00
Seonghyun Kim
f388c52797 Fix crash while buildStacktrace
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2024-10-10 10:45:05 +09:00
HyukWoo Park
77f0c49ad5 Add ESCARGOT_USE_EXTENDED_API build option to managed APIs used only for third party
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2024-05-14 10:08:26 +09:00
Seonghyun Kim
48150217a8 Divide ExectuionState to ExecutionState and ExtendedExecutionState(with rareData)
* This path reduce gc_malloc count for try-catch, with, generator, async function

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-11-20 13:31:17 +09:00
Seonghyun Kim
4f8582ec25 Compute stacktrace when creating ErrorObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-11-09 12:15:14 +09:00
HyukWoo Park
f41a422302 Fix execution state traversal in stack tracing
* fix stack tracing to correctly add execution state in the middle of multiple state links
* remove redundant checks in stack tracing

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-10-17 17:46:14 +09:00
HyukWoo Park
b09fdcb929 Replace redundant sandbox runs with try-catch statement
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-08-11 15:07:48 +09:00
HyukWoo Park
b980f68488 Fix minor code defects
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-07-25 10:47:49 +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
ebd5a42641 Fix backtrace info within eval code
* collect backtrace info including eval codes

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-20 08:44:14 +09:00
HyukWoo Park
d3f6ef74f9 Add ErrorThrowCallback API
* ErrorThrowCallback is invoked when an Error is thrown
* ErrorThrowCallback overwrites the result of ErrorCreationCallback

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-13 15:22:59 +09:00
HyukWoo Park
a84b75d407 Update ErrorCreationCallback handling to ignore adding stackdata into stack property
* if ErrorCreationCallback is registered and this callback already inserts `stack` property for evert created ErrorObject,
  we just ignore adding `stack` data into ErrorObject

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-03-28 10:38:47 +09:00
HyukWoo Park
1b38eeca32 Update Debugger to selectively generate debugging byte codes
* we can choose JS source code for debugging target
* selectively generating debugging byte code (breakpoint)
* add debugger init option (--skip=) to exclude certain source code from debugging
* rename debugger functions
* explicitly present the python version for debugger tool

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-03-25 17:41:23 +09:00
Zoltan Herczeg
92a8db40c8 Implement scope chain retrieval
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-02-08 18:53:38 +09:00
HyukWoo Park
ba540cd129 Remove redundant structures in stack tracing
* stack trace vector does not need to hold ExecutionState vector

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-01-18 15:28:21 +09:00
HyukWoo Park
913bcc7882 Rename StackTrace structures
* to clearly distinguish StackTraceData and StackTraceDataVector

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-01-18 15:28:21 +09:00
Seonghyun Kim
de02b5453f Add callee into StackTraceData
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-12-28 10:31:15 +09:00
Zoltan Herczeg
e3b1a9f5e6 Introduce abstract base class for debugger
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-11-23 10:52:17 +09:00
Zoltan Herczeg
c2ab3e1f3d Implement backtrace recording for Promise.then calls
Furthermore rework detection of recorded backtrace.

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-10-12 12:32:49 +09:00
Zoltan Herczeg
1dff039743 Implement backtrace recording for the debugger
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-10-06 11:43:19 +09:00
HyukWoo Park
07c91a33e6 Add callback for Error creation
* registered callback is triggered for each Error constructor call

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-14 16:39:15 +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
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
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
bence gabor kis
26b974addc Adding ExecutionState depth to backtrace info
The new member is needed to Escargot debugger backtrace function

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2020-05-28 17:59:20 +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
3916dad5fc Fix minor things
* Object.prototype.toLocaleString should use this value correctly
* ICU 67 doesn't format near minus zero value correctly, so we should disable test
* we should provide stack info correctly when there is try-statemenet

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-11 16:51:29 +09:00
Seonghyun Kim
a7e53a4524 Fixup minor things
* If we use Object::nextIndexBackward, Object::nextIndexForward with non ordinal object,
  we should not test existence of value for index(we would not call user-defined function)
* Generate more user-friendly callstack

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-06 11:27:31 +09:00
Zoltan Herczeg
161899bf56 Implement showing Exceptions.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-14 19:04:15 +09:00
Seonghyun Kim
1bd124fc1b Revise function call & Realm
* Revise Object::getPrototypeFromConstructor. we should get prototype from context of consturctor
* We should pass Optional<Object*> instead of Value with newTarget.
* Give correct prototype value for function prototypes and functions
* Implement %ThrowTypeError% correctly

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-02 17:06:53 +09:00
Zoltan Herczeg
c71d3cbd81 Support backtrace in the debugger.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-03-19 12:08:52 +09:00
HyukWoo Park
e32b181f4f Add NewTarget parameter to builtin functions
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-03-16 16:52:44 +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
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
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
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
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
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
66bd235740 Remove c++ try-catch statement in interpreter function. (#387)
* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-23 16:55:34 +09:00
Patrick Kim
356a103466 Separate FunctionObject (#344)
There are so many features in FunctionObject. so I separate FunctionObject into multiple classes.
  * Implement FunctionObjectProcessCallGenerator class for generate processCall code for each derived FunctionObject and implement [[call]], [[construct]] separately
  * Implement NativeFunctionObject, BuiltinFunctionObject for process NativeCall separately
  * Implement ScriptArrowFunctionObject for process `this` separately
  * TODO : ScriptClassMethodFunctionObject, ScriptGeneratorFunctionObject.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-01 11:30:40 +09:00
Hyukwoo Park
a81c864d05 Fix builtin constructor to creates a new object by itself (#319)
* native constructor function ptr in CallNativeFunctionData is removed
* builtin function call process is divided from normal call process
* Date constructor is fixed according to ES6 spec

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-07-18 17:38:52 +09:00
Tóth Béla
69ae9be8d2 Reduce Code Smell issues (#221)
Rewamped a little bit of code, reported by SonarCloud for code smell.
Redudant parenthesis, and empty if statement code blocks.

Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2019-05-08 13:57:15 +09:00
Hyukwoo Park
2b95dc90bd Set the result value of SandBox::run to undefined when exception occurred (#152)
* when exception occurred, the result value of SandBox::run will never be used
* undefined value is allocated to avoid dereferencing of null pointer

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-03-20 13:31:16 +09:00
Hyukwoo Park
d5eba8f75b Fix conversion to String for result value of SandBox run (#149)
* implement toStringWithoutException method not to throw any exception while converting to string value

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-03-15 20:09:11 +09:00
Peter Marki
9a313f36bf Handle exceptions thrown by toString() when trying to convert an uncaught error (#42)
Fixes #36

Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2019-01-10 17:38:57 +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
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
470d1374a8 Implement lazy LOC computing when got exception for performance (#88)
* update windows build stuffs

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-31 15:31:37 +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