summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/ArrayConstructor.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/ArrayConstructor.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/ArrayConstructor.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
index cf02ea324..72fc5619f 100644
--- a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
@@ -29,11 +29,10 @@
#include "CopiedSpaceInlines.h"
#include "Error.h"
#include "ExceptionHelpers.h"
-#include "GetterSetter.h"
#include "JSArray.h"
#include "JSFunction.h"
#include "Lookup.h"
-#include "JSCInlines.h"
+#include "Operations.h"
namespace JSC {
@@ -47,13 +46,11 @@ namespace JSC {
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(ArrayConstructor);
-const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, &arrayConstructorTable, CREATE_METHOD_TABLE(ArrayConstructor) };
+const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable, CREATE_METHOD_TABLE(ArrayConstructor) };
/* Source for ArrayConstructor.lut.h
@begin arrayConstructorTable
isArray arrayConstructorIsArray DontEnum|Function 1
- of JSBuiltin DontEnum|Function 0
- from JSBuiltin DontEnum|Function 0
@end
*/
@@ -62,48 +59,47 @@ ArrayConstructor::ArrayConstructor(VM& vm, Structure* structure)
{
}
-void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol)
+void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype)
{
Base::finishCreation(vm, arrayPrototype->classInfo()->className);
putDirectWithoutTransition(vm, vm.propertyNames->prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
- putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum);
}
bool ArrayConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
{
- return getStaticFunctionSlot<InternalFunction>(exec, arrayConstructorTable, jsCast<ArrayConstructor*>(object), propertyName, slot);
+ return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec->vm()), jsCast<ArrayConstructor*>(object), propertyName, slot);
}
// ------------------------------ Functions ---------------------------
-JSObject* constructArrayWithSizeQuirk(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, JSValue length, JSValue newTarget)
+JSObject* constructArrayWithSizeQuirk(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, JSValue length)
{
if (!length.isNumber())
- return constructArrayNegativeIndexed(exec, profile, globalObject, &length, 1, newTarget);
+ return constructArrayNegativeIndexed(exec, profile, globalObject, &length, 1);
uint32_t n = length.toUInt32(exec);
if (n != length.toNumber(exec))
return exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Array size is not a small enough positive integer.")));
- return constructEmptyArray(exec, profile, globalObject, n, newTarget);
+ return constructEmptyArray(exec, profile, globalObject, n);
}
-static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args, JSValue newTarget)
+static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args)
{
JSGlobalObject* globalObject = asInternalFunction(exec->callee())->globalObject();
// a single numeric argument denotes the array size (!)
if (args.size() == 1)
- return constructArrayWithSizeQuirk(exec, nullptr, globalObject, args.at(0), newTarget);
+ return constructArrayWithSizeQuirk(exec, 0, globalObject, args.at(0));
// otherwise the array is constructed with the arguments in it
- return constructArray(exec, nullptr, globalObject, args, newTarget);
+ return constructArray(exec, 0, globalObject, args);
}
static EncodedJSValue JSC_HOST_CALL constructWithArrayConstructor(ExecState* exec)
{
ArgList args(exec);
- return JSValue::encode(constructArrayWithSizeQuirk(exec, args, exec->newTarget()));
+ return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
ConstructType ArrayConstructor::getConstructData(JSCell*, ConstructData& constructData)
@@ -115,7 +111,7 @@ ConstructType ArrayConstructor::getConstructData(JSCell*, ConstructData& constru
static EncodedJSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
{
ArgList args(exec);
- return JSValue::encode(constructArrayWithSizeQuirk(exec, args, JSValue()));
+ return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
CallType ArrayConstructor::getCallData(JSCell*, CallData& callData)