Commit graph

53 commits

Author SHA1 Message Date
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
d1b4ced24c Update lexcial environment. (#313)
- Store lexcial block informantion in InterpretedCodeBlock.
- If lexcial block has no lexcial variables, we should collapse the block.
- If there is no heap-allocated variables in lexcial environment, we can skip allocation of the environment.
- Implement Indexed storage for lexcial environment.
- Allocate lexcial variables in function stack storage if possible.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-07-18 15:34:10 +09:00
Robert Fancsik
ef59096112 Implement the lexical scoping (#285)
This patch introduces the let and const keyword and all the related lexical scoping rules.

Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-07-05 13:38:11 +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
Roland Takacs
88b4a94c25 Modify ByteCodeGenerator to have static member functions (#291)
Signed-off-by: Roland Takacs <rtakacs.uszeged@partner.samsung.com>
2019-07-01 16:41:59 +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
8a37c3ad68 Use default argument value in ByteCodeInterpreter::interpret() (#173)
Signed-off-by: Roland Takacs <rtakacs.uszeged@partner.samsung.com>
2019-04-02 14:12:43 +09:00
최현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자
a62b5861bb Init uninitialized variables (#149)
Signed-off-by: Ryan Choi <ryan.choi@samsung.com>
2018-09-12 16:24:57 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
fabf1a0209 Use RefPtr & malloc/ free for AST tree & implement Array.prototype.includes (#64)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-04-18 11:06:10 +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
seonghyun kim
ef71d53298 1. fix bug around catch variable binding, env binding
2. fix bug in StringBuilder
3. add vendor test data xml files

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-15 21:55:21 +09:00
seonghyun kim
a98bf4ec1b 1. add FUNCTION_OBJECT_BYTECODE_SIZE_MAX as config flag
2. divide CodeBlock into CodeBlock and InterpretedCodeBlock for saving memory
3. expand SCANNER_RESULT_POOL_INITIAL_SIZE to 128
4. connect String -> AtomicString with remaining space of String::m_tag
5. optimize Function.bind

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-14 13:20:08 +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
seonghyun kim
35ceec9680 1. not every binding is mutable in strict mode
- add m_isExplicitlyDeclaredOrParameterName into name info in ASTScopeContext
  - add m_isMutable into IdentifierRecord struct
  - add ThrowStaticExcpetion opcode in indexed-mode
  - add throw exception code in storeByName operation
2. when evaluate delete operation on member variable, must evaluate toString operation once for name even if exception throws
3. in strict mode, Decimals with leading zero literals are not allowed

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-22 22:33:34 +09:00
seonghyun kim
f51edbe5d9 1. initialize message variable of ErrorObject correctly
2. merge DeclareFunctionDeclaration, DeclareFunctionDeclarationsInGlobal into DeclareFunctionDeclarations
3. implement EnvironmentRecord::initializeBinding for initialize function decl.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-21 21:49:24 +09:00
seonghyun kim
4d6d8ae543 1. when executing Global::evalLocal, hasBinding->createMutableBinding sequence for createBinding is wrong. we should execute createMutableBinding alone.
there is right version of hasBinding for createMutableBinding in createMutableBinding already
2. builtin Function ctor should process "} {" input correctly
3. exclude more spider-monkey vendor test

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-21 15:33:02 +09:00
seonghyun kim
ac77c0ad26 1. add initial version internal test
2. revise .gitlab-ci.yml
3. fix variable binding bug in with block
4. fix toLowerCase, toUpperCase bug

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-20 13:20:28 +09:00
Junyoung Cho
0c02fca7e3 Add eval condition to GlobalEnvironmentRecord::createMutableBinding.
Update spidermonkey result

Signed-off-by: Junyoung Cho <june0.cho@samsung.com>
2017-03-16 18:33:45 +09:00
seonghyun kim
b1cc608191 1. reduce size of ByteCodeBlock, CodeBlock classes
2. optimize function calling performance
 - change local variable binding order (this, function name first)
 - revise opcode table init method
3. remove OpcodeTable::m_reverseTable
4. use shared thrower JSGetterSetter instance for arguments, function object
5. revise Function.prototype.toString for to print function's source

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-15 22:19:13 +09:00
Junyoung Cho
abea619044 Support deleteBinding for FunctionEnvironmentRecordNotIndexed
Update Spidermonkey excludelist and result

Signed-off-by: Junyoung Cho <june0.cho@samsung.com>
2017-03-15 18:46:01 +09:00
seonghyun kim
013f0e5d16 1. re-implement arguments binding, CallBoundFunction logic for reduce interpreter loop size
2. optimize FunctionObject::call
3. remove ResetExecutionResult opcode
4. give stack limit of scriptParser correctly

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-13 19:23:12 +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
seonghyun kim
f424467d65 1. do not modify spidermonkey.<arch>.org.text when testing
2. implement DeclareFunctionDeclarationsInGlobal, ReturnFunctionSlowCase
3. remove m_canUseDisalignedRegister in ByteCodeGenerator
4. remove ExectuionResult in ExecutionState
5. do multiple array initialization in ArrayDefineOwnPropertyOperation
6. revise FunctionObject::call, UpdateExpressions
7. fix wrong global codeBlock decision in GlobalObject::eval
8. arguments binding can be added in non-indexed mode

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-08 23:43:52 +09:00
seonghyun kim
d0561e61be embed small amount of numeral literals into register file of interpreter
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-03 18:02:11 +09:00
seonghyun kim
974e986e76 1. replace LoadByStackIndex, StoreByStackIndex with Move opcode
2. generate more optimized byte code in for, if, assignment, update AST node

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-02 21:34:57 +09:00
seonghyun kim
f44a2a00a2 1. implement stack limit in Function::call
2. implement stack limit in escprima
3. replace RELEASE_ASSERT_NOT_REACHED() with throwing parse error in esprima
4. impement size limit of String
5. expose config parameters in Escargot.h

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-22 16:01:26 +09:00
seonghyun kim
76a249913a 1. give limit to variable count & register count
2. expand register limit to uint16_t
3. introduce skip copying from stack allocated local variable to interpreter register file

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-18 00:54:59 +09:00
seonghyun kim
e362acb82d 1. store thisValue in stackStorage instead of ExecutionState
2. remove GetThis byte code
3. optimize Function::call
4. optimize {get, set} of TypedArrayObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-14 18:32:15 +09:00
seonghyun kim
272c675e2e 1. sperate ByteCodeBlock::computeNodeLOCFromByteCode
2. implement selective clearing Stack
- only blockes have object, array, new expression are cleared by ClearStack function now
3. improve get object inline cache
4. remove CodeBlock::hasNonConfiguableNameOnGlobal
5. add thisValue in ExecutionState
6. optimize Value::abstractEqualsToSlowCase

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 10:36:25 +09:00
seonghyun kim
ef9e0ed699 1. reduce ByteCode size with remove loc
2. store ByteCodeLOC in ByteCodeBlock & lazy store loc
3. optimize builtin Array.prototype.splice
4. optimize Value::toNumberSlowCase
5. optimize arguments object

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-02 19:14:35 +09:00
seonghyun kim
ca93d380e1 1. reduce stack usage of ByteCodeInterpreter
2. remove memset warning from fillStack

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-25 19:25:33 +09:00
seonghyun kim
fd9fc94072 1. reduce byteCode Register size
2. remove ast implicitly when use less avoiding memory leak
3. change ByteCodeBlockData gc type into atomic
4. add literal info into ByteCodeBlock
5. force enable eager sweep
6. divide GC_mark_and_push_custom into GC_mark_and_push_custom_iterable and GC_mark_and_push_custom

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-17 18:27:24 +09:00
seonghyun kim
96293e2716 wip
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-12 22:15:52 +09:00
seonghyun kim
824e750e8a 1. argument order of FunctionObject::call is fixed
2. connect ExectionContext in GlobalObject::eval
3. remove ByteCodeBlock if needed

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-10 15:56:23 +09:00
seonghyun kim
7490ff4a3c 1. implement rest of TypedArray builtin functions for octane
2. fix find arguments in typeof expression

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-06 19:57:00 +09:00
Junyoung Cho
abeccf8098 Use DeclarativeEnvironmentRecordNotIndexed instead of FunctionEnvironment for new environement record in strict eval.
- fixed typo: DeclarativeEnvironmentRecord[NotIndexded->NotIndexed]
2017-01-02 14:32:48 +09:00
Junyoung Cho
aa7a06853e 1.Fix setter register bug
2.Set Thisbinding right in eval of strict mode
2016-12-28 15:08:36 +09:00
Junyoung Cho
8c40f310de Fix eval scope by indirect call in strict mode.
** ES5 10.4.2.1, ES6 18.2.1.1
2016-12-28 13:41:43 +09:00
Junyoung Cho
5db9956dfb Consider eval scope in strict mode. 2016-12-27 20:55:12 +09:00
Junyoung Cho
b2ea88b251 -Implement Object.create.
-Move toString for shell result into sandbox to resolve throw exception.
2016-12-20 12:51:20 +09:00
seonghyun kim
6e5fb90eec remove StackStorage from ExecutionContext, add RareData to ExecutionContext
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-19 15:48:18 +09:00
seonghyun kim
ba6400045c implement basic of try-catch statement
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-13 13:23:14 +09:00
seonghyun kim
35142d1c6a implement eval
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-12 14:34:31 +09:00
Junyoung Cho
f7a22f54fc Apply clang-formatting 2016-12-08 14:53:01 +09:00
seonghyun kim
6a758afc72 1. implement new, this expression
2. implement Math.max
3. implement unary plus, minus
this patch pass access-binary-trees.js

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-07 18:44:47 +09:00
seonghyun kim
288b147659 1. implement tracing stack when got exception
2. binding function name
3. implement sandbox for isolate throw exception
4. implement object expression
5. implement get, set object operation
6. implement logical and, or operation

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-06 22:22:04 +09:00
seonghyun kim
ef2987e8b4 1. implement binary operations (+, -, *...)
2. implement assigment complex cases( +=, -=...)
3. implement update expressions (++, --)
4. implement if, for statement
5. implement RopeString
6. implement throw statement

this patch passes bitops-bitwise-and.js, bitops-3bit-bits-in-byte.js

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-05 21:49:42 +09:00
seonghyun kim
887758e247 1. implement basic of Builtin Object, Function
2. implement Error Objects
3. implement basic errors

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-02 20:49:04 +09:00
seonghyun kim
782f489712 implement PropertyName type
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-01 16:53:57 +09:00
seonghyun kim
d587becaf3 1. implement indexed Storages for function
2. implement function call

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-01 14:43:06 +09:00