OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // Check that the value is a smi. If a conversion is needed call into the | 416 // Check that the value is a smi. If a conversion is needed call into the |
417 // runtime to convert and clamp. | 417 // runtime to convert and clamp. |
418 __ test(eax, Immediate(kSmiTagMask)); | 418 __ test(eax, Immediate(kSmiTagMask)); |
419 __ j(not_zero, &slow); | 419 __ j(not_zero, &slow); |
420 __ sar(ebx, kSmiTagSize); // Untag the index. | 420 __ sar(ebx, kSmiTagSize); // Untag the index. |
421 __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset)); | 421 __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset)); |
422 __ j(above_equal, &slow); | 422 __ j(above_equal, &slow); |
423 __ mov(edx, eax); // Save the value. | 423 __ mov(edx, eax); // Save the value. |
424 __ sar(eax, kSmiTagSize); // Untag the value. | 424 __ sar(eax, kSmiTagSize); // Untag the value. |
425 { // Clamp the value to [0..255]. | 425 { // Clamp the value to [0..255]. |
426 Label done, is_negative; | 426 Label done; |
427 __ test(eax, Immediate(0xFFFFFF00)); | 427 __ test(eax, Immediate(0xFFFFFF00)); |
428 __ j(zero, &done); | 428 __ j(zero, &done); |
429 __ setcc(negative, eax); // 1 if negative, 0 if positive. | 429 __ setcc(negative, eax); // 1 if negative, 0 if positive. |
430 __ dec_b(eax); // 0 if negative, 255 if positive. | 430 __ dec_b(eax); // 0 if negative, 255 if positive. |
431 __ bind(&done); | 431 __ bind(&done); |
432 } | 432 } |
433 __ mov(ecx, FieldOperand(ecx, PixelArray::kExternalPointerOffset)); | 433 __ mov(ecx, FieldOperand(ecx, PixelArray::kExternalPointerOffset)); |
434 __ mov_b(Operand(ecx, ebx, times_1, 0), eax); | 434 __ mov_b(Operand(ecx, ebx, times_1, 0), eax); |
435 __ mov(eax, edx); // Return the original value. | 435 __ mov(eax, edx); // Return the original value. |
436 __ ret(0); | 436 __ ret(0); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 | 1028 |
1029 // Do tail-call to runtime routine. | 1029 // Do tail-call to runtime routine. |
1030 __ TailCallRuntime( | 1030 __ TailCallRuntime( |
1031 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); | 1031 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); |
1032 } | 1032 } |
1033 | 1033 |
1034 #undef __ | 1034 #undef __ |
1035 | 1035 |
1036 | 1036 |
1037 } } // namespace v8::internal | 1037 } } // namespace v8::internal |
OLD | NEW |