|
@@ -14897,14 +14897,14 @@ Lowerer::GenerateFastStringLdElem(IR::Instr * ldElem, IR::LabelInstr * labelHelp
|
|
|
{
|
|
{
|
|
|
// Just use the offset to indirect into the string buffer
|
|
// Just use the offset to indirect into the string buffer
|
|
|
charIndirOpnd = IR::IndirOpnd::New(bufferOpnd, indirOpnd->GetOffset() * sizeof(wchar_t), TyUint16, this->m_func);
|
|
charIndirOpnd = IR::IndirOpnd::New(bufferOpnd, indirOpnd->GetOffset() * sizeof(wchar_t), TyUint16, this->m_func);
|
|
|
- index32CmpOpnd = IR::IntConstOpnd::New(indirOpnd->GetOffset(), TyUint32, this->m_func);
|
|
|
|
|
|
|
+ index32CmpOpnd = IR::IntConstOpnd::New((uint32)indirOpnd->GetOffset(), TyUint32, this->m_func);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Check if the index is in range of the string length
|
|
// Check if the index is in range of the string length
|
|
|
// CMP [baseOpnd + offset(length)], indexOpnd -- string length
|
|
// CMP [baseOpnd + offset(length)], indexOpnd -- string length
|
|
|
// JBE $helper -- unsigned compare, and string length are at most INT_MAX - 1
|
|
// JBE $helper -- unsigned compare, and string length are at most INT_MAX - 1
|
|
|
// -- so that even if we have a negative index, this will fail
|
|
// -- so that even if we have a negative index, this will fail
|
|
|
- InsertCompareBranch(IR::IndirOpnd::New(baseOpnd, offsetof(Js::JavascriptString, m_charLength), TyInt32, this->m_func)
|
|
|
|
|
|
|
+ InsertCompareBranch(IR::IndirOpnd::New(baseOpnd, offsetof(Js::JavascriptString, m_charLength), TyUint32, this->m_func)
|
|
|
, index32CmpOpnd, Js::OpCode::BrLe_A, true, labelHelper, ldElem);
|
|
, index32CmpOpnd, Js::OpCode::BrLe_A, true, labelHelper, ldElem);
|
|
|
|
|
|
|
|
// Load the string buffer and make sure it is not null
|
|
// Load the string buffer and make sure it is not null
|
|
@@ -14920,7 +14920,7 @@ Lowerer::GenerateFastStringLdElem(IR::Instr * ldElem, IR::LabelInstr * labelHelp
|
|
|
// MOV charOpnd, [bufferOpnd + index32Opnd]
|
|
// MOV charOpnd, [bufferOpnd + index32Opnd]
|
|
|
// CMP charOpnd, 0x80
|
|
// CMP charOpnd, 0x80
|
|
|
// JAE $helper
|
|
// JAE $helper
|
|
|
- IR::RegOpnd * charOpnd = IR::RegOpnd::New(TyInt32, this->m_func);
|
|
|
|
|
|
|
+ IR::RegOpnd * charOpnd = IR::RegOpnd::New(TyUint32, this->m_func);
|
|
|
const IR::AutoReuseOpnd autoReuseCharOpnd(charOpnd, m_func);
|
|
const IR::AutoReuseOpnd autoReuseCharOpnd(charOpnd, m_func);
|
|
|
InsertMove(charOpnd, charIndirOpnd, ldElem);
|
|
InsertMove(charOpnd, charIndirOpnd, ldElem);
|
|
|
InsertCompareBranch(charOpnd, IR::IntConstOpnd::New(Js::CharStringCache::CharStringCacheSize, TyUint16, this->m_func),
|
|
InsertCompareBranch(charOpnd, IR::IntConstOpnd::New(Js::CharStringCache::CharStringCacheSize, TyUint16, this->m_func),
|