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

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

Issue 15858006: Tag length of FixedArrayBase and smi-array[x] as smi representation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Split check-smi-and-return from check-smi Created 7 years, 7 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/x64/lithium-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 return NULL; 1808 return NULL;
1809 } 1809 }
1810 1810
1811 1811
1812 LInstruction* LChunkBuilder::DoChange(HChange* instr) { 1812 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1813 Representation from = instr->from(); 1813 Representation from = instr->from();
1814 Representation to = instr->to(); 1814 Representation to = instr->to();
1815 if (from.IsSmi()) { 1815 if (from.IsSmi()) {
1816 if (to.IsTagged()) { 1816 if (to.IsTagged()) {
1817 LOperand* value = UseRegister(instr->value()); 1817 LOperand* value = UseRegister(instr->value());
1818 // For now, always deopt on hole.
1819 if (instr->value()->IsLoadKeyed() &&
1820 HLoadKeyed::cast(instr->value())->UsesMustHandleHole()) {
1821 return AssignEnvironment(
1822 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value)));
1823 }
1818 return DefineSameAsFirst(new(zone()) LDummyUse(value)); 1824 return DefineSameAsFirst(new(zone()) LDummyUse(value));
1819 } 1825 }
1820 from = Representation::Tagged(); 1826 from = Representation::Tagged();
1821 } 1827 }
1822 // Only mark conversions that might need to allocate as calling rather than 1828 // Only mark conversions that might need to allocate as calling rather than
1823 // all changes. This makes simple, non-allocating conversion not have to force 1829 // all changes. This makes simple, non-allocating conversion not have to force
1824 // building a stack frame. 1830 // building a stack frame.
1825 if (from.IsTagged()) { 1831 if (from.IsTagged()) {
1826 if (to.IsDouble()) { 1832 if (to.IsDouble()) {
1827 info()->MarkAsDeferredCalling(); 1833 info()->MarkAsDeferredCalling();
1828 LOperand* value = UseRegister(instr->value()); 1834 LOperand* value = UseRegister(instr->value());
1829 LNumberUntagD* res = new(zone()) LNumberUntagD(value); 1835 LNumberUntagD* res = new(zone()) LNumberUntagD(value);
1830 return AssignEnvironment(DefineAsRegister(res)); 1836 return AssignEnvironment(DefineAsRegister(res));
1831 } else if (to.IsSmi()) { 1837 } else if (to.IsSmi()) {
1832 HValue* val = instr->value(); 1838 HValue* val = instr->value();
1833 LOperand* value = UseRegisterAtStart(val); 1839 LOperand* value = UseRegister(val);
1834 return AssignEnvironment( 1840 return AssignEnvironment(
1835 DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1841 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value)));
1836 } else { 1842 } else {
1837 ASSERT(to.IsInteger32()); 1843 ASSERT(to.IsInteger32());
1838 LOperand* value = UseRegister(instr->value()); 1844 LOperand* value = UseRegister(instr->value());
1839 if (instr->value()->type().IsSmi()) { 1845 if (instr->value()->type().IsSmi()) {
1840 LInstruction* result = 1846 LInstruction* result =
1841 DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); 1847 DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
1842 if (instr->value()->IsLoadKeyed()) { 1848 if (instr->value()->IsLoadKeyed()) {
1843 HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value()); 1849 HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value());
1844 if (load_keyed->UsesMustHandleHole() && 1850 if (load_keyed->UsesMustHandleHole() &&
1845 load_keyed->hole_mode() == NEVER_RETURN_HOLE) { 1851 load_keyed->hole_mode() == NEVER_RETURN_HOLE) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 1936
1931 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { 1937 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
1932 LUnallocated* temp = TempRegister(); 1938 LUnallocated* temp = TempRegister();
1933 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); 1939 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp);
1934 return AssignEnvironment(result); 1940 return AssignEnvironment(result);
1935 } 1941 }
1936 1942
1937 1943
1938 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { 1944 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1939 LOperand* value = UseRegisterAtStart(instr->value()); 1945 LOperand* value = UseRegisterAtStart(instr->value());
1940 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1946 return AssignEnvironment(new(zone()) LCheckSmi(value));
1941 } 1947 }
1942 1948
1943 1949
1944 LInstruction* LChunkBuilder::DoCheckSmiOrInt32(HCheckSmiOrInt32* instr) { 1950 LInstruction* LChunkBuilder::DoCheckSmiOrInt32(HCheckSmiOrInt32* instr) {
1945 LOperand* value = UseRegisterAtStart(instr->value()); 1951 LOperand* value = UseRegisterAtStart(instr->value());
1946 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1952 return AssignEnvironment(new(zone()) LCheckSmi(value));
1947 } 1953 }
1948 1954
1949 1955
1950 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { 1956 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1951 LOperand* value = UseRegisterAtStart(instr->value()); 1957 LOperand* value = UseRegisterAtStart(instr->value());
1952 return AssignEnvironment(new(zone()) LCheckFunction(value)); 1958 return AssignEnvironment(new(zone()) LCheckFunction(value));
1953 } 1959 }
1954 1960
1955 1961
1956 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { 1962 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2585 LOperand* object = UseRegister(instr->object()); 2591 LOperand* object = UseRegister(instr->object());
2586 LOperand* index = UseTempRegister(instr->index()); 2592 LOperand* index = UseTempRegister(instr->index());
2587 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2593 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2588 } 2594 }
2589 2595
2590 2596
2591 } } // namespace v8::internal 2597 } } // namespace v8::internal
2592 2598
2593 #endif // V8_TARGET_ARCH_X64 2599 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698