Commit graph

135 commits

Author SHA1 Message Date
HyukWoo Park
ebd5a42641 Fix backtrace info within eval code
* collect backtrace info including eval codes

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-20 08:44:14 +09:00
Seonghyun Kim
04eb482d1e Add Object::constructorName API
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-05-03 19:05:38 +09:00
Seonghyun Kim
ba7c596e59 Implement PrototypeObject
PrototypeObject always returns true in Object::isEverSetAsPrototypeObject.
thus it don't need another space for mark it was used for prototype object.
this object can reduce a lots allocation of ObjectRaraData

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-04-18 17:15:36 +09:00
HyukWoo Park
a25c6fa5e8 Add a specific API to create a Script by wrapping the source code with an anonymous function
* `initializeFunctionScript` API is added
* unlike dynamically created function, `initializeFunctionScript` supports debugger
* origin line offset is added for correct source code calculation in debugger

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-14 10:57:47 +09:00
HyukWoo Park
fa052c8902 Refactoring ObjectTemplate's PropertyHandler
* update to common PropertyHandler data and strucuture to represent IndexedProperty and NamedProperty both
* check property name in each ObjectWithPropertyHandler method

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-17 17:22:35 +09:00
Seonghyun Kim
a30b318b4a Implement GenericIteratorObject
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-09-29 16:15:21 +09:00
HyukWoo Park
0d65ad5e3d Implement lazy builtin initialization
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-08-12 13:43:23 +09:00
HyukWoo Park
9de4409e4f Update basic Atomics operations (threading)
* add Atomics builtin object and its basic operations

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-29 17:16:05 +09:00
HyukWoo Park
324baba180 Update basic SharedArrayBuffer features (threading)
* add SharedArrayBuffer object
* update BackingStore to represent shared data block

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-17 11:09:33 +09:00
HyukWoo Park
616f32bb79 Remove ESCARGOT_OBJECT_SUBCLASS_MUST_REDEFINE macro
* override keyword specified instead

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-06-03 10:52:31 +09:00
seonghyun kim
e601d60247 Optimize decodeURIComponent, escape, encode
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-06 09:47:42 +09:00
HyukWoo Park
2b775dc2f5 Revise BigInt not to hold VMInstance pointer
* bf_context_t is now defined as a global variable and maintained during the runtime
* VMInstance::finalize is invoked at the end of program to guarantee the life time of bf_context_t

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-03-10 12:29:55 +09:00
Seonghyun Kim
109d199302 Reimplement static field initializer
* wrap initializer expr into virtual arrow function like instance field
* users can access super property in eval

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-02 10:21:45 +09:00
bence gabor kis
572a7eb3a2 Implement FinalizationRegistry object
https://tc39.es/proposal-weakrefs/#sec-weak-ref-objects

removed most of the related test-cases in test262 skiplist

The few remaning test-cases are base on FinalizationRegistry.prototype.cleanupSome, which i didn't find any documentation on.

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2021-01-26 12:02:22 +09:00
bence gabor kis
ccd0ec704c Implement WeakRef Object
related test262 test-cases has been removed from the skip list

Except two test since it needs FinalizationRegistry feature

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
2021-01-18 14:53:54 +09:00
HyukWoo Park
4c5beae4c5 Minor update to Error implementation
* merge error messages related with constructor methods
* add throwBuiltinError method for simple messages

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-12-04 10:09:14 +09:00
HyukWoo Park
e998d04bf6 Implement WebAssembly.validate
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-23 14:05:36 +09:00
Seonghyun Kim
cf26d821de Implement DataView.prototype.{get,set}{BigInt64,BigUint64}
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-11-23 13:53:29 +09:00
Seonghyun Kim
8821b0e275 Implement basic type operation of BigInt & basic builtin functions of BigInt
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-15 18:55:42 +09:00
Seonghyun Kim
9c9457ea38 Implement BigInt infrastructure
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-14 16:18:53 +09:00
HyukWoo Park
f56a557ff5 Reduce memory allocation during bytecode generation
* ByteCodeBlock does not hold location data info anymore
* location data of each bytecode is manually allocated only for stack-tracing or debugger mode
* duplicated String allocation for source code is removed

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-08-06 16:23:06 +09:00
HyukWoo Park
436fac4423 Implement CodeCache for CodeBlock tree
* update read/write modules for CodeCache
* store and load CodeBlock tree

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-07-30 10:44:40 +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
Seonghyun Kim
3d55b0bd3a Implement globalthis property
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-06-17 18:33:07 +09:00
HyukWoo Park
e3de031d7f Use macro for GlobalObject builtins
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-06-02 14:32:00 +09:00
HyukWoo Park
99d8acbe19 Update builtin methods of ArrayBuffer based on ES10
* separate definitions of ArrayBuffer methods into GlobalObjectBuiltinArrayBuffer.cpp

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-05-13 10:49:55 +09:00
Seonghyun Kim
a58a01e02f Implement Intl.RelativeTimeFormat
* Each Context should share supported intl locale array

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-05-08 18:04:38 +09:00
Seonghyun Kim
f37bd559bb Implement Unified Intl.NumberFormat
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-28 14:47:41 +09:00
Seonghyun Kim
d1f3979123 Revise Intl.DateTimeFormat
* Add hourCycle option into IntlDateTimeFormat
* Fix many minor bugs in IntlDateTimeFormat

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-28 14:47:41 +09:00
Seonghyun Kim
b91bf01178 Implement Intl.PluralRules
* Refactor Intl::getOptions

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-22 16:40:24 +09:00
HyukWoo Park
748c3fb3ce Update String lower, upper related conversion
* update fast path for one-byte strings
* update special casing conversion
* handle toLower/toUpper correctly using icu methods

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-21 16:42:03 +09:00
HyukWoo Park
4e2dc085a4 Apply ExtendedNativeFunctionObject for CreateBuiltinFunction
* replace CreateBuiltinFunction with ExtendedNativeFunctionObject
* apply to proxy and async generator

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-13 19:51:41 +09:00
Seonghyun Kim
bd833cad6b Use own BCP47 parser instead of ICU
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-13 13:47:19 +09:00
Seonghyun Kim
ff4357e70d Implement basic of Intl.Locale
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-13 13:47:19 +09:00
HyukWoo Park
d46a365326 Refactoring type check operations using tag comparison
* type check operations based on tag comparison are updated to be aggresively inlined replacing virtual function calls
* Object, String and Symbol use pre-defined tag values while other uses vtable address as its tag value

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-09 16:13:36 +09:00
HyukWoo Park
0f81aa5dce Represent all global error messages by static class members
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-04-03 11:30:10 +09:00
Seonghyun Kim
1bd124fc1b Revise function call & Realm
* Revise Object::getPrototypeFromConstructor. we should get prototype from context of consturctor
* We should pass Optional<Object*> instead of Value with newTarget.
* Give correct prototype value for function prototypes and functions
* Implement %ThrowTypeError% correctly

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-04-02 17:06:53 +09:00
HyukWoo Park
e32b181f4f Add NewTarget parameter to builtin functions
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-03-16 16:52:44 +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
Seonghyun Kim
5e7f0da0ee Fix various bugs
* Create new promiseCapability when async function called
* __{define,lookup}{Getter,Setter} should follow spec
* builtin String html functions should have correct name
* Fix parser bugs
- allow `{ let e; { function e(){} } }` case in parser
- disallow `try {} catch(e) { function e() {} }` case in parser
- recover await state correctly
* Date.prototype.setYear should use toInteger for input
* update tools/test/test262/make_excludelist.py and its resource

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-01-17 17:18:30 +09:00
Seonghyun Kim
af9b410fa7 Fix issues in some embedded platforms
* Implement RuntimeICUBinder
 - ICU has verison name on its symbol name like u_tolower_XX.
   but, we need to use escargot on various platform(without re-compile)
   thus, I implement this library
* add ceil function on IEEE754
 - there is an issue with -0 in builtin ceil function
* Use pypy instead of python for running test262(pypy is faster than python)

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-01-09 16:07:51 +09:00
seonghyun kim
53906a6d81 Optimize runtime performance
* Optimize ObjectStructurePropertyDescriptor
* Don't initialize inline storage of VectorWithInlineStorage
* Add Object::setPrototypeForIntrinsicObjectCreation for fast initialize
* Add ArrayObject::ArrayObject(ExecutionState& state, const uint64_t& size) for fast initialize
* Store stack-limit instead of stack-base
* Reduce size of ExecutionState
* Add fast version of Object::ownPropertyKeys for optimize Object.keys
* Add ValueVectorWithInlineStorage
* Remove some compiler warnings

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-12-05 15:04:20 +09:00
Boram Bae
f11752b532 Update to support new.target with Class and eval (#489)
* Pass more tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-10-31 13:38:49 +09:00
Patrick Kim
03ac100d7f Optmize escargot (#454)
* Don't allocate new StringView on parser if possible
* Store esprima::Context::firstCoverInitializedNameError as pointer. it can reduce copy cost on esprima::*CoverGrammar
* Make Script as reexcutable if possible
* Don't save parsed source codes
  - Remove SourceStringView
  - When create AtomicString from StringView, we should make new string data instead of reference StringView
* Reduce size of StringBufferAccessData
* Fix crash in toString of FunctionObject.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-11 15:32:04 +09:00
Patrick Kim
eceffac4c4 Implement Direct {Import, Export} (#448)
* Rename ESCARGOT_OUTPUT=bin into shell and make shell_test for testing.
* Remove ESCARGOT_SHELL, -SCARGOT_STANDALONE and Rename ESCARGOT_ENABLE_VENDORTEST into ESCARGOT_ENABLE_TEST.
* Fix bug in PersistentRefHolder
* Add DebuggerStatementNode for preventing parsing error even if we cannot support
* Revise Platform layer for supporting es6 module
* Implmenent class constructor toString

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-10-07 13:11:03 +09:00
Patrick Kim
e820e0b969 Revise public API (#442)
* PointerValueRef should inherit ValueRef
* Implement PersistentRefHolder for easy-rooting
* Remove SandBox interface for public
* Re-implement shell through public API
* Implement Platform for supprot various platform easily
* Add many missed public API methods(Set, Map, Symbol...)
* Add Memory class into public

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-30 10:55:27 +09:00
Boram Bae
dd78fda084 Update syntax errors related to 'super' (#438)
* Pass more test262 tests

Signed-off-by: Boram Bae <boram21.bae@samsung.com>
2019-09-24 16:23:54 +09:00
Patrick Kim
2cc9e3d63f Pass more test262 testcases (#428)
* Process 0x2028, 0x2029 char on template literal correctly
* Object are created by TaggedTemplateLiteral are should frozen
* When eval `super.foo = 1`, use `this` as receiver
* Implement Function.protoype.caller
* Fix processing '\0' char bug in builtinFileReadHelper
* When eval `yield delegate` repect it's result.

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-17 15:27:09 +09:00
Patrick Kim
2173fa4b25 Pass more test262 testcases (#426)
* in ES6, we need to set function name when object literal has function expression on right side
* in ES6, we should not check duplicated property name on object literal
* Refactor Object::hasInstance & Object::getMethod

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
2019-09-16 13:25:56 +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