зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1118107 - Convert ThreadSafeContext -> ExclusiveContext and remove PJS paths in TypedObject code. (r=lth)
This commit is contained in:
Родитель
11dac78139
Коммит
b6874eed78
|
@ -2554,7 +2554,7 @@ js::NewDerivedTypedObject(JSContext *cx, unsigned argc, Value *vp)
|
|||
}
|
||||
|
||||
bool
|
||||
js::AttachTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
||||
js::AttachTypedObject(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 3);
|
||||
|
@ -2565,21 +2565,13 @@ js::AttachTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
|||
MOZ_ASSERT(!handle.isAttached());
|
||||
size_t offset = args[2].toInt32();
|
||||
|
||||
if (cx->isForkJoinContext()) {
|
||||
LockedJSContext ncx(cx->asForkJoinContext());
|
||||
handle.attach(ncx, target, offset);
|
||||
} else {
|
||||
handle.attach(cx->asJSContext(), target, offset);
|
||||
}
|
||||
handle.attach(cx, target, offset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::AttachTypedObjectJitInfo,
|
||||
AttachTypedObjectJitInfo,
|
||||
js::AttachTypedObject);
|
||||
|
||||
bool
|
||||
js::SetTypedObjectOffset(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::SetTypedObjectOffset(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 2);
|
||||
|
@ -2596,19 +2588,7 @@ js::SetTypedObjectOffset(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_SetTypedObjectOffset(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
// Do not use JSNativeThreadSafeWrapper<> so that ion can reference
|
||||
// this function more easily when inlining.
|
||||
return SetTypedObjectOffset(cx, argc, vp);
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::intrinsic_SetTypedObjectOffsetJitInfo,
|
||||
SetTypedObjectJitInfo,
|
||||
SetTypedObjectOffset);
|
||||
|
||||
bool
|
||||
js::ObjectIsTypeDescr(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::ObjectIsTypeDescr(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2617,11 +2597,8 @@ js::ObjectIsTypeDescr(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTypeDescrJitInfo, ObjectIsTypeDescrJitInfo,
|
||||
js::ObjectIsTypeDescr);
|
||||
|
||||
bool
|
||||
js::ObjectIsTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::ObjectIsTypedObject(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2630,12 +2607,8 @@ js::ObjectIsTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTypedObjectJitInfo,
|
||||
ObjectIsTypedObjectJitInfo,
|
||||
js::ObjectIsTypedObject);
|
||||
|
||||
bool
|
||||
js::ObjectIsOpaqueTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::ObjectIsOpaqueTypedObject(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2644,12 +2617,8 @@ js::ObjectIsOpaqueTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsOpaqueTypedObjectJitInfo,
|
||||
ObjectIsOpaqueTypedObjectJitInfo,
|
||||
js::ObjectIsOpaqueTypedObject);
|
||||
|
||||
bool
|
||||
js::ObjectIsTransparentTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::ObjectIsTransparentTypedObject(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2658,12 +2627,8 @@ js::ObjectIsTransparentTypedObject(ThreadSafeContext *, unsigned argc, Value *vp
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTransparentTypedObjectJitInfo,
|
||||
ObjectIsTransparentTypedObjectJitInfo,
|
||||
js::ObjectIsTransparentTypedObject);
|
||||
|
||||
bool
|
||||
js::TypeDescrIsSimpleType(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::TypeDescrIsSimpleType(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2673,12 +2638,8 @@ js::TypeDescrIsSimpleType(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsSimpleTypeJitInfo,
|
||||
TypeDescrIsSimpleTypeJitInfo,
|
||||
js::TypeDescrIsSimpleType);
|
||||
|
||||
bool
|
||||
js::TypeDescrIsArrayType(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::TypeDescrIsArrayType(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2689,12 +2650,8 @@ js::TypeDescrIsArrayType(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsArrayTypeJitInfo,
|
||||
TypeDescrIsArrayTypeJitInfo,
|
||||
js::TypeDescrIsArrayType);
|
||||
|
||||
bool
|
||||
js::TypedObjectIsAttached(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
||||
js::TypedObjectIsAttached(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
TypedObject &typedObj = args[0].toObject().as<TypedObject>();
|
||||
|
@ -2702,12 +2659,8 @@ js::TypedObjectIsAttached(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypedObjectIsAttachedJitInfo,
|
||||
TypedObjectIsAttachedJitInfo,
|
||||
js::TypedObjectIsAttached);
|
||||
|
||||
bool
|
||||
js::TypedObjectTypeDescr(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
||||
js::TypedObjectTypeDescr(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
TypedObject &typedObj = args[0].toObject().as<TypedObject>();
|
||||
|
@ -2715,12 +2668,8 @@ js::TypedObjectTypeDescr(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypedObjectTypeDescrJitInfo,
|
||||
TypedObjectTypeDescrJitInfo,
|
||||
js::TypedObjectTypeDescr);
|
||||
|
||||
bool
|
||||
js::ClampToUint8(ThreadSafeContext *, unsigned argc, Value *vp)
|
||||
js::ClampToUint8(JSContext *, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
MOZ_ASSERT(args.length() == 1);
|
||||
|
@ -2729,9 +2678,6 @@ js::ClampToUint8(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ClampToUint8JitInfo, ClampToUint8JitInfo,
|
||||
js::ClampToUint8);
|
||||
|
||||
bool
|
||||
js::GetTypedObjectModule(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
|
@ -2764,7 +2710,7 @@ js::GetInt32x4TypeDescr(JSContext *cx, unsigned argc, Value *vp)
|
|||
|
||||
#define JS_STORE_SCALAR_CLASS_IMPL(_constant, T, _name) \
|
||||
bool \
|
||||
js::StoreScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp) \
|
||||
js::StoreScalar##T::Func(JSContext *, unsigned argc, Value *vp) \
|
||||
{ \
|
||||
CallArgs args = CallArgsFromVp(argc, vp); \
|
||||
MOZ_ASSERT(args.length() == 3); \
|
||||
|
@ -2783,15 +2729,11 @@ js::StoreScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
*target = ConvertScalar<T>(d); \
|
||||
args.rval().setUndefined(); \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::StoreScalar##T::JitInfo, \
|
||||
StoreScalar##T, \
|
||||
js::StoreScalar##T::Func);
|
||||
}
|
||||
|
||||
#define JS_STORE_REFERENCE_CLASS_IMPL(_constant, T, _name) \
|
||||
bool \
|
||||
js::StoreReference##T::Func(ThreadSafeContext *cx, unsigned argc, Value *vp) \
|
||||
js::StoreReference##T::Func(JSContext *cx, unsigned argc, Value *vp) \
|
||||
{ \
|
||||
CallArgs args = CallArgsFromVp(argc, vp); \
|
||||
MOZ_ASSERT(args.length() == 4); \
|
||||
|
@ -2814,15 +2756,11 @@ js::StoreReference##T::Func(ThreadSafeContext *cx, unsigned argc, Value *vp)
|
|||
return false; \
|
||||
args.rval().setUndefined(); \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::StoreReference##T::JitInfo, \
|
||||
StoreReference##T, \
|
||||
js::StoreReference##T::Func);
|
||||
}
|
||||
|
||||
#define JS_LOAD_SCALAR_CLASS_IMPL(_constant, T, _name) \
|
||||
bool \
|
||||
js::LoadScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp) \
|
||||
js::LoadScalar##T::Func(JSContext *, unsigned argc, Value *vp) \
|
||||
{ \
|
||||
CallArgs args = CallArgsFromVp(argc, vp); \
|
||||
MOZ_ASSERT(args.length() == 2); \
|
||||
|
@ -2838,14 +2776,11 @@ js::LoadScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
T *target = reinterpret_cast<T*>(typedObj.typedMem(offset)); \
|
||||
args.rval().setNumber((double) *target); \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::LoadScalar##T::JitInfo, LoadScalar##T, \
|
||||
js::LoadScalar##T::Func);
|
||||
}
|
||||
|
||||
#define JS_LOAD_REFERENCE_CLASS_IMPL(_constant, T, _name) \
|
||||
bool \
|
||||
js::LoadReference##T::Func(ThreadSafeContext *, unsigned argc, Value *vp) \
|
||||
js::LoadReference##T::Func(JSContext *, unsigned argc, Value *vp) \
|
||||
{ \
|
||||
CallArgs args = CallArgsFromVp(argc, vp); \
|
||||
MOZ_ASSERT(args.length() == 2); \
|
||||
|
@ -2861,18 +2796,14 @@ js::LoadReference##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)
|
|||
T *target = reinterpret_cast<T*>(typedObj.typedMem(offset)); \
|
||||
load(target, args.rval()); \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::LoadReference##T::JitInfo, \
|
||||
LoadReference##T, \
|
||||
js::LoadReference##T::Func);
|
||||
}
|
||||
|
||||
// Because the precise syntax for storing values/objects/strings
|
||||
// differs, we abstract it away using specialized variants of the
|
||||
// private methods `store()` and `load()`.
|
||||
|
||||
bool
|
||||
StoreReferenceHeapValue::store(ThreadSafeContext *cx, HeapValue *heap, const Value &v,
|
||||
StoreReferenceHeapValue::store(JSContext *cx, HeapValue *heap, const Value &v,
|
||||
TypedObject *obj, jsid id)
|
||||
{
|
||||
// Undefined values are not included in type inference information for
|
||||
|
@ -2890,7 +2821,7 @@ StoreReferenceHeapValue::store(ThreadSafeContext *cx, HeapValue *heap, const Val
|
|||
}
|
||||
|
||||
bool
|
||||
StoreReferenceHeapPtrObject::store(ThreadSafeContext *cx, HeapPtrObject *heap, const Value &v,
|
||||
StoreReferenceHeapPtrObject::store(JSContext *cx, HeapPtrObject *heap, const Value &v,
|
||||
TypedObject *obj, jsid id)
|
||||
{
|
||||
MOZ_ASSERT(v.isObjectOrNull()); // or else Store_object is being misused
|
||||
|
@ -2910,7 +2841,7 @@ StoreReferenceHeapPtrObject::store(ThreadSafeContext *cx, HeapPtrObject *heap, c
|
|||
}
|
||||
|
||||
bool
|
||||
StoreReferenceHeapPtrString::store(ThreadSafeContext *cx, HeapPtrString *heap, const Value &v,
|
||||
StoreReferenceHeapPtrString::store(JSContext *cx, HeapPtrString *heap, const Value &v,
|
||||
TypedObject *obj, jsid id)
|
||||
{
|
||||
MOZ_ASSERT(v.isString()); // or else Store_string is being misused
|
||||
|
|
|
@ -795,8 +795,7 @@ bool NewDerivedTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
|||
* Moves `typedObj` to point at the memory referenced by `newDatum` with
|
||||
* the offset `newOffset`.
|
||||
*/
|
||||
bool AttachTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo AttachTypedObjectJitInfo;
|
||||
bool AttachTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: SetTypedObjectOffset(typedObj, offset)
|
||||
|
@ -804,49 +803,41 @@ extern const JSJitInfo AttachTypedObjectJitInfo;
|
|||
* Changes the offset for `typedObj` within its buffer to `offset`.
|
||||
* `typedObj` must already be attached.
|
||||
*/
|
||||
bool intrinsic_SetTypedObjectOffset(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool SetTypedObjectOffset(ThreadSafeContext *, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo intrinsic_SetTypedObjectOffsetJitInfo;
|
||||
bool SetTypedObjectOffset(JSContext *, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: ObjectIsTypeDescr(obj)
|
||||
*
|
||||
* True if `obj` is a type object.
|
||||
*/
|
||||
bool ObjectIsTypeDescr(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo ObjectIsTypeDescrJitInfo;
|
||||
bool ObjectIsTypeDescr(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: ObjectIsTypedObject(obj)
|
||||
*
|
||||
* True if `obj` is a transparent or opaque typed object.
|
||||
*/
|
||||
bool ObjectIsTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo ObjectIsTypedObjectJitInfo;
|
||||
bool ObjectIsTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: ObjectIsOpaqueTypedObject(obj)
|
||||
*
|
||||
* True if `obj` is an opaque typed object.
|
||||
*/
|
||||
bool ObjectIsOpaqueTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo ObjectIsOpaqueTypedObjectJitInfo;
|
||||
bool ObjectIsOpaqueTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: ObjectIsTransparentTypedObject(obj)
|
||||
*
|
||||
* True if `obj` is a transparent typed object.
|
||||
*/
|
||||
bool ObjectIsTransparentTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo ObjectIsTransparentTypedObjectJitInfo;
|
||||
bool ObjectIsTransparentTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/* Predicates on type descriptor objects. In all cases, 'obj' must be a type descriptor. */
|
||||
|
||||
bool TypeDescrIsSimpleType(ThreadSafeContext *, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo TypeDescrIsSimpleTypeJitInfo;
|
||||
bool TypeDescrIsSimpleType(JSContext *, unsigned argc, Value *vp);
|
||||
|
||||
bool TypeDescrIsArrayType(ThreadSafeContext *, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo TypeDescrIsArrayTypeJitInfo;
|
||||
bool TypeDescrIsArrayType(JSContext *, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: TypedObjectIsAttached(obj)
|
||||
|
@ -854,24 +845,21 @@ extern const JSJitInfo TypeDescrIsArrayTypeJitInfo;
|
|||
* Given a TypedObject `obj`, returns true if `obj` is
|
||||
* "attached" (i.e., its data pointer is nullptr).
|
||||
*/
|
||||
bool TypedObjectIsAttached(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo TypedObjectIsAttachedJitInfo;
|
||||
bool TypedObjectIsAttached(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: TypedObjectTypeDescr(obj)
|
||||
*
|
||||
* Given a TypedObject `obj`, returns the object's type descriptor.
|
||||
*/
|
||||
bool TypedObjectTypeDescr(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo TypedObjectTypeDescrJitInfo;
|
||||
bool TypedObjectTypeDescr(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: ClampToUint8(v)
|
||||
*
|
||||
* Same as the C function ClampDoubleToUint8. `v` must be a number.
|
||||
*/
|
||||
bool ClampToUint8(ThreadSafeContext *cx, unsigned argc, Value *vp);
|
||||
extern const JSJitInfo ClampToUint8JitInfo;
|
||||
bool ClampToUint8(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
/*
|
||||
* Usage: GetTypedObjectModule()
|
||||
|
@ -919,7 +907,7 @@ bool GetInt32x4TypeDescr(JSContext *cx, unsigned argc, Value *vp);
|
|||
#define JS_STORE_SCALAR_CLASS_DEFN(_constant, T, _name) \
|
||||
class StoreScalar##T { \
|
||||
public: \
|
||||
static bool Func(ThreadSafeContext *cx, unsigned argc, Value *vp); \
|
||||
static bool Func(JSContext *cx, unsigned argc, Value *vp); \
|
||||
static const JSJitInfo JitInfo; \
|
||||
};
|
||||
|
||||
|
@ -939,11 +927,11 @@ class StoreScalar##T { \
|
|||
#define JS_STORE_REFERENCE_CLASS_DEFN(_constant, T, _name) \
|
||||
class StoreReference##T { \
|
||||
private: \
|
||||
static bool store(ThreadSafeContext *cx, T* heap, const Value &v, \
|
||||
static bool store(JSContext *cx, T* heap, const Value &v, \
|
||||
TypedObject *obj, jsid id); \
|
||||
\
|
||||
public: \
|
||||
static bool Func(ThreadSafeContext *cx, unsigned argc, Value *vp); \
|
||||
static bool Func(JSContext *cx, unsigned argc, Value *vp); \
|
||||
static const JSJitInfo JitInfo; \
|
||||
};
|
||||
|
||||
|
@ -958,7 +946,7 @@ class StoreReference##T { \
|
|||
#define JS_LOAD_SCALAR_CLASS_DEFN(_constant, T, _name) \
|
||||
class LoadScalar##T { \
|
||||
public: \
|
||||
static bool Func(ThreadSafeContext *cx, unsigned argc, Value *vp); \
|
||||
static bool Func(JSContext *cx, unsigned argc, Value *vp); \
|
||||
static const JSJitInfo JitInfo; \
|
||||
};
|
||||
|
||||
|
@ -976,7 +964,7 @@ class LoadReference##T { \
|
|||
static void load(T* heap, MutableHandleValue v); \
|
||||
\
|
||||
public: \
|
||||
static bool Func(ThreadSafeContext *cx, unsigned argc, Value *vp); \
|
||||
static bool Func(JSContext *cx, unsigned argc, Value *vp); \
|
||||
static const JSJitInfo JitInfo; \
|
||||
};
|
||||
|
||||
|
|
|
@ -208,28 +208,28 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSFunction *target)
|
|||
return inlineTypedArrayLength(callInfo);
|
||||
|
||||
// TypedObject intrinsics.
|
||||
if (native == intrinsic_ObjectIsTypedObject)
|
||||
if (native == js::ObjectIsTypedObject)
|
||||
return inlineHasClass(callInfo,
|
||||
&OutlineTransparentTypedObject::class_,
|
||||
&OutlineOpaqueTypedObject::class_,
|
||||
&InlineTransparentTypedObject::class_,
|
||||
&InlineOpaqueTypedObject::class_);
|
||||
if (native == intrinsic_ObjectIsTransparentTypedObject)
|
||||
if (native == js::ObjectIsTransparentTypedObject)
|
||||
return inlineHasClass(callInfo,
|
||||
&OutlineTransparentTypedObject::class_,
|
||||
&InlineTransparentTypedObject::class_);
|
||||
if (native == intrinsic_ObjectIsOpaqueTypedObject)
|
||||
if (native == js::ObjectIsOpaqueTypedObject)
|
||||
return inlineHasClass(callInfo,
|
||||
&OutlineOpaqueTypedObject::class_,
|
||||
&InlineOpaqueTypedObject::class_);
|
||||
if (native == intrinsic_ObjectIsTypeDescr)
|
||||
if (native == js::ObjectIsTypeDescr)
|
||||
return inlineObjectIsTypeDescr(callInfo);
|
||||
if (native == intrinsic_TypeDescrIsSimpleType)
|
||||
if (native == js::TypeDescrIsSimpleType)
|
||||
return inlineHasClass(callInfo,
|
||||
&ScalarTypeDescr::class_, &ReferenceTypeDescr::class_);
|
||||
if (native == intrinsic_TypeDescrIsArrayType)
|
||||
if (native == js::TypeDescrIsArrayType)
|
||||
return inlineHasClass(callInfo, &ArrayTypeDescr::class_);
|
||||
if (native == intrinsic_SetTypedObjectOffset)
|
||||
if (native == js::SetTypedObjectOffset)
|
||||
return inlineSetTypedObjectOffset(callInfo);
|
||||
|
||||
// Testing Functions
|
||||
|
|
|
@ -955,18 +955,6 @@ bool intrinsic_UnsafeGetStringFromReservedSlot(JSContext *cx, unsigned argc, Val
|
|||
bool intrinsic_UnsafeGetBooleanFromReservedSlot(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);
|
||||
bool intrinsic_ForkJoinGetSlice(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_InParallelSection(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
bool intrinsic_ObjectIsTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_ObjectIsTransparentTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_ObjectIsOpaqueTypedObject(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_ObjectIsTypeDescr(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_TypeDescrIsSimpleType(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_TypeDescrIsArrayType(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
bool intrinsic_IsSuspendedStarGenerator(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_IsArrayIterator(JSContext *cx, unsigned argc, Value *vp);
|
||||
bool intrinsic_IsStringIterator(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
|
|
@ -780,46 +780,6 @@ intrinsic_IsWeakSet(JSContext *cx, unsigned argc, Value *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* These wrappers are needed in order to recognize the function
|
||||
* pointers within the JIT, and the raw js:: functions can't be used
|
||||
* directly because they take a ThreadSafeContext* argument.
|
||||
*/
|
||||
bool
|
||||
js::intrinsic_ObjectIsTypedObject(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::ObjectIsTypedObject(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_ObjectIsTransparentTypedObject(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::ObjectIsTransparentTypedObject(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_ObjectIsOpaqueTypedObject(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::ObjectIsOpaqueTypedObject(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_ObjectIsTypeDescr(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::ObjectIsTypeDescr(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_TypeDescrIsSimpleType(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::TypeDescrIsSimpleType(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::intrinsic_TypeDescrIsArrayType(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
return js::TypeDescrIsArrayType(cx, argc, vp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default locale as a well-formed, but not necessarily canonicalized,
|
||||
* BCP-47 language tag.
|
||||
|
@ -993,72 +953,36 @@ static const JSFunctionSpec intrinsic_functions[] = {
|
|||
JS_FN("NewDenseArray", intrinsic_NewDenseArray, 1,0),
|
||||
|
||||
// See builtin/TypedObject.h for descriptors of the typedobj functions.
|
||||
JS_FN("NewOpaqueTypedObject",
|
||||
js::NewOpaqueTypedObject,
|
||||
1, 0),
|
||||
JS_FN("NewDerivedTypedObject",
|
||||
js::NewDerivedTypedObject,
|
||||
3, 0),
|
||||
JS_FN("TypedObjectBuffer",
|
||||
TypedObject::GetBuffer,
|
||||
1, 0),
|
||||
JS_FN("TypedObjectByteOffset",
|
||||
TypedObject::GetByteOffset,
|
||||
1, 0),
|
||||
JS_FNINFO("AttachTypedObject",
|
||||
JSNativeThreadSafeWrapper<js::AttachTypedObject>,
|
||||
&js::AttachTypedObjectJitInfo, 3, 0),
|
||||
JS_FNINFO("SetTypedObjectOffset",
|
||||
intrinsic_SetTypedObjectOffset,
|
||||
&js::intrinsic_SetTypedObjectOffsetJitInfo, 2, 0),
|
||||
JS_FNINFO("ObjectIsTypeDescr",
|
||||
intrinsic_ObjectIsTypeDescr,
|
||||
&js::ObjectIsTypeDescrJitInfo, 1, 0),
|
||||
JS_FNINFO("ObjectIsTypedObject",
|
||||
intrinsic_ObjectIsTypedObject,
|
||||
&js::ObjectIsTypedObjectJitInfo, 1, 0),
|
||||
JS_FNINFO("ObjectIsTransparentTypedObject",
|
||||
intrinsic_ObjectIsTransparentTypedObject,
|
||||
&js::ObjectIsTransparentTypedObjectJitInfo, 1, 0),
|
||||
JS_FNINFO("TypedObjectIsAttached",
|
||||
JSNativeThreadSafeWrapper<js::TypedObjectIsAttached>,
|
||||
&js::TypedObjectIsAttachedJitInfo, 1, 0),
|
||||
JS_FNINFO("TypedObjectTypeDescr",
|
||||
JSNativeThreadSafeWrapper<js::TypedObjectTypeDescr>,
|
||||
&js::TypedObjectTypeDescrJitInfo, 1, 0),
|
||||
JS_FNINFO("ObjectIsOpaqueTypedObject",
|
||||
intrinsic_ObjectIsOpaqueTypedObject,
|
||||
&js::ObjectIsOpaqueTypedObjectJitInfo, 1, 0),
|
||||
JS_FNINFO("TypeDescrIsArrayType",
|
||||
intrinsic_TypeDescrIsArrayType,
|
||||
&js::TypeDescrIsArrayTypeJitInfo, 1, 0),
|
||||
JS_FNINFO("TypeDescrIsSimpleType",
|
||||
intrinsic_TypeDescrIsSimpleType,
|
||||
&js::TypeDescrIsSimpleTypeJitInfo, 1, 0),
|
||||
JS_FNINFO("ClampToUint8",
|
||||
JSNativeThreadSafeWrapper<js::ClampToUint8>,
|
||||
&js::ClampToUint8JitInfo, 1, 0),
|
||||
JS_FN("GetTypedObjectModule", js::GetTypedObjectModule, 0, 0),
|
||||
JS_FN("GetFloat32x4TypeDescr", js::GetFloat32x4TypeDescr, 0, 0),
|
||||
JS_FN("GetInt32x4TypeDescr", js::GetInt32x4TypeDescr, 0, 0),
|
||||
JS_FN("NewOpaqueTypedObject", js::NewOpaqueTypedObject, 1, 0),
|
||||
JS_FN("NewDerivedTypedObject", js::NewDerivedTypedObject, 3, 0),
|
||||
JS_FN("TypedObjectBuffer", TypedObject::GetBuffer, 1, 0),
|
||||
JS_FN("TypedObjectByteOffset", TypedObject::GetByteOffset, 1, 0),
|
||||
JS_FN("AttachTypedObject", js::AttachTypedObject, 3, 0),
|
||||
JS_FN("SetTypedObjectOffset", js::SetTypedObjectOffset, 2, 0),
|
||||
JS_FN("ObjectIsTypeDescr" , js::ObjectIsTypeDescr, 1, 0),
|
||||
JS_FN("ObjectIsTypedObject", js::ObjectIsTypedObject, 1, 0),
|
||||
JS_FN("ObjectIsTransparentTypedObject", js::ObjectIsTransparentTypedObject, 1, 0),
|
||||
JS_FN("TypedObjectIsAttached", js::TypedObjectIsAttached, 1, 0),
|
||||
JS_FN("TypedObjectTypeDescr", js::TypedObjectTypeDescr, 1, 0),
|
||||
JS_FN("ObjectIsOpaqueTypedObject", js::ObjectIsOpaqueTypedObject, 1, 0),
|
||||
JS_FN("TypeDescrIsArrayType", js::TypeDescrIsArrayType, 1, 0),
|
||||
JS_FN("TypeDescrIsSimpleType", js::TypeDescrIsSimpleType, 1, 0),
|
||||
JS_FN("ClampToUint8", js::ClampToUint8, 1, 0),
|
||||
JS_FN("GetTypedObjectModule", js::GetTypedObjectModule, 0, 0),
|
||||
JS_FN("GetFloat32x4TypeDescr", js::GetFloat32x4TypeDescr, 0, 0),
|
||||
JS_FN("GetInt32x4TypeDescr", js::GetInt32x4TypeDescr, 0, 0),
|
||||
|
||||
#define LOAD_AND_STORE_SCALAR_FN_DECLS(_constant, _type, _name) \
|
||||
JS_FNINFO("Store_" #_name, \
|
||||
JSNativeThreadSafeWrapper<js::StoreScalar##_type::Func>, \
|
||||
&js::StoreScalar##_type::JitInfo, 3, 0), \
|
||||
JS_FNINFO("Load_" #_name, \
|
||||
JSNativeThreadSafeWrapper<js::LoadScalar##_type::Func>, \
|
||||
&js::LoadScalar##_type::JitInfo, 3, 0),
|
||||
#define LOAD_AND_STORE_SCALAR_FN_DECLS(_constant, _type, _name) \
|
||||
JS_FN("Store_" #_name, js::StoreScalar##_type::Func, 3, 0), \
|
||||
JS_FN("Load_" #_name, js::LoadScalar##_type::Func, 3, 0),
|
||||
JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(LOAD_AND_STORE_SCALAR_FN_DECLS)
|
||||
#undef LOAD_AND_STORE_SCALAR_FN_DECLS
|
||||
|
||||
#define LOAD_AND_STORE_REFERENCE_FN_DECLS(_constant, _type, _name) \
|
||||
JS_FNINFO("Store_" #_name, \
|
||||
JSNativeThreadSafeWrapper<js::StoreReference##_type::Func>, \
|
||||
&js::StoreReference##_type::JitInfo, 3, 0), \
|
||||
JS_FNINFO("Load_" #_name, \
|
||||
JSNativeThreadSafeWrapper<js::LoadReference##_type::Func>, \
|
||||
&js::LoadReference##_type::JitInfo, 3, 0),
|
||||
#define LOAD_AND_STORE_REFERENCE_FN_DECLS(_constant, _type, _name) \
|
||||
JS_FN("Store_" #_name, js::StoreReference##_type::Func, 3, 0), \
|
||||
JS_FN("Load_" #_name, js::LoadReference##_type::Func, 3, 0),
|
||||
JS_FOR_EACH_REFERENCE_TYPE_REPR(LOAD_AND_STORE_REFERENCE_FN_DECLS)
|
||||
#undef LOAD_AND_STORE_REFERENCE_FN_DECLS
|
||||
|
||||
// See builtin/Intl.h for descriptions of the intl_* functions.
|
||||
JS_FN("intl_availableCalendars", intl_availableCalendars, 1,0),
|
||||
|
|
Загрузка…
Ссылка в новой задаче