Bug 1383436 - Part 10: Use MToIntegerInt32 when inlining charAt and charCodeAt. r=jandem

This matches the spec better and relaxes the input argument constraints for both functions.

Differential Revision: https://phabricator.services.mozilla.com/D37293

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2019-10-22 09:37:38 +00:00
parent 0540825b30
commit 9549d17872

View File

@ -2153,7 +2153,7 @@ IonBuilder::InliningResult IonBuilder::inlineStrCharCodeAt(CallInfo& callInfo) {
callInfo.setImplicitlyUsedUnchecked();
MInstruction* index = MToNumberInt32::New(alloc(), callInfo.getArg(0));
MInstruction* index = MToIntegerInt32::New(alloc(), callInfo.getArg(0));
current->add(index);
MStringLength* length = MStringLength::New(alloc(), callInfo.thisArg());
@ -2282,7 +2282,7 @@ IonBuilder::InliningResult IonBuilder::inlineStrCharAt(CallInfo& callInfo) {
callInfo.setImplicitlyUsedUnchecked();
MInstruction* index = MToNumberInt32::New(alloc(), callInfo.getArg(0));
MInstruction* index = MToIntegerInt32::New(alloc(), callInfo.getArg(0));
current->add(index);
MStringLength* length = MStringLength::New(alloc(), callInfo.thisArg());