Commit graph

117 commits

Author SHA1 Message Date
seonghyun kim
e7df366d73 1. fix bug in Object.setPrototype
2. revise rule of generate name of binded function
3. revise order evalutate CallEvalFunction opcode
4. process invalid lhs assignment correctly
5. allow \n\r in string literal
6. implement change property of binding correctly
7. Date.prototype.toGMTString and toUTCString should be same
8. fix bug in Function ctor
9. add stack checking in parseJSONWorker
10. use double_conversion with Number.prototype.toFixed, toPrecision
11. add has8BitContent for RopeString for prevent stackoverflow when invoke child::has8BitContent

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-29 22:36:40 +09:00
Saebom Kim
a904501b75 Combination of [try|catch|with] and controlflows works correctly
- add member m_outerLimitCount into class ControlFlowRecord to save tryStatementScopeCount of the jump destination

* fix bug in Array.prototype.concat()
 - It will check the length of the array overflows or not

* fix bug in setting __proto__
 - when setting __proto__ to non-object, non-null, non-undefined value, it should do nothing

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-03-28 18:25:45 +09:00
seonghyun kim
b160b0bcb0 implement initialize and mutable of identifier correctly
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-28 17:29:29 +09:00
seonghyun kim
34dad07c79 move VM-bound data into VMInstance from context
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-23 18:48:02 +09:00
seonghyun kim
6873cb9a75 1. remove wrong ASSERT macro in var declatiotor node
2. remove wrong method Object::get(state, name, receiver)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-23 14:28:41 +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
d93ccc14fe 1. fix return operation bug in with statement
2. optimize JSON.parse function
3. exclude few useless vendor test cases

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-20 16:44:08 +09:00
seonghyun kim
738dd930b0 1. trait invalid LHS assigment correctly
2. implement ThrowStaticErrorOperation
3. optimize Get,SetObjectOpcode
4. optimize builtinArrayConstructor, Concat
5. implement SmallValue::fromValueForCtor it gives better performance when creating SmallValue from Value
6. add m_tag in String it gives the way to find typeof PointerValue without virtual function calling.
   we can remove this member variable when our project is ported into small device it has small memory

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-17 16:58:14 +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
f739987b49 1. Consider throw within catch clause
2. Fix small bugs in String.prototype.replace, %TypedArray%.prototype.set
update spidermonkey excludelist

Signed-off-by: Junyoung Cho <june0.cho@samsung.com>
2017-03-15 11:18:53 +09:00
Junyoung Cho
7c9240a1a7 1. For ES6 Array/Object pattern syntax, throw error instead of ASSERT crash.
2. Consider deleting arguments within 'with' scope.

Signed-off-by: Junyoung Cho <june0.cho@samsung.com>
2017-03-14 09:37:43 +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
Junyoung Cho
e060ee1cef 1. [jetstream] Show geomean for each category
2. Consider __proto__ in Object Initializers(e.g. var a = {__proto__ : o}) and cyclic __proto__
3. Update sunspider script in gitlab-ci

Signed-off-by: Junyoung Cho <june0.cho@samsung.com>
2017-03-10 18:24:48 +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
Saebom Kim
9d69187ee0 More SpiderMonkey TCs passed
* when getting a property of GlobalObject, we should think of its prototype
* if there is no parameter to Date.set* series functions, it should return NaN
* when array is parsed as JSON, the type of key is string, not number
* in Object.defineProperty(), original value with accessor should be found correctly

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-03-10 16:31:37 +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
44c0f3415d only ArrayObjects are checked length property when evaluate for..in
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-07 21:37:15 +09:00
seonghyun kim
d5cc12fb8d 1. remove possibility of to occur danging pointer in Get, SetGlobalObject ByteCode
2. optimize Call, New, UpdatePostfix expressions\
3. reduce recursive limit of esprima_cpp
4. give random seed
5. fix update for in data bug

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-07 21:05:43 +09:00
Saebom Kim
8d030091c8 for ( .. in obj ) statement should work correctly if obj is changed in the body of the statement
Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-03-07 12:16:58 +09:00
seonghyun kim
2bafeb2750 1. improve StringBuilder
2. prevent memory leak from RopeString
3. optimize GetGlobalObject, SetGlobalObject
4. move FunctionObject::isConsturctor to CodeBlock
5. optimize esprima_cpp
6. optimize String

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-06 21:58:40 +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
f27adc4dad 1. change order of register when generate expression byte code
2. optimize store stack variables

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-24 17:15:04 +09:00
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