Commit graph

69 commits

Author SHA1 Message Date
박혁우/Tizen Platform Lab(SR)/Staff Engineer/삼성전자
c1323da780 Add CSP check api for eval and Function (#164)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2018-11-26 18:09:10 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
d66c4b900b Enhance developer experience (#98)
* Generate more detailed information(+ add related source code info)
* Fix source code line error on exception
* Add DUMP_ERROR_IN_TRY_CATCH option

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-06-19 18:04:19 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
c34461310f make test262(ES5) runnable on Windows (#78)
* add icu as submodule
* Fix some wrong implemations
* Remove functions defined on ctypes.h. its implemations slightly different on POSIX and Windows.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-14 15:19:55 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
2d7194e7ad Fix std::isnan bug with clang & add safe floating math cxxflags (#72)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-04 17:21:54 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
6b76791e32 Make compilable in clang (#71)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-05-04 16:44:19 +09:00
이승수/Tizen Platform Lab(SR)/Senior Engineer/삼성전자
61c351c935 Add samsung copyright for several files (#56)
Signed-off-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
2018-02-22 19:24:11 +09:00
이승수/Tizen Platform Lab(SR)/Senior Engineer/삼성전자
5fb97a9eb8 Modify license notice for each file (#55)
Signed-off-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
2018-02-22 18:23:17 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
b29c53eaab Improve android build (#49)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-01-24 15:42:34 +09:00
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
581878405a Implement build on android ndk (#48)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2018-01-23 14:29:07 +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
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자
cf31082836 virtual ID are should pretend to property of global object (#35)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-12-15 10:24:57 +09:00
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자
c0c2b51561 Implement Intl bulitin (#20)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-08-22 19:43:43 +09:00
seonghyun kim
0fe052715f 1. add ValueRef::toArrayIndex
2. remove virtualIdentifierInGlobalCallback
3. re-implement VirtualIDOperation for browser
4. add promise callback in vm
5. add parent pointer in ExecutionState
6. add locale, timezone parameter to VMInstance ctor

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-06-08 19:05:23 +09:00
seonghyun kim
dbc21192e3 implement Promise, gc, virtual property, virtual id things
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-25 13:15:38 +09:00
seonghyun kim
b5eb18a2dc implement more basic things in api layer
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-23 20:53:26 +09:00
seonghyun kim
20790b0be1 add old legacy functions(__defineGetter__, __defineSetter__, __lookupGetter__, __lookupSetter)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-05-18 12:20:27 +09:00
Saebom Kim
3a6cdd7931 1. Fix bug with 'eval()' in 'with' scope
2. Fix bug in parseFloat() related to the call of String::subString()
3. Fix bug in JSON.parse() related to TypedArray object type
4. Implement accessor(getter) function of TypedArray's byteOffset
5. Fix the type of %TypedArrayPrototype% from TypedArray to general Object (according to ES6 spec)
6. Get rid of buggy assertions inside the accessor-related code for 32bit arch.

Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
2017-04-14 19:52:26 +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
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
30489bbf09 1. revise builtinObject__proto__Setter to ignore undefined input
2. change order of evaluate ObjectPropertyDescriptor::ObjectPropertyDescriptor
3. give name to object getter, setter

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-03-30 14:20:58 +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
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
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
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
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
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
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
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
132f7f5316 1. implement Latin1String for reducing memory usage
2. add Makefile as dependency of make

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-02-03 19:06:15 +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
Eunji Jeong
16d30378c2 Enable make run-jsc-stress and improve some error messages 2017-01-17 23:17:00 +09:00
Eunji Jeong
e16ca9b621 Builtin load function should execute script with isOnGlobal=true 2017-01-10 21:01:32 +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
b48a1ee9a2 1. fix bug in Object::getOwnPropertyUtilForObjectAccCase
2. remove throw exception in Global.load

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-09 13:22:49 +09:00
seonghyun kim
7490ff4a3c 1. implement rest of TypedArray builtin functions for octane
2. fix find arguments in typeof expression

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-06 19:57:00 +09:00
seonghyun kim
f112dfefd2 1. fix wrong usage of ObjectPropertyDescriptor::NotPresent
2. add ArrayBufferObject

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-05 03:24:02 +00:00
seonghyun kim
9405b56d82 1. fix setting array length bug
2. optimze reduce array length
3. implement escape, unescape
4. implement rest of Array.prototype builtin functions

this patch pass all of test262(5.1)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2017-01-04 12:35:54 +00:00
Junyoung Cho
4bb8328055 Implement decodeURI, decodeURIComponent, encodeURI, encodeURIComponent 2016-12-30 15:24:09 +09:00
Eunji Jeong
c8840465d1 Pass tests in es5 test262 ch15.2.3.3 (except for URI-related features)
- Add every builtin function templates in es5
- Modification on Makefile target "check" should not trigger rebuild
- Add JSON object
- Implement some toString functions
- Initialize m_value properly in ObjectPropertyDescriptor constructor
2016-12-29 22:39:02 +09:00
Eunji Jeong
fb9e4a48c3 Eval code is strict if the call to eval is a direct call from strict code 2016-12-29 16:24:20 +09:00
Junyoung Cho
8c40f310de Fix eval scope by indirect call in strict mode.
** ES5 10.4.2.1, ES6 18.2.1.1
2016-12-28 13:41:43 +09:00
Junyoung Cho
5db9956dfb Consider eval scope in strict mode. 2016-12-27 20:55:12 +09:00
Youngil Choi
2916daa9a6 Rename HeapProfiler.h to LeakChecker.h in src/heap
Rename HeapProfiler.cpp to LeakChecker.cpp in src/heap
2016-12-27 14:28:57 +09:00
Junyoung Cho
0f9f888089 1.Always do not create new context in case of calling built-in eval function.
- changed the condition pushing CallEvalFunction bytecode in CallExpression AST.
2.Fix built-in Function constructor bug
2016-12-27 13:20:17 +09:00