Commit graph

374 commits

Author SHA1 Message Date
HyukWoo Park
7e68583b56 Fix a bug that interpreter reuses an argument buffer of caller in tail call
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-05-30 14:20:41 +09:00
HyukWoo Park
1fbf4872c7 Add a build option of tail call optimization
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-05-08 17:05:02 +09:00
HyukWoo Park
283873a291 Implement basic tail call optimization for normal function
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-05-03 11:18:25 +09:00
HyukWoo Park
0e0b759817 Include breakpoint bytecodes only for debugger mode
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-05-03 11:18:25 +09:00
HyukWoo Park
c8cc70d83e Update Stack Overflow checker and disabler
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-04-17 09:16:01 +09:00
Seonghyun Kim
dd010ab68e Divide Value::Value(double) into Value(DoubleToIntConvertibleTestNeedsTag, double) and Value(UnconvertibleDoubleToInt32 v)
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-04-06 16:41:23 +09:00
Seonghyun Kim
7414ebda02 Introduce new Value ctor for NaN, Infinity regard to fix arm clang issue
arm clang optimizer cannot generate correct code
with Value(std::numeric_limits<double>::quiet_NaN())
or Value(std::numeric_limits<double>::infinity())

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-04-04 14:12:32 +09:00
HyukWoo Park
bf3f885519 Remove cycle dependency from interpreter to parser
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-04-03 11:22:51 +09:00
HyukWoo Park
de4c7eb0db Eliminate duplicated code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-28 16:17:00 +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
22c8ca389e Fix minor code defects
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-06 15:22:53 +09:00
Seonghyun Kim
6002bb00b6 Fix Android build properties & fix interpreter for clang
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2023-01-12 17:04:03 +09:00
HyukWoo Park
81bcf2ed13 Enable threaded interpreter for arm64 architecture
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-01-05 10:44:31 +09:00
Seonghyun Kim
ea0c2c4c82 Reduce ObjectStructure memory usage
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-10-28 09:46:07 +09:00
HyukWoo Park
cb31d43274 Fix minor defects
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-10-24 10:51:24 +09:00
Zoltan Herczeg
c1b02c23e0 Support dynamic import of JSON modules
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-09-29 10:33:58 +09:00
Seonghyun Kim
693dcf114c Implement PrivateIdentifier in ... expression
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-09-16 14:39:58 +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
Zoltan Herczeg
1a5414a0ba Support class static initializers
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-08-22 15:21:50 +09:00
Seonghyun Kim
e7b1cb2dde Revise FillOpcodeTable operation by using inline asm label.
we can remove one if-statement in interpreter through this commit.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-06-24 10:32:13 +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
Seonghyun Kim
93a0e853fe Implement inline cache version of get object opcode. Replace the opcode in runtime.
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-06-15 09:36:00 +09:00
Seonghyun Kim
633df26291 Reduce sizeof GetObjectPreComputedCase by 1-word
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-06-15 09:36:00 +09:00
Seonghyun Kim
25771515ff Merge Equals, NotEquals binary opcodes into one opcode
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-27 09:54:04 +09:00
Seonghyun Kim
3a5f883ad4 Allow to save Int32 convertible double value as double in Value for performance
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-23 16:02:20 +09:00
Seonghyun Kim
2737ccd987 Update Value constructors
Improve Value::Value(double) performance.
Add missing double and int32 type testing on interpreter

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-23 16:02:20 +09:00
HyukWoo Park
0f034c7f0b Mark non-fast mode ArrayObject by existing fast-mode data
* set dummy element address to denote non-fast mode array
* represent non-fast mode array without creating ObjectRareData

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-25 10:47:32 +09:00
Seonghyun Kim
71a6afeaae Improve accessing TypedArray Performance
Add Object::getIndexedPropertyValue method for achive that
the function removes redundant creation of ObjectGetResult.
And Improve TypedArray object reading performance through better implementation

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-22 16:11:23 +09:00
HyukWoo Park
467ca4708f Fix minor debugger error
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-20 17:18:47 +09:00
HyukWoo Park
a25c6fa5e8 Add a specific API to create a Script by wrapping the source code with an anonymous function
* `initializeFunctionScript` API is added
* unlike dynamically created function, `initializeFunctionScript` supports debugger
* origin line offset is added for correct source code calculation in debugger

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-14 10:57:47 +09:00
Seonghyun Kim
35c6836f2e Divide get object inline cache into 2 case
Divice get object inline cache into simple and complex cases
the simple case should test just one object chain with plain data property
the complex case should consider every case of inline cache

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-12 12:01:08 +09:00
Seonghyun Kim
f4d0b2c940 Improve array get, set performance in interpreter
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-08 10:26:23 +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
45eaf29c4c Reimplement object set inline cache to store multiple item of inline cache
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-05 11:18:18 +09:00
Seonghyun Kim
e6ff2808c8 Fix get object inline cache bug
we must convert form of inline cache when find complex case(max index is greater than 1) of get object.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-05 11:18:18 +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
c9f14d2a87 Implement ScriptSimpleFunctionObject for enhance function call performance
many general function can use ScriptSimpleFunctionObject.
It has simple call operation

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-23 10:53:36 +09:00
Seonghyun Kim
6d5a1ce7ac Revise object get inline cache
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-14 14:32:57 +09:00
Seonghyun Kim
f79a169daa Improve enumerate performance
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-14 14:32:57 +09:00
Seonghyun Kim
e245fe2871 Implement InlineCache in Object initialize
* Prevent too many recursive call with RopeString::charAt
* Add option to configure ObjectStructure

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-03 15:31:38 +09:00
Seonghyun Kim
925543bc15 Turn on inline cache for array, arguments object
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-02-23 13:47:03 +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
HyukWoo Park
bd35e41168 Add setName API of FunctionObject
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-01-13 13:24:09 +09:00
HyukWoo Park
e2758f5a2c Add createFunction API with source name parameter
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-01-03 11:28:48 +09:00
Zoltan Herczeg
d79eb6f9e1 Hide debugger enabled from public use.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-11-23 16:51:06 +09:00
HyukWoo Park
30f3b3a348 Revise createFunctionSourceFromScriptSource
* add simple syntax checker method in parser to check parameters and body string
* fix it to check parameters and body string seperately
* add several TCs for this patch too

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-01 17:03:58 +09:00
HyukWoo Park
843f4af78e Assign source name for dynamically created functions
* get source name through outer lexical scope

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-09-27 16:37:12 +09:00
Seonghyun Kim
7692878218 Add try-catch-finally condition variable into ExecutionState
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-09-09 15:17:12 +09:00
HyukWoo Park
54fadc4ff8 Remove redundant defineOwnPropertyThrowsExceptionWhenStrictMode method
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-08-30 10:00:12 +09:00