| 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 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 return DefineSameAsFirst(new(zone()) LDummyUse(value)); | 1934 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
| 1935 } | 1935 } |
| 1936 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); | 1936 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); |
| 1937 } else { | 1937 } else { |
| 1938 ASSERT(to.IsInteger32()); | 1938 ASSERT(to.IsInteger32()); |
| 1939 if (instr->value()->type().IsSmi()) { | 1939 if (instr->value()->type().IsSmi()) { |
| 1940 LOperand* value = UseRegister(instr->value()); | 1940 LOperand* value = UseRegister(instr->value()); |
| 1941 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); | 1941 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
| 1942 } else { | 1942 } else { |
| 1943 bool truncating = instr->CanTruncateToInt32(); | 1943 bool truncating = instr->CanTruncateToInt32(); |
| 1944 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { | 1944 LOperand* value = UseRegister(instr->value()); |
| 1945 LOperand* value = UseRegister(instr->value()); | 1945 LOperand* xmm_temp = |
| 1946 LOperand* xmm_temp = | 1946 (CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating) |
| 1947 (truncating && CpuFeatures::IsSupported(SSE3)) | 1947 ? FixedTemp(xmm1) : NULL; |
| 1948 ? NULL | 1948 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); |
| 1949 : FixedTemp(xmm1); | 1949 return AssignEnvironment(DefineSameAsFirst(res)); |
| 1950 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); | |
| 1951 return AssignEnvironment(DefineSameAsFirst(res)); | |
| 1952 } else { | |
| 1953 LOperand* value = UseFixed(instr->value(), ecx); | |
| 1954 LTaggedToINoSSE2* res = | |
| 1955 new(zone()) LTaggedToINoSSE2(value, TempRegister(), | |
| 1956 TempRegister(), TempRegister()); | |
| 1957 return AssignEnvironment(DefineFixed(res, ecx)); | |
| 1958 } | |
| 1959 } | 1950 } |
| 1960 } | 1951 } |
| 1961 } else if (from.IsDouble()) { | 1952 } else if (from.IsDouble()) { |
| 1962 if (to.IsTagged()) { | 1953 if (to.IsTagged()) { |
| 1963 info()->MarkAsDeferredCalling(); | 1954 info()->MarkAsDeferredCalling(); |
| 1964 LOperand* value = UseRegisterAtStart(instr->value()); | 1955 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1965 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; | 1956 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; |
| 1966 | 1957 |
| 1967 // Make sure that temp and result_temp are different registers. | 1958 // Make sure that temp and result_temp are different registers. |
| 1968 LUnallocated* result_temp = TempRegister(); | 1959 LUnallocated* result_temp = TempRegister(); |
| 1969 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); | 1960 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); |
| 1970 return AssignPointerMap(Define(result, result_temp)); | 1961 return AssignPointerMap(Define(result, result_temp)); |
| 1971 } else if (to.IsSmi()) { | 1962 } else if (to.IsSmi()) { |
| 1972 LOperand* value = UseRegister(instr->value()); | 1963 LOperand* value = UseRegister(instr->value()); |
| 1973 return AssignEnvironment( | 1964 return AssignEnvironment( |
| 1974 DefineAsRegister(new(zone()) LDoubleToSmi(value))); | 1965 DefineAsRegister(new(zone()) LDoubleToSmi(value))); |
| 1975 } else { | 1966 } else { |
| 1976 ASSERT(to.IsInteger32()); | 1967 ASSERT(to.IsInteger32()); |
| 1977 bool truncating = instr->CanTruncateToInt32(); | 1968 bool truncating = instr->CanTruncateToInt32(); |
| 1978 bool needs_temp = truncating && !CpuFeatures::IsSupported(SSE3); | 1969 bool needs_temp = CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating; |
| 1979 LOperand* value = needs_temp ? | 1970 LOperand* value = needs_temp ? |
| 1980 UseTempRegister(instr->value()) : UseRegister(instr->value()); | 1971 UseTempRegister(instr->value()) : UseRegister(instr->value()); |
| 1981 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1972 LOperand* temp = needs_temp ? TempRegister() : NULL; |
| 1982 return AssignEnvironment( | 1973 return AssignEnvironment( |
| 1983 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); | 1974 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); |
| 1984 } | 1975 } |
| 1985 } else if (from.IsInteger32()) { | 1976 } else if (from.IsInteger32()) { |
| 1986 info()->MarkAsDeferredCalling(); | 1977 info()->MarkAsDeferredCalling(); |
| 1987 if (to.IsTagged()) { | 1978 if (to.IsTagged()) { |
| 1988 HValue* val = instr->value(); | 1979 HValue* val = instr->value(); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2740 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2750 LOperand* object = UseRegister(instr->object()); | 2741 LOperand* object = UseRegister(instr->object()); |
| 2751 LOperand* index = UseTempRegister(instr->index()); | 2742 LOperand* index = UseTempRegister(instr->index()); |
| 2752 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2743 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2753 } | 2744 } |
| 2754 | 2745 |
| 2755 | 2746 |
| 2756 } } // namespace v8::internal | 2747 } } // namespace v8::internal |
| 2757 | 2748 |
| 2758 #endif // V8_TARGET_ARCH_IA32 | 2749 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |