* 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>
State without Context is rare, and the merged structure consumes less amount of memory.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
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>
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>
- 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>
2. merge DeclareFunctionDeclaration, DeclareFunctionDeclarationsInGlobal into DeclareFunctionDeclarations
3. implement EnvironmentRecord::initializeBinding for initialize function decl.
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
there is right version of hasBinding for createMutableBinding in createMutableBinding already
2. builtin Function ctor should process "} {" input correctly
3. exclude more spider-monkey vendor test
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
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>