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

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

Issue 7849017: Mechanical refactor to move ElementsKind type out of JSObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: latest changes Created 9 years, 3 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/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('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 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 LOperand* elements = UseTempRegister(instr->elements()); 1853 LOperand* elements = UseTempRegister(instr->elements());
1854 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 1854 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1855 LLoadKeyedFastDoubleElement* result = 1855 LLoadKeyedFastDoubleElement* result =
1856 new LLoadKeyedFastDoubleElement(elements, key); 1856 new LLoadKeyedFastDoubleElement(elements, key);
1857 return AssignEnvironment(DefineAsRegister(result)); 1857 return AssignEnvironment(DefineAsRegister(result));
1858 } 1858 }
1859 1859
1860 1860
1861 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( 1861 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement(
1862 HLoadKeyedSpecializedArrayElement* instr) { 1862 HLoadKeyedSpecializedArrayElement* instr) {
1863 JSObject::ElementsKind elements_kind = instr->elements_kind(); 1863 ElementsKind elements_kind = instr->elements_kind();
1864 Representation representation(instr->representation()); 1864 Representation representation(instr->representation());
1865 ASSERT( 1865 ASSERT(
1866 (representation.IsInteger32() && 1866 (representation.IsInteger32() &&
1867 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && 1867 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
1868 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || 1868 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
1869 (representation.IsDouble() && 1869 (representation.IsDouble() &&
1870 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || 1870 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
1871 (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS)))); 1871 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
1872 ASSERT(instr->key()->representation().IsInteger32()); 1872 ASSERT(instr->key()->representation().IsInteger32());
1873 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1873 LOperand* external_pointer = UseRegister(instr->external_pointer());
1874 LOperand* key = UseRegisterOrConstant(instr->key()); 1874 LOperand* key = UseRegisterOrConstant(instr->key());
1875 LLoadKeyedSpecializedArrayElement* result = 1875 LLoadKeyedSpecializedArrayElement* result =
1876 new LLoadKeyedSpecializedArrayElement(external_pointer, key); 1876 new LLoadKeyedSpecializedArrayElement(external_pointer, key);
1877 LInstruction* load_instr = DefineAsRegister(result); 1877 LInstruction* load_instr = DefineAsRegister(result);
1878 // An unsigned int array load might overflow and cause a deopt, make sure it 1878 // An unsigned int array load might overflow and cause a deopt, make sure it
1879 // has an environment. 1879 // has an environment.
1880 return (elements_kind == JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) ? 1880 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ?
1881 AssignEnvironment(load_instr) : load_instr; 1881 AssignEnvironment(load_instr) : load_instr;
1882 } 1882 }
1883 1883
1884 1884
1885 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { 1885 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
1886 LOperand* object = UseFixed(instr->object(), r1); 1886 LOperand* object = UseFixed(instr->object(), r1);
1887 LOperand* key = UseFixed(instr->key(), r0); 1887 LOperand* key = UseFixed(instr->key(), r0);
1888 1888
1889 LInstruction* result = 1889 LInstruction* result =
1890 DefineFixed(new LLoadKeyedGeneric(object, key), r0); 1890 DefineFixed(new LLoadKeyedGeneric(object, key), r0);
(...skipping 30 matching lines...) Expand all
1921 LOperand* val = UseTempRegister(instr->value()); 1921 LOperand* val = UseTempRegister(instr->value());
1922 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 1922 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1923 1923
1924 return new LStoreKeyedFastDoubleElement(elements, key, val); 1924 return new LStoreKeyedFastDoubleElement(elements, key, val);
1925 } 1925 }
1926 1926
1927 1927
1928 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( 1928 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement(
1929 HStoreKeyedSpecializedArrayElement* instr) { 1929 HStoreKeyedSpecializedArrayElement* instr) {
1930 Representation representation(instr->value()->representation()); 1930 Representation representation(instr->value()->representation());
1931 JSObject::ElementsKind elements_kind = instr->elements_kind(); 1931 ElementsKind elements_kind = instr->elements_kind();
1932 ASSERT( 1932 ASSERT(
1933 (representation.IsInteger32() && 1933 (representation.IsInteger32() &&
1934 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && 1934 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
1935 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || 1935 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
1936 (representation.IsDouble() && 1936 (representation.IsDouble() &&
1937 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || 1937 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
1938 (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS)))); 1938 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
1939 ASSERT(instr->external_pointer()->representation().IsExternal()); 1939 ASSERT(instr->external_pointer()->representation().IsExternal());
1940 ASSERT(instr->key()->representation().IsInteger32()); 1940 ASSERT(instr->key()->representation().IsInteger32());
1941 1941
1942 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1942 LOperand* external_pointer = UseRegister(instr->external_pointer());
1943 bool val_is_temp_register = 1943 bool val_is_temp_register =
1944 elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS || 1944 elements_kind == EXTERNAL_PIXEL_ELEMENTS ||
1945 elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS; 1945 elements_kind == EXTERNAL_FLOAT_ELEMENTS;
1946 LOperand* val = val_is_temp_register 1946 LOperand* val = val_is_temp_register
1947 ? UseTempRegister(instr->value()) 1947 ? UseTempRegister(instr->value())
1948 : UseRegister(instr->value()); 1948 : UseRegister(instr->value());
1949 LOperand* key = UseRegisterOrConstant(instr->key()); 1949 LOperand* key = UseRegisterOrConstant(instr->key());
1950 1950
1951 return new LStoreKeyedSpecializedArrayElement(external_pointer, 1951 return new LStoreKeyedSpecializedArrayElement(external_pointer,
1952 key, 1952 key,
1953 val); 1953 val);
1954 } 1954 }
1955 1955
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 2181
2182 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2182 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2183 LOperand* key = UseRegisterAtStart(instr->key()); 2183 LOperand* key = UseRegisterAtStart(instr->key());
2184 LOperand* object = UseRegisterAtStart(instr->object()); 2184 LOperand* object = UseRegisterAtStart(instr->object());
2185 LIn* result = new LIn(key, object); 2185 LIn* result = new LIn(key, object);
2186 return MarkAsCall(DefineFixed(result, r0), instr); 2186 return MarkAsCall(DefineFixed(result, r0), instr);
2187 } 2187 }
2188 2188
2189 2189
2190 } } // namespace v8::internal 2190 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698