IC polymorphic optimization

Signed-off-by: DaiHN <daihuina1@huawei.com>
This commit is contained in:
DaiHN 2021-10-29 14:57:33 +08:00
parent 0a44a3ea85
commit 9ddc634ceb

View File

@ -2502,6 +2502,7 @@ NO_UB_SANITIZE void EcmaInterpreter::RunInternal(JSThread *thread, ConstantPool
JSTaggedValue secondValue = profileTypeArray->Get(slotId + 1);
res = ICRuntimeStub::TryLoadICByValue(thread, receiver, propKey, firstValue, secondValue);
}
// IC miss and not enter the megamorphic state, store as polymorphic
if (res.IsHole() && !firstValue.IsHole()) {
res = ICRuntimeStub::LoadICByValue(thread,
profileTypeArray,
@ -2554,6 +2555,7 @@ NO_UB_SANITIZE void EcmaInterpreter::RunInternal(JSThread *thread, ConstantPool
JSTaggedValue secondValue = profileTypeArray->Get(slotId + 1);
res = ICRuntimeStub::TryStoreICByValue(thread, receiver, propKey, firstValue, secondValue, value);
}
// IC miss and not enter the megamorphic state, store as polymorphic
if (res.IsHole() && !firstValue.IsHole()) {
res = ICRuntimeStub::StoreICByValue(thread,
profileTypeArray,
@ -2867,6 +2869,7 @@ NO_UB_SANITIZE void EcmaInterpreter::RunInternal(JSThread *thread, ConstantPool
JSTaggedValue secondValue = profileTypeArray->Get(slotId + 1);
res = ICRuntimeStub::TryLoadICByName(thread, receiver, firstValue, secondValue);
}
// IC miss and not enter the megamorphic state, store as polymorphic
if (res.IsHole() && !firstValue.IsHole()) {
uint32_t stringId = READ_INST_32_1();
JSTaggedValue propKey = constpool->GetObjectFromCache(stringId);
@ -2922,6 +2925,7 @@ NO_UB_SANITIZE void EcmaInterpreter::RunInternal(JSThread *thread, ConstantPool
JSTaggedValue secondValue = profileTypeArray->Get(slotId + 1);
res = ICRuntimeStub::TryStoreICByName(thread, receiver, firstValue, secondValue, value);
}
// IC miss and not enter the megamorphic state, store as polymorphic
if (res.IsHole() && !firstValue.IsHole()) {
uint32_t stringId = READ_INST_32_1();
JSTaggedValue propKey = constpool->GetObjectFromCache(stringId);