Commit graph

64 commits

Author SHA1 Message Date
Patrick Kim
43f442c560 Revise function call processes (#347)
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
    this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-06 09:58:06 +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
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
Robert Fancsik
1fc56fcf9a Implement the class language element part II. (#203)
Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-05-14 09:10:13 +09:00
Robert Fancsik
2d7056e5a1 Simplify InterpretedCodeBlock initialization (#145)
Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
2019-03-14 12:03:06 +09:00
Peter Marki
16010c33e1 Throw exceptions by value and catch by reference (#62)
Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2019-01-23 11:50:52 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
ea7b221a53 Implement initial version scanning function in program when parsing program. (#172)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-12-11 13:18:01 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
70afb08b5a Optimize vector, esprima_cpp, bytecode generating (#170)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-12-07 14:21:38 +09:00
박혁우/Tizen Platform Lab(SR)/Staff Engineer/삼성전자
42eee4e35b Implement Arrow Function[ES6] (#162)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2018-11-14 11:29:18 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
ef57dc3400 Optimize ScriptParser more (#70)
* Diet ScannerResult
* Use SourceStringView if possible for reducing memory usage

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-04 13:44:02 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
112221ab22 Optimize AST tree & Script parser Scanner functions (#69)
* This patch increase octane score +2~3%(x86 intel)
* We suggest jobs number in third party build even if failed to find cpu core count
  Using -j options cause system fail some legacy system

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-03 07:29:55 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
b3f8e0105a Optimize ScriptParser & redesign String classes (#68)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-04-27 13:06:43 +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
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자
55ee12d6b0 Improve script parsing performance (#23)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-10-24 15:09:40 +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
Saebom Kim
74869c1ec9 1. remove RELEASE_ASSERT_NOT_REACHED in ScriptParser
2. fix a floating point precision bug in DateObject
3. fix a bug in Math.round() which occured with big integer

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-05-12 20:18:22 +09:00
seonghyun kim
f234131c6c 1. use right receiver calling setter in GetObjectOperation
2. when evaluate evalLocal operation, flag of inside of with statment should propagate into inside CodeBlock due to using CallInWithOperation instead of CallOperation
3. restict using of RegisterCopySkip mode in CompoundAssigmentNodes
4. In with statement, every continue statement to outer statement is not allowed except label for literation

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-11 17:33:45 +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
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
aa0b23d765 1. update android build flags
2. fix typeof bugs

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-11 13:12:31 +09:00
Saebom Kim
6d4ed41488 1. When 'writable' property of array length turned into 'false', convert it into NonFastMode
2. If RegExp's source needs escapeSlash process, it should count the number of leading backSlashs

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-04-05 19:28:08 +09:00
seonghyun kim
98850e4d34 LexicalEnvironment should be allocated in heap with deleteing ID expression
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-05 15:59:18 +09:00
seonghyun kim
ee1dcad092 1. revise DeclareFunctionExpression as CreateFunction
2. evalute function decl in catch correctly
3. give receiver of get, set in interpreter correctly
4. give right StackTrace information in with, try-catch for user
5. fix bug in argument object around get, set variable

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-31 21:30: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
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
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
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
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
e305e378cb 1. add CodeBlock::m_hasArgumentsBindingInParameterOrChildFD for boost FunctionObject::call performance
- hasArgumentsBindingInParameterOrChildFD is computed every function calling before
2. computing ExtendedNodeLOC bug with global CodeBlock when source code has comment at the front
3. add default object structor for arguments object
4. implement Object::getIndexedProperty, Object::setIndexedProperty
5. use SmallValueVector in Env record instead of ValueVector

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 10:36:25 +09:00
seonghyun kim
438cdfcb38 1. process \r\n pattern in ByteCodeBlock::computeNodeLOCFromByteCode correctly
2. use stackStorage for "arguments" object
3. do not insert empty name for ASTScopeContext when comes emptyString in FunctionExpression name

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-03 13:19:51 +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
30969cc0a3 1. track using identifier correctly in esprima
2. remove useless new operation
3. use Indexed storage for CodeBlock has arguments binding

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-02 12:17:04 +09:00
seonghyun kim
389e767ae8 use indexed load/store for catch block partially
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-23 13:50:48 +09:00
seonghyun kim
2fc34d628a 1. use typed allocate for all long-live objects
2. implicitly delete AST when ast is useless
3. allocate String::emptyString correctly
4. hide ptr in LeakChecker for better tracing

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-20 15:51:47 +09:00
seonghyun kim
dbbbdf2374 allocate almost gc objects as typed gc object
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-18 20:28:45 +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
a644f0befe fix function name binding bug
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-06 13:00:44 +09:00
seonghyun kim
c970d99552 1. fix bug in Object::nextIndex*
2. implement ::generateCodeBlockTreeFromASTWalkerPostProcess

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-04 15:22:12 +09:00
seonghyun kim
a85ee09334 re-implement arguments object binding
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-02 16:10:26 +09:00
Junyoung Cho
5d2a2927ae Mark ancester code blocks as heap-allocated if code block has captured variables
**ref: ch10/10.4/10.4.3/10.4.3-1-102-s.js
2016-12-28 19:46:12 +09:00
seonghyun kim
5bca24da82 1. implement ObjectDefineOwnPropertyOperation
2. Add errorcode in ScriptError
3. Fix array length bug
4. Fix ObjectPropertyDescriptor::ObjectPropertyDescriptor(ExecutionState& state, Object* obj)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-23 22:21:22 +09:00
seonghyun kim
12e538992b implement arguments object
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-23 16:11:49 +09:00
Junyoung Cho
0faef8219f - Apply strict within eval from outside strict context
- Fix octal bug in parser
2016-12-23 10:19:51 +09:00