Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 6287030: Create specialized code stubs for PixelArray loads. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: review feedback Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 edx, 549 edx,
550 eax, 550 eax,
551 ecx, 551 ecx,
552 eax, 552 eax,
553 NULL, 553 NULL,
554 &slow); 554 &slow);
555 __ IncrementCounter(&Counters::keyed_load_generic_smi, 1); 555 __ IncrementCounter(&Counters::keyed_load_generic_smi, 1);
556 __ ret(0); 556 __ ret(0);
557 557
558 __ bind(&check_pixel_array); 558 __ bind(&check_pixel_array);
559 // Check whether the elements is a pixel array. 559 GenerateFastPixelArrayLoad(masm,
560 // edx: receiver 560 edx,
561 // eax: key 561 eax,
562 __ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset)); 562 ecx,
563 __ mov(ebx, eax); 563 ebx,
564 __ SmiUntag(ebx); 564 eax,
565 __ CheckMap(ecx, Factory::pixel_array_map(), &check_number_dictionary, true); 565 &check_number_dictionary,
566 __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset)); 566 NULL,
567 __ j(above_equal, &slow); 567 &slow);
568 __ mov(eax, FieldOperand(ecx, PixelArray::kExternalPointerOffset));
569 __ movzx_b(eax, Operand(eax, ebx, times_1, 0));
570 __ SmiTag(eax);
571 __ ret(0);
572 568
573 __ bind(&check_number_dictionary); 569 __ bind(&check_number_dictionary);
574 // Check whether the elements is a number dictionary. 570 // Check whether the elements is a number dictionary.
575 // edx: receiver 571 // edx: receiver
576 // ebx: untagged index 572 // ebx: untagged index
577 // eax: key 573 // eax: key
578 // ecx: elements 574 // ecx: elements
579 __ CheckMap(ecx, Factory::hash_table_map(), &slow, true); 575 __ CheckMap(ecx, Factory::hash_table_map(), &slow, true);
580 Label slow_pop_receiver; 576 Label slow_pop_receiver;
581 // Push receiver on the stack to free up a register for the dictionary 577 // Push receiver on the stack to free up a register for the dictionary
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1769 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1774 ? not_zero 1770 ? not_zero
1775 : zero; 1771 : zero;
1776 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1772 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1777 } 1773 }
1778 1774
1779 1775
1780 } } // namespace v8::internal 1776 } } // namespace v8::internal
1781 1777
1782 #endif // V8_TARGET_ARCH_IA32 1778 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698