| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3539 else | 3539 else |
| 3540 __ j(not_equal, &check_heap_number); | 3540 __ j(not_equal, &check_heap_number); |
| 3541 | 3541 |
| 3542 // smi case | 3542 // smi case |
| 3543 __ mov(ecx, eax); // Preserve the value in eax. Key is no longer needed. | 3543 __ mov(ecx, eax); // Preserve the value in eax. Key is no longer needed. |
| 3544 __ SmiUntag(ecx); | 3544 __ SmiUntag(ecx); |
| 3545 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); | 3545 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); |
| 3546 // ecx: base pointer of external storage | 3546 // ecx: base pointer of external storage |
| 3547 switch (array_type) { | 3547 switch (array_type) { |
| 3548 case kExternalPixelArray: | 3548 case kExternalPixelArray: |
| 3549 { // Clamp the value to [0..255]. | 3549 __ ClampUInt8(ecx); |
| 3550 NearLabel done; | |
| 3551 __ test(ecx, Immediate(0xFFFFFF00)); | |
| 3552 __ j(zero, &done); | |
| 3553 __ setcc(negative, ecx); // 1 if negative, 0 if positive. | |
| 3554 __ dec_b(ecx); // 0 if negative, 255 if positive. | |
| 3555 __ bind(&done); | |
| 3556 } | |
| 3557 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | 3550 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); |
| 3558 break; | 3551 break; |
| 3559 case kExternalByteArray: | 3552 case kExternalByteArray: |
| 3560 case kExternalUnsignedByteArray: | 3553 case kExternalUnsignedByteArray: |
| 3561 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | 3554 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); |
| 3562 break; | 3555 break; |
| 3563 case kExternalShortArray: | 3556 case kExternalShortArray: |
| 3564 case kExternalUnsignedShortArray: | 3557 case kExternalUnsignedShortArray: |
| 3565 __ mov_w(Operand(edi, ebx, times_2, 0), ecx); | 3558 __ mov_w(Operand(edi, ebx, times_2, 0), ecx); |
| 3566 break; | 3559 break; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 | 3695 |
| 3703 return GetCode(flags); | 3696 return GetCode(flags); |
| 3704 } | 3697 } |
| 3705 | 3698 |
| 3706 | 3699 |
| 3707 #undef __ | 3700 #undef __ |
| 3708 | 3701 |
| 3709 } } // namespace v8::internal | 3702 } } // namespace v8::internal |
| 3710 | 3703 |
| 3711 #endif // V8_TARGET_ARCH_IA32 | 3704 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |