Loading js/src/jit/BaselineCacheIR.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,11 @@ BaselineCacheIRCompiler::compile() bool BaselineCacheIRCompiler::emitGuardIsInt32() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_INT32) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); AutoScratchRegister scratch(allocator, masm); FailurePath* failure; Loading Loading @@ -233,9 +237,14 @@ BaselineCacheIRCompiler::emitGuardIsInt32() bool BaselineCacheIRCompiler::emitGuardType() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); JSValueType type = reader.valueType(); if (allocator.knownType(inputId) == type) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading js/src/jit/CacheIRCompiler.cpp +36 −3 Original line number Diff line number Diff line Loading @@ -292,6 +292,27 @@ CacheRegisterAllocator::init(const AllocatableGeneralRegisterSet& available) return true; } JSValueType CacheRegisterAllocator::knownType(ValOperandId val) const { const OperandLocation& loc = operandLocations_[val.id()]; switch (loc.kind()) { case OperandLocation::ValueReg: case OperandLocation::ValueStack: return JSVAL_TYPE_UNKNOWN; case OperandLocation::PayloadStack: case OperandLocation::PayloadReg: return loc.payloadType(); case OperandLocation::Uninitialized: break; } MOZ_CRASH("Invalid kind"); } size_t CacheIRStubInfo::stubDataSize() const { Loading Loading @@ -654,7 +675,11 @@ CacheIRCompiler::emitFailurePath(size_t i) bool CacheIRCompiler::emitGuardIsObject() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_OBJECT) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading @@ -665,7 +690,11 @@ CacheIRCompiler::emitGuardIsObject() bool CacheIRCompiler::emitGuardIsString() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_STRING) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading @@ -676,7 +705,11 @@ CacheIRCompiler::emitGuardIsString() bool CacheIRCompiler::emitGuardIsSymbol() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_SYMBOL) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading js/src/jit/CacheIRCompiler.h +3 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,9 @@ class MOZ_RAII CacheRegisterAllocator // Allocates an output register for the given operand. Register defineRegister(MacroAssembler& masm, TypedOperandId typedId); ValueOperand defineValueRegister(MacroAssembler& masm, ValOperandId val); // Returns |val|'s JSValueType or JSVAL_TYPE_UNKNOWN. JSValueType knownType(ValOperandId val) const; }; // RAII class to allocate a scratch register and release it when we're done Loading Loading
js/src/jit/BaselineCacheIR.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,11 @@ BaselineCacheIRCompiler::compile() bool BaselineCacheIRCompiler::emitGuardIsInt32() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_INT32) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); AutoScratchRegister scratch(allocator, masm); FailurePath* failure; Loading Loading @@ -233,9 +237,14 @@ BaselineCacheIRCompiler::emitGuardIsInt32() bool BaselineCacheIRCompiler::emitGuardType() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); JSValueType type = reader.valueType(); if (allocator.knownType(inputId) == type) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading
js/src/jit/CacheIRCompiler.cpp +36 −3 Original line number Diff line number Diff line Loading @@ -292,6 +292,27 @@ CacheRegisterAllocator::init(const AllocatableGeneralRegisterSet& available) return true; } JSValueType CacheRegisterAllocator::knownType(ValOperandId val) const { const OperandLocation& loc = operandLocations_[val.id()]; switch (loc.kind()) { case OperandLocation::ValueReg: case OperandLocation::ValueStack: return JSVAL_TYPE_UNKNOWN; case OperandLocation::PayloadStack: case OperandLocation::PayloadReg: return loc.payloadType(); case OperandLocation::Uninitialized: break; } MOZ_CRASH("Invalid kind"); } size_t CacheIRStubInfo::stubDataSize() const { Loading Loading @@ -654,7 +675,11 @@ CacheIRCompiler::emitFailurePath(size_t i) bool CacheIRCompiler::emitGuardIsObject() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_OBJECT) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading @@ -665,7 +690,11 @@ CacheIRCompiler::emitGuardIsObject() bool CacheIRCompiler::emitGuardIsString() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_STRING) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading @@ -676,7 +705,11 @@ CacheIRCompiler::emitGuardIsString() bool CacheIRCompiler::emitGuardIsSymbol() { ValueOperand input = allocator.useValueRegister(masm, reader.valOperandId()); ValOperandId inputId = reader.valOperandId(); if (allocator.knownType(inputId) == JSVAL_TYPE_SYMBOL) return true; ValueOperand input = allocator.useValueRegister(masm, inputId); FailurePath* failure; if (!addFailurePath(&failure)) return false; Loading
js/src/jit/CacheIRCompiler.h +3 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,9 @@ class MOZ_RAII CacheRegisterAllocator // Allocates an output register for the given operand. Register defineRegister(MacroAssembler& masm, TypedOperandId typedId); ValueOperand defineValueRegister(MacroAssembler& masm, ValOperandId val); // Returns |val|'s JSValueType or JSVAL_TYPE_UNKNOWN. JSValueType knownType(ValOperandId val) const; }; // RAII class to allocate a scratch register and release it when we're done Loading