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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6410112: Implement crankshaft support for pixel array loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge with latest 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/v8-counters.h ('k') | src/x64/lithium-x64.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 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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 920 }
921 921
922 922
923 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { 923 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
924 Register result = ToRegister(instr->result()); 924 Register result = ToRegister(instr->result());
925 Register array = ToRegister(instr->InputAt(0)); 925 Register array = ToRegister(instr->InputAt(0));
926 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); 926 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset));
927 } 927 }
928 928
929 929
930 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) {
931 Register result = ToRegister(instr->result());
932 Register array = ToRegister(instr->InputAt(0));
933 __ movq(result, FieldOperand(array, PixelArray::kLengthOffset));
934 }
935
936
930 void LCodeGen::DoValueOf(LValueOf* instr) { 937 void LCodeGen::DoValueOf(LValueOf* instr) {
931 Abort("Unimplemented: %s", "DoValueOf"); 938 Abort("Unimplemented: %s", "DoValueOf");
932 } 939 }
933 940
934 941
935 void LCodeGen::DoBitNotI(LBitNotI* instr) { 942 void LCodeGen::DoBitNotI(LBitNotI* instr) {
936 LOperand* input = instr->InputAt(0); 943 LOperand* input = instr->InputAt(0);
937 ASSERT(input->Equals(instr->result())); 944 ASSERT(input->Equals(instr->result()));
938 __ not_(ToRegister(input)); 945 __ not_(ToRegister(input));
939 } 946 }
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 CallCode(ic, RelocInfo::CODE_TARGET, instr); 1726 CallCode(ic, RelocInfo::CODE_TARGET, instr);
1720 } 1727 }
1721 1728
1722 1729
1723 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 1730 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
1724 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); 1731 Abort("Unimplemented: %s", "DoLoadFunctionPrototype");
1725 } 1732 }
1726 1733
1727 1734
1728 void LCodeGen::DoLoadElements(LLoadElements* instr) { 1735 void LCodeGen::DoLoadElements(LLoadElements* instr) {
1729 ASSERT(instr->result()->Equals(instr->InputAt(0))); 1736 Register result = ToRegister(instr->result());
1730 Register reg = ToRegister(instr->InputAt(0)); 1737 Register input = ToRegister(instr->InputAt(0));
1731 __ movq(reg, FieldOperand(reg, JSObject::kElementsOffset)); 1738 __ movq(result, FieldOperand(input, JSObject::kElementsOffset));
1732 if (FLAG_debug_code) { 1739 if (FLAG_debug_code) {
1733 NearLabel done; 1740 NearLabel done;
1734 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), 1741 __ Cmp(FieldOperand(result, HeapObject::kMapOffset),
1735 Factory::fixed_array_map()); 1742 Factory::fixed_array_map());
1736 __ j(equal, &done); 1743 __ j(equal, &done);
1737 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), 1744 __ Cmp(FieldOperand(result, HeapObject::kMapOffset),
1745 Factory::pixel_array_map());
1746 __ j(equal, &done);
1747 __ Cmp(FieldOperand(result, HeapObject::kMapOffset),
1738 Factory::fixed_cow_array_map()); 1748 Factory::fixed_cow_array_map());
1739 __ Check(equal, "Check for fast elements failed."); 1749 __ Check(equal, "Check for fast elements failed.");
1740 __ bind(&done); 1750 __ bind(&done);
1741 } 1751 }
1742 } 1752 }
1743 1753
1744 1754
1755 void LCodeGen::DoLoadPixelArrayExternalPointer(
1756 LLoadPixelArrayExternalPointer* instr) {
1757 Register result = ToRegister(instr->result());
1758 Register input = ToRegister(instr->InputAt(0));
1759 __ movq(result, FieldOperand(input, PixelArray::kExternalPointerOffset));
1760 }
1761
1762
1745 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 1763 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
1746 Abort("Unimplemented: %s", "DoAccessArgumentsAt"); 1764 Abort("Unimplemented: %s", "DoAccessArgumentsAt");
1747 } 1765 }
1748 1766
1749 1767
1750 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { 1768 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
1751 Register elements = ToRegister(instr->elements()); 1769 Register elements = ToRegister(instr->elements());
1752 Register key = ToRegister(instr->key()); 1770 Register key = ToRegister(instr->key());
1753 Register result = ToRegister(instr->result()); 1771 Register result = ToRegister(instr->result());
1754 ASSERT(result.is(elements)); 1772 ASSERT(result.is(elements));
1755 1773
1756 // Load the result. 1774 // Load the result.
1757 __ movq(result, FieldOperand(elements, 1775 __ movq(result, FieldOperand(elements,
1758 key, 1776 key,
1759 times_pointer_size, 1777 times_pointer_size,
1760 FixedArray::kHeaderSize)); 1778 FixedArray::kHeaderSize));
1761 1779
1762 // Check for the hole value. 1780 // Check for the hole value.
1763 __ Cmp(result, Factory::the_hole_value()); 1781 __ Cmp(result, Factory::the_hole_value());
1764 DeoptimizeIf(equal, instr->environment()); 1782 DeoptimizeIf(equal, instr->environment());
1765 } 1783 }
1766 1784
1767 1785
1786 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) {
1787 Register external_elements = ToRegister(instr->external_pointer());
1788 Register key = ToRegister(instr->key());
1789 Register result = ToRegister(instr->result());
1790 ASSERT(result.is(external_elements));
1791
1792 // Load the result.
1793 __ movzxbq(result, Operand(external_elements, key, times_1, 0));
1794 }
1795
1796
1768 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 1797 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
1769 Abort("Unimplemented: %s", "DoLoadKeyedGeneric"); 1798 Abort("Unimplemented: %s", "DoLoadKeyedGeneric");
1770 } 1799 }
1771 1800
1772 1801
1773 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 1802 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
1774 Abort("Unimplemented: %s", "DoArgumentsElements"); 1803 Abort("Unimplemented: %s", "DoArgumentsElements");
1775 } 1804 }
1776 1805
1777 1806
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 2601
2573 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2602 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2574 Abort("Unimplemented: %s", "DoOsrEntry"); 2603 Abort("Unimplemented: %s", "DoOsrEntry");
2575 } 2604 }
2576 2605
2577 #undef __ 2606 #undef __
2578 2607
2579 } } // namespace v8::internal 2608 } } // namespace v8::internal
2580 2609
2581 #endif // V8_TARGET_ARCH_X64 2610 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8-counters.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698