Commit graph

94 commits

Author SHA1 Message Date
Junyoung Cho
0d93c8e2fe Seperate original src/heap directory into submodule GCutil and src/heap
Now,
 - GCutil has bdwgc and general GC Utilities (LeakChecker, allocator
         wrapper)
 - src/heap has Escargot-dependent functions (Custom Allocator,
         LeakCheckerBridge for global function support)
2017-02-23 13:21:22 +09:00
seonghyun kim
ce64bf505f 1. divide simple registerIndex into callee, receiver, arguments, result index within call, new bytecodes
2. give limit of arguments count in esprima (65535)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-23 12:58:45 +09:00
Saebom Kim
98c50a4834 Pass some more SpiderMonkey tests and stabilize it
- gitlab-ci will not allow SpiderMonkey's failure
- fix typos
- subdivide cases when there is controlflow in 'with' operation
- Function.prototype.call should initialize arguments field even if there isn't any value
- implement Number.prototype.toLocaleString
- construct m_objectPrototypeToString
- upgrade check_tidy.py to print filenames which are not tidy

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-02-23 10:28:15 +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
4741f27e41 1. resolve jump positions when generating byte code
2. optimize UpdateExpressions
 - implement Increment, Decrement codes
 - divide UpdateExpressions into fast case and slow case
 - use Increment, Decrement codes in fast case
3. optimiuze AssigmentExpressionSimpleNode
4. avoiding to generate JumpIfFalse if condition is always true in WhileStatementNode ex) while(true) {...}

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-21 12:49:05 +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
bf96bca7b0 1. use SmallValueVector for enumerate object in interpereter
2. use direct memory reference instead of in-direct memory reference in GetObjectPrecomputedCase
3. use StringView with String::subString if needed

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 19:51:14 +09:00
Junyoung Cho
643d608d99 1. Fix gbs build error for debug: resolve uninitialize error
2. Fix bytecode generation bug in with
2017-02-13 12:59:16 +09:00
seonghyun kim
8c661ddf41 1. seperate ReturnFunction code to ReturnFunction and ReturnFunctionWithValue
2. add ObjectDefineOwnPropertyWithNameOperation code for remove useless ObjectPropertyName(ExecuteState, Value) call in interpreter
3. add ObjectPointerTag in Value::tag for 32bits. this gives better performance for Value::isObject, Value::isString function
4. optimize FunctionObject::call, Value::isPrimitive function

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 10:36:26 +09:00
Junyoung Cho
880c068122 Recover m_contentLength in RopeString
- avoid performance loss in ChakraCore String test
(Strings/concat_empty.js)
2017-02-13 10:36:25 +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
1b044658fc 1. remove libunwind from Makefile & source
2. disable thread function in bdwgc
3. remove m_version from ObjectStructure
4. add rawBuffer in TypedArrayObject
5. remove wrong usage of Value::toArrayIndex and Value::toIndex
6. optimize String::tryToUseAsArrayIndex, String::tryToUseAsIndex

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-13 10:36:25 +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
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
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
Eunji Jeong
b3ff7a3a7d Clear stack before executing interpreter loop to reduce leak from stack 2017-01-25 13:21:26 +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
Eunji Jeong
f72b0fdc9a Avoid accidential GC of exception value 2017-01-16 17:12:42 +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
96293e2716 wip
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-12 22:15:52 +09:00
seonghyun kim
109be415d1 1. remove Increment, Decrement opcode
2. implement fast String buffer access
3. remove hash from AtomicStringMap
4. implement simple dtoa cache

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-12 21:30:26 +09:00
seonghyun kim
baeab5a6ac 1. optimze interpreter
2. optimze getThisBinding operation
3. optimze esprima::scanStringLiteral
4. optimze ObjectStructurePropertyDescriptor

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-11 12:39:06 +09:00
seonghyun kim
fefa16daaa 1. reduce default ast Node size
2. don't useless info in esprima
3. implement pool of ScannerResult in esprima
4. optimize SetGlobalObject, GetGlobalObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-10 19:46:46 +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
fcc6038ec5 speed up read/write object in interpreter
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-09 21:00:47 +09:00
seonghyun kim
adc1b3cea1 1. optimze write, read global object in interpreter
2. optimze write, read object in interpreter

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-09 20:15:15 +09:00
seonghyun kim
feb6a07048 1. fix primitive proxy object write bug
2. fix atod parsing bug
3. fix typed array subarray bug

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-09 16:54:19 +09:00
seonghyun kim
823689865e fix order of assignmentExpression
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-06 18:29:07 +09:00
seonghyun kim
81a929e45a 1. implement ArrayBufferObject
2. use FastAccessObjectStructor for Built Function prototypes

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-05 16:59:55 +09:00
seonghyun kim
65e5d5ab7a fix ArrayObject::setFastModeValue
condition of enter NonFastMode is wrong

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-04 13:12:04 +00:00
seonghyun kim
7a7d339161 re-implement set ArrayLength
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-03 17:51:35 +09:00
Junyoung Cho
67f957ca47 Remove UnaryPlus Opcode to fix opcode duplication error in release mode
- use ToNumber instead
2017-01-03 17:35:56 +09:00
Junyoung Cho
35fbc7500d Consider with-object binding in function within with scope 2017-01-03 17:35:56 +09:00
Eunji Jeong
709b364547 Pass test262 Object.prototype.defineOwnProperty tests except for arguments 2017-01-03 12:07:54 +09:00
Junyoung Cho
ef5fccac36 Consider function call and arguments in with scope
- In the function called in with scope, 'this' can be either global or with object (S15.10.6.2_A1_T2)
2017-01-02 22:17:57 +09:00
seonghyun kim
32d921e59d implement UpdateExpression{Increment, Decrement} correctly(add tonumber operation)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-02 18:26:29 +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
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
5d36237438 Change receiver type to Value instead of Object* (consider receiver with primitive type) 2017-01-02 12:59:52 +09:00
Eunji Jeong
8f882fd6d9 Assign string type as for-in LHS
- Implement Object.keys ( O )
- Fix bug in String::tryToUseAsArrayIndex
2016-12-30 15:04:52 +09:00
Junyoung Cho
9073685c5f Implement Function.prototype.bind 2016-12-29 18:00:00 +09:00
Eunji Jeong
04768e7555 Throw in catch/finally clause should be handled correctly 2016-12-29 16:24:20 +09:00
Eunji Jeong
6db46a1f27 Pass more tests in test262 ch12
- The values of [[Enumerable]] attributes are not considered when
determining if a property of a prototype object is shadowed by a
previous object on the prototype chain.
- Handle different object initializer syntax in ES5-ES6
- Parser should not be in function body at initialization
2016-12-28 16:15:53 +09:00