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 6489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6500 __ pop(ecx); | 6500 __ pop(ecx); |
6501 __ pop(eax); | 6501 __ pop(eax); |
6502 __ pop(edx); | 6502 __ pop(edx); |
6503 __ push(ecx); | 6503 __ push(ecx); |
6504 | 6504 |
6505 // Do a tail call to the rewritten stub. | 6505 // Do a tail call to the rewritten stub. |
6506 __ jmp(Operand(edi)); | 6506 __ jmp(Operand(edi)); |
6507 } | 6507 } |
6508 | 6508 |
6509 | 6509 |
6510 // Loads a indexed element from a pixel array. | |
6511 void GenerateFastPixelArrayLoad(MacroAssembler* masm, | |
6512 Register receiver, | |
6513 Register key, | |
6514 Register elements, | |
6515 Register untagged_key, | |
6516 Register result, | |
6517 Label* not_pixel_array, | |
6518 Label* key_not_smi, | |
6519 Label* out_of_range) { | |
6520 // Register use: | |
6521 // receiver - holds the receiver and is unchanged. | |
6522 // key - holds the key and is unchanged (must be a smi). | |
6523 // elements - is set to the the receiver's element if | |
6524 // the receiver doesn't have a pixel array or the | |
6525 // key is not a smi, otherwise it's the elements' | |
6526 // external pointer. | |
6527 // untagged_key - is set to the untagged key | |
6528 | |
6529 // Key must be a smi. | |
6530 if (key_not_smi != NULL) { | |
Søren Thygesen Gjesse
2011/02/01 12:02:56
See comments for ARM. Also on ARM you check the re
danno
2011/02/03 12:53:26
Done.
| |
6531 __ test(key, Immediate(kSmiTagMask)); | |
6532 __ j(not_zero, key_not_smi, not_taken); | |
6533 } | |
6534 __ mov(untagged_key, key); | |
6535 __ SmiUntag(untagged_key); | |
6536 | |
6537 // Verify that the receiver has pixel array elements. | |
Mads Ager (chromium)
2011/02/01 12:02:12
Perform checks in the same order on all platforms
danno
2011/02/03 12:53:26
Done.
| |
6538 __ mov(elements, FieldOperand(receiver, JSObject::kElementsOffset)); | |
6539 __ CheckMap(elements, Factory::pixel_array_map(), not_pixel_array, true); | |
6540 | |
6541 // Key must be in range. | |
6542 __ cmp(untagged_key, FieldOperand(elements, PixelArray::kLengthOffset)); | |
6543 __ j(above_equal, out_of_range); | |
6544 | |
6545 // Perform the indexed load and tag the result as a smi. | |
6546 __ mov(elements, FieldOperand(elements, PixelArray::kExternalPointerOffset)); | |
6547 __ movzx_b(result, Operand(elements, untagged_key, times_1, 0)); | |
6548 __ SmiTag(result); | |
6549 __ ret(0); | |
6550 } | |
6551 | |
6552 | |
6510 #undef __ | 6553 #undef __ |
6511 | 6554 |
6512 } } // namespace v8::internal | 6555 } } // namespace v8::internal |
6513 | 6556 |
6514 #endif // V8_TARGET_ARCH_IA32 | 6557 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |