* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* 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>
* remove duplicated initialization for [[Prototype]] internal slot
* initialize prototype value directly when each Object created
* each prototype candidate object should be first marked as prototype object
* setGlobalIntrinsicObject marks fixed structure and prototype for global object's intrinsic object initialization
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* each builtin constructor of intrinsic object gets prototype from GetPrototypeFromConstructor
* Reflect constructor is fixed to pass newTarget to Construct operation
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Object::construct directly calls each internal construct method without any check code
* ByteCodeInterpreter::constructOperation is added to run IsConstructor check code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Fix parser error related with async arrow function
* CodeBlock may have diffrent source code start position data(from `function` keyword)
- new ECMAScript spec says we should make function source string from `function` keyword
* Apply new spec on builtin Function constructor
* AsyncFunctions must have correct initial properties
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>
* Fixup class parsing error check in esprima
* Class cannot have property named 'prototype'
* When define {getter, setter} in interpreter, property key can be symbol
* Reorder properties on class constructor
* Fixup public API
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* CodeBlock has essential parameter name list only
* toString builtin function is fixed to use the entire source instead of body source
* some TCs are fixed upto the spec
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>
- We should not heap allocated env on...
* functions uses variable on upper function
* functions have `typeof` operation
* functions have unmapped arguments object
- Improve calling function performance by remove accessing vtable once in interpreter(from isCallable, call to just call)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Set ALWAYS_INLINE flag for SmallValue <-> Value convertor function
* Implement ScriptGeneratorFunctionObject for remove if-statement in FunctionCall
* Remove calling Object::call in CallFunction, CallFunctionWithReceiver opcode
* if function uses global variable only, we should not use heap env for the function
* Don't use bitfield for ExecutionState::m_inStrictMode because we have only one flag at there.
* Remove useless submodules (test262-master, test262-harness)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
* Store ArgumentsObject into Env record with functionObject
* Introduce gc memory leak checker
* Don't save stack pointer in ArgumentsObject
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>
* Remove some unused function, variables
* Remove LexicalEnvironment from NativeFunctionObject
* Don't save stack-allocated LexicalEnvironment on ScriptFunctionObject. it may cause memory leak from stack
* Don't store newTarget, ThisBinded value on FunctionEnvironmentRecord if possible(we don't need these values except class functions)
Signed-off-by: seonghyun kim <sh8281.kim@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>