OLD | NEW |
---|---|
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 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1927 LOperand* key = UseFixed(instr->key(), r0); | 1927 LOperand* key = UseFixed(instr->key(), r0); |
1928 | 1928 |
1929 LInstruction* result = | 1929 LInstruction* result = |
1930 DefineFixed(new(zone()) LLoadKeyedGeneric(object, key), r0); | 1930 DefineFixed(new(zone()) LLoadKeyedGeneric(object, key), r0); |
1931 return MarkAsCall(result, instr); | 1931 return MarkAsCall(result, instr); |
1932 } | 1932 } |
1933 | 1933 |
1934 | 1934 |
1935 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 1935 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
1936 ElementsKind elements_kind = instr->elements_kind(); | 1936 ElementsKind elements_kind = instr->elements_kind(); |
1937 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 1937 LStoreKeyed* result = NULL; |
1938 LOperand* key = needs_write_barrier | |
1939 ? UseTempRegister(instr->key()) | |
1940 : UseRegisterOrConstantAtStart(instr->key()); | |
1941 bool val_is_temp_register = | |
1942 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | |
1943 elements_kind == EXTERNAL_FLOAT_ELEMENTS; | |
1944 LOperand* val = val_is_temp_register || needs_write_barrier | |
1945 ? UseTempRegister(instr->value()) | |
1946 : UseRegister(instr->value()); | |
1947 | 1938 |
1948 LStoreKeyed* result = NULL; | |
1949 if (!instr->is_external()) { | 1939 if (!instr->is_external()) { |
1950 ASSERT(instr->elements()->representation().IsTagged()); | 1940 ASSERT(instr->elements()->representation().IsTagged()); |
1941 bool needs_write_barrier = instr->NeedsWriteBarrier(); | |
1942 LOperand* object = NULL; | |
1943 LOperand* key = NULL; | |
1944 LOperand* val = NULL; | |
1951 | 1945 |
1952 LOperand* object = NULL; | |
1953 if (instr->value()->representation().IsDouble()) { | 1946 if (instr->value()->representation().IsDouble()) { |
1954 object = UseRegisterAtStart(instr->elements()); | 1947 object = UseRegisterAtStart(instr->elements()); |
1948 val = UseTempRegister(instr->value()); | |
1949 key = UseRegisterOrConstantAtStart(instr->key()); | |
1955 } else { | 1950 } else { |
1956 ASSERT(instr->value()->representation().IsTagged()); | 1951 ASSERT(instr->value()->representation().IsTagged()); |
1957 object = UseTempRegister(instr->elements()); | 1952 object = UseTempRegister(instr->elements()); |
1953 val = needs_write_barrier ? UseTempRegister(instr->value()) | |
1954 : UseRegisterAtStart(instr->value()); | |
1955 key = needs_write_barrier ? UseTempRegister(instr->key()) | |
1956 : UseRegisterOrConstantAtStart(instr->key()); | |
1958 } | 1957 } |
1959 | 1958 |
1960 result = new(zone()) LStoreKeyed(object, key, val); | 1959 result = new(zone()) LStoreKeyed(object, key, val); |
Sven Panne
2012/11/21 13:30:51
Directly returning here and below without any temp
mvstanton
2012/11/21 13:59:18
Thanks, that is true! I've adjusted the ia32 file
| |
1961 } else { | 1960 } else { |
1962 ASSERT( | 1961 ASSERT( |
1963 (instr->value()->representation().IsInteger32() && | 1962 (instr->value()->representation().IsInteger32() && |
1964 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1963 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1965 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1964 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1966 (instr->value()->representation().IsDouble() && | 1965 (instr->value()->representation().IsDouble() && |
1967 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1966 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1968 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1967 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1969 ASSERT(instr->elements()->representation().IsExternal()); | 1968 ASSERT(instr->elements()->representation().IsExternal()); |
1970 | 1969 bool val_is_temp_register = |
1970 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | |
1971 elements_kind == EXTERNAL_FLOAT_ELEMENTS; | |
1972 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) | |
1973 : UseRegister(instr->value()); | |
1974 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | |
1971 LOperand* external_pointer = UseRegister(instr->elements()); | 1975 LOperand* external_pointer = UseRegister(instr->elements()); |
1972 result = new(zone()) LStoreKeyed(external_pointer, key, val); | 1976 result = new(zone()) LStoreKeyed(external_pointer, key, val); |
1973 } | 1977 } |
1974 | 1978 |
1975 ASSERT(result != NULL); | 1979 ASSERT(result != NULL); |
1976 return result; | 1980 return result; |
1977 } | 1981 } |
1978 | 1982 |
1979 | 1983 |
1980 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 1984 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2300 | 2304 |
2301 | 2305 |
2302 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2306 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2303 LOperand* object = UseRegister(instr->object()); | 2307 LOperand* object = UseRegister(instr->object()); |
2304 LOperand* index = UseRegister(instr->index()); | 2308 LOperand* index = UseRegister(instr->index()); |
2305 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2309 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2306 } | 2310 } |
2307 | 2311 |
2308 | 2312 |
2309 } } // namespace v8::internal | 2313 } } // namespace v8::internal |
OLD | NEW |