Commit graph

45 commits

Author SHA1 Message Date
Seonghyun Kim
9e667ccdd2 Allow to save Int32 convertible double value as double in Value for performance
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-20 09:03:17 +09:00
HyukWoo Park
8fa6031fec Add DerivedObject for sub classes of Object
* check index property set in DerivedObject::defineOwnProperty method only
* index property check is removed for normal Object because PrototypeObject would check it instead

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-11 15:59:43 +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
Seonghyun Kim
a484082e44 Reduce memory usage
* remove useless GC_MALLOC_EXPLICITLY_TYPED
  typed-malloc information is allocated with each malloc operation

* Implement fast path for ObjectPropertyName

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-03-14 14:32:57 +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
HyukWoo Park
0b0ddee8e1 Refactoring index property handling
* when trying to use index property, we use only 32bit for index value (uint32_t)
* rename ArrayIndex as to Index32 and IndexProperty
* add cctest to verify the new api

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-07-05 13:20:38 +09:00
HyukWoo Park
b605adbb1f Refactor GC allocation with bitmap info
* replace each Object's member marking with Object::fillGCDescriptor
* BigInt allocation is fixed to be handled by simple GC_MALLOC_ATOMIC call

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-05-18 15:34:07 +09:00
Seonghyun Kim
8e71c6e208 Pass receiver to Object::get, Object::{get, set}IndexedProperty operation
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-11 11:51:17 +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
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
HyukWoo Park
39a5922437 Fix [[Prototype]] initialization process for each object creation
* remove duplicated initialization for [[Prototype]] internal slot
* initialize prototype value directly when each Object created
* each prototype candidate object should be first marked as prototype object
* setGlobalIntrinsicObject marks fixed structure and prototype for global object's intrinsic object initialization

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-03-24 18:26:25 +09:00
Seonghyun Kim
cf2c21e023 Implement additional ECMAScript Features for Web Browsers
* caller extension of ArgumentsObject is removed from recent ECMAScript standard
* __proto__ on object expression is changed.

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
3c6032f8c9 Fix bugs in function parameter
* fix function length to represent the number of consecutive identifiers from the start of parameter list
* collect parameter names including the target names of patterns and rest element
* separate function length and parameter count
* simplify the process of parameter collecting and rename parameter related functions more intuitively

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-02-03 13:49:44 +09:00
seonghyun kim
a126f3dd13 Treat function parameter initialization area as first lexical block
* in parameter initialization area, we cannot access var declared variables

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-10 15:43:52 +09:00
Patrick Kim
e91d0f0fe7 Improve execution performance (#491)
* Make ArgumentsObject light
* Implement lazy-creation of FunctionObject.prototype
* Don't copy ObjectStructor when executing Object::enumeration
* Use GC_REALLOC on Object, ArrayObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-11-04 11:18:03 +09:00
Patrick Kim
ba4631ae02 Fix public API errors & fix bugs (#466)
* When evaluate for-in, we should call [[Enumerate]] function & we shouldn't literate symbols and non-enumerable names.
* In esprima, we need to reset lastUsingName on {open, close}Block

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-17 11:20:06 +09:00
Robert Fancsik
1df4dcd1a8 Add fast paths for hasProperty internal method (#407)
Also the Object.[[Get]] method is modified to follow the standard requirements without recursion.

Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
2019-09-03 17:14:03 +09:00
Patrick Kim
b656248ce4 Refactor code (#396)
* Revise hasProperty and apply it everywhere
* Add hasIndexedProperty for performance
* Change Object::nextIndex{Forward, Backward} double parameter types into int for performance
* in String.prototype.replace, Use test fast path correctly & use old method because newer method cannot support regexp correctly(old method is faster)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-29 14:35:50 +09:00
Hyukwoo Park
cc3f7deb8c Remove redundant parameter modules (#390)
* CodeBlock has essential parameter name list only
* toString builtin function is fixed to use the entire source instead of body source
* some TCs are fixed upto the spec

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-08-27 10:40:30 +09:00
Patrick Kim
ad0cecbd0d Implement lazy-creation of arguments object. (#361)
* Store ArgumentsObject into Env record with functionObject
* Introduce gc memory leak checker
* Don't save stack pointer in ArgumentsObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-13 17:00:03 +09:00
Patrick Kim
3bc6cb5cca Don't store argc, argv on FunctionEnvironmentRecord. (#358)
Save argc, argv on ExecutionState is enough.
and if function call is end, argv member on env points wrong place.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-08-09 13:52:17 +09:00
Hyukwoo Park
6156f7a695 Minor fix about ArgumentsObject::defineOwnProperty method (#349)
* fix double checks into one check statement
* enable more test262 test cases

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-08-06 14:24:32 +09:00
Hyukwoo Park
af42a80f6b Rework ArgumentsObject based on ES2015 (#334)
* implement mapped/unmapped ArgumentsObject
* passed arguments-related test262 TCs
* ArgumentsObject initially stores its matched values in an inner array (fast mode)
* when a property descriptor changed, ArgumentsObject manages the arg value as its property (slow mode)

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-07-31 12:38:20 +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
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
Tóth Béla
47dce1c42b Merge collapsible if statements (#171)
Merged Collapsible if statements reported by SonarCloud.
Also unified some code in Lexer, to follow this ruleset.

https://sonarcloud.io/project/issues?branch=travisMoka&id=Achie72_escargot&resolved=false&rules=cpp%3AS1066&severities=MAJOR

Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2019-03-28 16:53:51 +09:00
Daniella Barsony
56b7748c67 Reduce code smells (#82)
Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-02-19 15:48:48 +09:00
Hyukwoo Park
40d4fa40c6 Implement Proxy object internal methods (#39)
* updated proxy methods
GetPrototypeOf
SetPrototypeOf
IsExtensible
PreventExtensions
GetOwnProperty
DefineOwnProperty
HasProperty
Get
Set
Delete
ProxyCreate

* TODO
Enumerate and OwnPropertyKeys
Call and Construct

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2019-01-21 12:22:40 +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
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
e66f512b32 Implement ES6 Symbol.hasInstance, iterator, toStringTag, toPrimitive and built-ins (#46)
* Implement Array.from
* Disable part of ES6-shim due to wrong implementation

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-01-19 15:20:27 +09:00
seonghyun kim
7865415648 using Direct register carefully in new, callexpression
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-12 21:24:39 +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
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
811cc9553f 1. setting array.length to writable false while writing length is should correctly evaluated
2. revise Array.prototype.{splice, slice, shift, unshift}
3. change Object::nextIndexForward, Object::nextIndexBackward to return existence of index

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-28 14:23:48 +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
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
0f1cc8999c 1. diet native getter, setter on Object
2. diet ByteCode
3. use get, setIndexedProperty in ByteCodeInterpreter
4. implement get, setIndexedProperty for typed array
5. move implemention of CallNativeFunctionOpcode to FunctionObject::call
6. remove m_contentLength, m_has8BitContent in RopeString
7. optimize ByteCodeInterpreter::getObjectPrecomputedCaseOperation, setObjectPrecomputedCaseOperation
8. diet Arguments object

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 10:36:25 +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
357ae0ac26 re-implement Arguments Object
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-06 12:58:52 +09:00
seonghyun kim
abc8d38ff7 optimize Object::enumeration
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-13 14:37:38 +09:00
seonghyun kim
2057250e48 implement Array.prototype.indexOf, Array.prototype.lastIndexOf
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-04 15:18:58 +09:00
seonghyun kim
2ab167a980 1. add m_isRemovedOnRedefineProperty on NativeGetterSetter data
2. add rest of arguments test in test262 5.1

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-04 11:14:52 +09:00
seonghyun kim
d6a08e6c82 re-implement ArgumentsObject index getter, setter(non-strict mode)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-03 21:07:07 +09:00
seonghyun kim
c024ad87f9 add missing files
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2016-12-23 16:28:04 +09:00