* 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>
* Implement one of parsing error of module
* Fix one of stack usage error on FunctionObjectInlines
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Object, Array, Environment record internal space should use 32bit addressing on 64bit
* Rename SmallValue to EncodedValue.
* Implement EncodedSmallValue for using 32bit address on 64bit
* Implement special vectors for EncodedSmallValue.
- we need these special vector. because when push_back or inserting the value what we want to insert
can be removed by GC because the parameter type is 32bit(EncodedSmallValue).
* Update GCutil for 32bit addressing on 64bit
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Implement export * as {name} from {src} feature
* Update Script::resolveExport for following new spec
* Update test262 driver for running test cases correctly
* Implement changes of ModuleNamespaceObject::[[*]]
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Store array length property in its member variable not value vector
- This can reduce one of GC_MALLOC call if there is not value in ArrayObject other than fastmode value
* Prevent memory leak from VMInstance, Context
* Change vector capacity reserve strategy
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Reduce size of RopeString
* Use fit memory if possible for ArrayObject fastModeData
* Re-implement ByteCode pruning logic
* Re-implement inline-cache for reducing memory usage
* Remove std::vector with gc_allocator. it can cause memory leak
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* 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>
* Fix BDWGC compile option
* Fix build error on ndk
* Global declared function declaration should always create binding
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* 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>
* 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>
* 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>
* each parameter is initialized by bytecode execution
* patterns in parameter list are no longer allocated in the heap in default
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
Save argc, argv on ExecutionState is enough.
and if function call is end, argv member on env points wrong place.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* CreateRestElement bytecode is newly added for generating a rest parameter
* RestElementNode is added to handle patterns in rest parameter later
* rest parameter is created at the first part of the function body execution
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
There are so many features in FunctionObject. so I separate FunctionObject into multiple classes.
* Implement FunctionObjectProcessCallGenerator class for generate processCall code for each derived FunctionObject and implement [[call]], [[construct]] separately
* Implement NativeFunctionObject, BuiltinFunctionObject for process NativeCall separately
* Implement ScriptArrowFunctionObject for process `this` separately
* TODO : ScriptClassMethodFunctionObject, ScriptGeneratorFunctionObject.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* implement mapped/unmapped ArgumentsObject
* passed arguments-related test262 TCs
* ArgumentsObject initially stores its matched values in an inner array (fast mode)
* when a property descriptor changed, ArgumentsObject manages the arg value as its property (slow mode)
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* treat variable in catch() as let
* add lexical environment record data into global environment for saving global permanently
* re-implement variable access bytecode generation
* re-implement class initialize operation
* re-implement global variable access bytecode for support lexcial variables in global
* fix bugs related with per-iteration lexical environment in for-statement
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
- Store lexcial block informantion in InterpretedCodeBlock.
- If lexcial block has no lexcial variables, we should collapse the block.
- If there is no heap-allocated variables in lexcial environment, we can skip allocation of the environment.
- Implement Indexed storage for lexcial environment.
- Allocate lexcial variables in function stack storage if possible.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* in most cases, parsing and bytecode generation process runs sequentially
* parsing error throws SyntaxError exception inside sandbox and this exception will be catched by the sandbox
* clear up some complicated code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>