mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 83e8b0ff394c (Bug 1081268) for Octane Mandreel regression.
This commit is contained in:
parent
11b80e2ff1
commit
49eb22d9e1
@ -308,13 +308,18 @@ class TypedArrayObjectTemplate : public TypedArrayObject
|
|||||||
makeTypedInstance(JSContext *cx, uint32_t len, gc::AllocKind allocKind)
|
makeTypedInstance(JSContext *cx, uint32_t len, gc::AllocKind allocKind)
|
||||||
{
|
{
|
||||||
const Class *clasp = instanceClass();
|
const Class *clasp = instanceClass();
|
||||||
bool largeAllocation = len * sizeof(NativeType) >= TypedArrayObject::SINGLETON_TYPE_BYTE_LENGTH;
|
if (len * sizeof(NativeType) >= TypedArrayObject::SINGLETON_TYPE_BYTE_LENGTH) {
|
||||||
|
JSObject *obj = NewBuiltinClassInstance(cx, clasp, allocKind, SingletonObject);
|
||||||
|
if (!obj)
|
||||||
|
return nullptr;
|
||||||
|
return &obj->as<TypedArrayObject>();
|
||||||
|
}
|
||||||
|
|
||||||
jsbytecode *pc;
|
jsbytecode *pc;
|
||||||
RootedScript script(cx, cx->currentScript(&pc));
|
RootedScript script(cx, cx->currentScript(&pc));
|
||||||
NewObjectKind newKind = script
|
NewObjectKind newKind = script
|
||||||
? UseNewTypeForInitializer(script, pc, clasp)
|
? UseNewTypeForInitializer(script, pc, clasp)
|
||||||
: (largeAllocation ? SingletonObject : GenericObject);
|
: GenericObject;
|
||||||
RootedObject obj(cx, NewBuiltinClassInstance(cx, clasp, allocKind, newKind));
|
RootedObject obj(cx, NewBuiltinClassInstance(cx, clasp, allocKind, newKind));
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user