mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 911578 - Introduce self-hosting intrinsic isPackedArray. r=jandem
--HG-- extra : rebase_source : de128118f4a52553efa77f70bb4699dfb94d97c4
This commit is contained in:
parent
fa682b166a
commit
49cb91346e
@ -1012,6 +1012,7 @@ bool intrinsic_UnsafePutElements(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_UnsafeSetReservedSlot(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_UnsafeGetReservedSlot(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_HaveSameClass(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_IsPackedArray(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
bool intrinsic_ShouldForceSequential(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_NewParallelArray(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
@ -463,6 +463,22 @@ js::intrinsic_HaveSameClass(JSContext *cx, unsigned argc, Value *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_IsPackedArray(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
JS_ASSERT(args.length() == 1);
|
||||
JS_ASSERT(args[0].isObject());
|
||||
|
||||
JSObject *obj = &args[0].toObject();
|
||||
bool isPacked = obj->is<ArrayObject>() &&
|
||||
!obj->type()->hasAllFlags(types::OBJECT_FLAG_NON_PACKED) &&
|
||||
obj->getDenseInitializedLength() == obj->as<ArrayObject>().length();
|
||||
|
||||
args.rval().setBoolean(isPacked);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
intrinsic_GetIteratorPrototype(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
@ -612,6 +628,7 @@ static const JSFunctionSpec intrinsic_functions[] = {
|
||||
JS_FN("UnsafeSetReservedSlot", intrinsic_UnsafeSetReservedSlot, 3,0),
|
||||
JS_FN("UnsafeGetReservedSlot", intrinsic_UnsafeGetReservedSlot, 2,0),
|
||||
JS_FN("HaveSameClass", intrinsic_HaveSameClass, 2,0),
|
||||
JS_FN("IsPackedArray", intrinsic_IsPackedArray, 1,0),
|
||||
|
||||
JS_FN("GetIteratorPrototype", intrinsic_GetIteratorPrototype, 0,0),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user