Commit graph

80 commits

Author SHA1 Message Date
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
0d5bf035e7 Update class experession error message (#57)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-02-28 12:55:10 +09:00
이승수/Tizen Platform Lab(SR)/Senior Engineer/삼성전자
990ae6c48e Add license notices (#54)
Signed-off-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
2018-02-21 14:10:22 +09:00
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자
d1ec18e06f Enhance ES6 feature (#17)
* Add ESCARGOT_TREAT_CONST_AS_VAR runtime-flag
* Fix bug in ArrayBuffer.isView

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-08-11 18:32:14 +09:00
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자
b8d3eca96e Reducing memory usage & Fix bug (#11)
* Implement ShortStringView
* Fix bug in escapeSlashInPattern

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-07-26 08:35:43 +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
219bf36dcb Fix bug in AssignmentExpressionSimpleNode::hasSlowAssigmentOperation
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-11 19:46:20 +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
a9bc1569ee 1. optimize ScriptParser, ByteCodeGenerator
2. fix bug in Array.prototype.splice

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-04 19:56:38 +09:00
seonghyun kim
750ba31982 1. reduce memory usage of CallNativeFunction, CallBoundFunction
2. optimize StringBuilder

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-14 20:35:14 +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
seonghyun kim
7e2dc69a0d 1. enable build for android
2. add ENABLE_ICU flag

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-07 14:09:00 +09:00
seonghyun kim
734576329e add spread element error in parser
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-07 12:31:53 +09:00
seonghyun kim
74805fddd8 evaluate name `arguments' comes on function name correctly
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-05 18:33:36 +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
2d4b740d39 1. give correct error to unsupported ES6 syntax
2. parse trailing whitespace correctly in Date parsing

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-04-05 12:48:23 +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
61f1065a7f 1. fix typo error in GlobalObject::eval
2. DeclarativeEnvironmentRecordNotIndexedForCatch for evalutate calling eval function in catch
3. evalutate computed flag of PropertyNode properly

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-31 12:58:37 +09:00
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
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
60ebc7c688 1. escargot should throw error when writing setLastIndex. if setLastIndex of RegexpObject is setted as non-writable
2. treat series of "if (true) function() {}" correctly

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-22 13:44:03 +09:00
Saebom Kim
521dd64de2 pass more SpiderMonkey TCs
* for-in statement should not corrupt reserved r0 register value
* when parsing large statements, it should not make memory overflow
* fix Number.prototype.toLocaleString() not to use first parameter
* fix typo

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-03-17 17:37:12 +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
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
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
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
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
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
Youngil Choi
38dbe94d8d 1. use snprintf for string
2. use ESCARGOT_LOG_INFO, ESCARGOT_LOG_ERROR
2017-02-22 19:28:26 +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
Saebom Kim
d955741f95 Miscellaneous patches
* Function parseFloat() with "+0" works correctly
* \8 and \9 is parsed well in the esprima_cpp parser
* Make additional range check in String.prototype.replace()
* Replace use of ES6 Reflect.apply() with ES5 Function.prototype.apply()
* Update spidermonkey test results
* Add information about project prerequisites to README.md

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-02-16 15:50:17 +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
3a7541d44e 1. optimize esprima::isIdenifierStart, esprima::isIdenifierPart
2. optimize String::find
3. expand ESCARGOT_ASCII_TABLE_MAX to 256
4. implement ArrayObject::fastGetObject, ArrayObject::fastSetObject for fast ArrayObject access in native source
5. optimize Array.prototype.spice, Array.prototype.push... with ArrayObject::fastGetObject, ArrayObject::fastSetObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-03 21:43:49 +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
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
Eunji Jeong
3cac1b803b Add ecma_6 into spidermonkey vendortest
* Copy more files from es1 to run spidermonkey tests
* Add tools to run ECMA5-incompatible tests
  - [babel](https://babeljs.io/)
  - [es6-shim](https://github.com/paulmillr/es6-shim)
  - [es6-symbol](https://www.npmjs.com/package/es6-symbol)
* Add src/shell/GlobalObjectBuiltinTestFunctions.cpp to add test-only functions
* 'of' should be able to be used as identifier
* Set rpath of x86 binary relative to binary path
* Remove config.h.in~ file from repository
* Fix broken build by removing third_party/libunwind
2017-01-25 13:08:19 +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
Junyoung Cho
08c380c01b Fix error causing by older version gcc to support tizen_obs_arm build 2017-01-20 18:45:14 +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
Eunji Jeong
16d30378c2 Enable make run-jsc-stress and improve some error messages 2017-01-17 23:17:00 +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
Eunji Jeong
b79536b9c9 Support full functionalities of Promise object 2017-01-05 13:28:07 +09:00
Eunji Jeong
027b7445a5 Modification according to our ecma spec version management policy
* Remove USE_ES6_FEATURE flag
  : Some comments added for this
* Add ESCARGOT_USE_PROMISE flag
  : More feature-wise flags (like ESCARGOT_USE_TYPEDARRAY) will be added
* Add test/test262-master submodule
  : Our goal includes both fully supporting es5 and following the latest spec
* Add some basic functionalities for implementing Promise object
2017-01-04 17:16:04 +09:00