Bug 1111159. Inline the IsArrayIterator and IsStringIterator intrinsics in Ion code to speed up for-of loops. r=jandem,waldo

This commit is contained in:
Boris Zbarsky 2014-12-13 22:05:46 -05:00
parent aa1fdd5e65
commit a3cef658dd
3 changed files with 10 additions and 4 deletions

View File

@ -199,6 +199,10 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSFunction *target)
return inlineIsConstructing(callInfo);
if (native == intrinsic_SubstringKernel)
return inlineSubstringKernel(callInfo);
if (native == intrinsic_IsArrayIterator)
return inlineHasClass(callInfo, &ArrayIteratorObject::class_);
if (native == intrinsic_IsStringIterator)
return inlineHasClass(callInfo, &StringIteratorObject::class_);
// TypedObject intrinsics.
if (native == intrinsic_ObjectIsTypedObject)

View File

@ -979,6 +979,8 @@ 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);
class AutoLockForExclusiveAccess
{

View File

@ -648,8 +648,8 @@ intrinsic_NewArrayIterator(JSContext *cx, unsigned argc, Value *vp)
return true;
}
static bool
intrinsic_IsArrayIterator(JSContext *cx, unsigned argc, Value *vp)
bool
js::intrinsic_IsArrayIterator(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 1);
@ -677,8 +677,8 @@ intrinsic_NewStringIterator(JSContext *cx, unsigned argc, Value *vp)
return true;
}
static bool
intrinsic_IsStringIterator(JSContext *cx, unsigned argc, Value *vp)
bool
js::intrinsic_IsStringIterator(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 1);