bool BaselineInspector::hasSeenNegativeIndexGetElement(jsbytecode *pc) { if (!hasBaselineScript()) return false; const ICEntry &entry = icEntryFromPC(pc); ICStub *stub = entry.fallbackStub(); if (stub->isGetElem_Fallback()) return stub->toGetElem_Fallback()->hasNegativeIndex(); return false; }
MIRType BaselineInspector::expectedPropertyAccessInputType(jsbytecode* pc) { if (!hasBaselineScript()) return MIRType::Value; const ICEntry& entry = icEntryFromPC(pc); MIRType type = MIRType::None; for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) { MIRType stubType; switch (stub->kind()) { case ICStub::GetProp_Fallback: if (stub->toGetProp_Fallback()->hadUnoptimizableAccess()) return MIRType::Value; continue; case ICStub::GetElem_Fallback: if (stub->toGetElem_Fallback()->hadUnoptimizableAccess()) return MIRType::Value; continue; case ICStub::CacheIR_Monitored: stubType = GetCacheIRExpectedInputType(stub->toCacheIR_Monitored()); if (stubType == MIRType::Value) return MIRType::Value; break; default: MOZ_CRASH("Unexpected stub"); } if (type != MIRType::None) { if (type != stubType) return MIRType::Value; } else { type = stubType; } } return (type == MIRType::None) ? MIRType::Value : type; }
MIRType BaselineInspector::expectedPropertyAccessInputType(jsbytecode* pc) { if (!hasBaselineScript()) return MIRType_Value; const ICEntry& entry = icEntryFromPC(pc); MIRType type = MIRType_None; for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) { MIRType stubType; switch (stub->kind()) { case ICStub::GetProp_Fallback: if (stub->toGetProp_Fallback()->hadUnoptimizableAccess()) return MIRType_Value; continue; case ICStub::GetElem_Fallback: if (stub->toGetElem_Fallback()->hadUnoptimizableAccess()) return MIRType_Value; continue; case ICStub::GetProp_Generic: return MIRType_Value; case ICStub::GetProp_ArgumentsLength: case ICStub::GetElem_Arguments: // Either an object or magic arguments. return MIRType_Value; case ICStub::GetProp_ArrayLength: case ICStub::GetProp_UnboxedArrayLength: case ICStub::GetProp_Native: case ICStub::GetProp_NativeDoesNotExist: case ICStub::GetProp_NativePrototype: case ICStub::GetProp_Unboxed: case ICStub::GetProp_TypedObject: case ICStub::GetProp_CallScripted: case ICStub::GetProp_CallNative: case ICStub::GetProp_CallDOMProxyNative: case ICStub::GetProp_CallDOMProxyWithGenerationNative: case ICStub::GetProp_DOMProxyShadowed: case ICStub::GetElem_NativeSlot: case ICStub::GetElem_NativePrototypeSlot: case ICStub::GetElem_NativePrototypeCallNative: case ICStub::GetElem_NativePrototypeCallScripted: case ICStub::GetElem_String: case ICStub::GetElem_Dense: case ICStub::GetElem_TypedArray: case ICStub::GetElem_UnboxedArray: stubType = MIRType_Object; break; case ICStub::GetProp_Primitive: stubType = MIRTypeFromValueType(stub->toGetProp_Primitive()->primitiveType()); break; case ICStub::GetProp_StringLength: stubType = MIRType_String; break; default: MOZ_CRASH("Unexpected stub"); } if (type != MIRType_None) { if (type != stubType) return MIRType_Value; } else { type = stubType; } } return (type == MIRType_None) ? MIRType_Value : type; }