| Index: runtime/vm/intrinsifier_ia32.cc
|
| diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
|
| index fcc63aa6c0e9e5e499d4a43d2a6b16d3822abc53..56752140011fb118aec578678f373a657a686040 100644
|
| --- a/runtime/vm/intrinsifier_ia32.cc
|
| +++ b/runtime/vm/intrinsifier_ia32.cc
|
| @@ -538,22 +538,19 @@ bool Intrinsifier::Int8Array_setIndexed(Assembler* assembler) {
|
| // * EBX has the index into the array.
|
| // EBX contains the SMI index which is shifted by 1.
|
| __ SmiUntag(EBX);
|
| - // Move EBX into EDI.
|
| + // Free EBX for the value since we want a byte register.
|
| __ movl(EDI, EBX);
|
| - // Load the value into EBX.
|
| __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Value.
|
| - // If EBX is not an Smi, jump to fall through.
|
| __ testl(EBX, Immediate(kSmiTagMask));
|
| __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
|
| __ SmiUntag(EBX);
|
| - // Add 128 to EBX to bring it into 0..FF.
|
| + // Check that the value is a byte. Add 128 to EBX to bring it into
|
| + // the range 0..FF.
|
| __ addl(EBX, Immediate(128));
|
| __ cmpl(EBX, Immediate(0xFF));
|
| - // If EBX is too large an Int8, jump to fall through.
|
| __ j(ABOVE, &fall_through, Assembler::kNearJump);
|
| - // Remove addition.
|
| + // Undo addition.
|
| __ subl(EBX, Immediate(128));
|
| - // Store BL into array EAX[EDI] = BL.
|
| __ movb(FieldAddress(EAX, EDI, TIMES_1, Int8Array::data_offset()), BL);
|
| __ ret();
|
| __ Bind(&fall_through);
|
| @@ -585,18 +582,15 @@ bool Intrinsifier::Uint8Array_setIndexed(Assembler* assembler) {
|
| // * EBX has the index into the array.
|
| // EBX contains the SMI index which is shifted by 1.
|
| __ SmiUntag(EBX);
|
| - // Move EBX into EDI.
|
| + // Free EBX for the value since we want a byte register.
|
| __ movl(EDI, EBX);
|
| - // Load the value into EBX.
|
| __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Value.
|
| - // If EBX is not an Smi, jump to fall through.
|
| __ testl(EBX, Immediate(kSmiTagMask));
|
| __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
|
| __ SmiUntag(EBX);
|
| - // If EBX is too large an Uint8, jump to fall through.
|
| + // Check that the value is a byte.
|
| __ cmpl(EBX, Immediate(0xFF));
|
| __ j(ABOVE, &fall_through, Assembler::kNearJump);
|
| - // Store BL into array EAX[EDI] = BL.
|
| __ movb(FieldAddress(EAX, EDI, TIMES_1, Uint8Array::data_offset()), BL);
|
| __ ret();
|
| __ Bind(&fall_through);
|
|
|