OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "lithium-allocator-inl.h" | 9 #include "lithium-allocator-inl.h" |
10 #include "ia32/lithium-ia32.h" | 10 #include "ia32/lithium-ia32.h" |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 LOperand* value = needs_temp ? UseTempRegister(val) : UseRegister(val); | 1934 LOperand* value = needs_temp ? UseTempRegister(val) : UseRegister(val); |
1935 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1935 LOperand* temp = needs_temp ? TempRegister() : NULL; |
1936 LInstruction* result = | 1936 LInstruction* result = |
1937 DefineAsRegister(new(zone()) LDoubleToI(value, temp)); | 1937 DefineAsRegister(new(zone()) LDoubleToI(value, temp)); |
1938 if (!truncating) result = AssignEnvironment(result); | 1938 if (!truncating) result = AssignEnvironment(result); |
1939 return result; | 1939 return result; |
1940 } | 1940 } |
1941 } else if (from.IsInteger32()) { | 1941 } else if (from.IsInteger32()) { |
1942 info()->MarkAsDeferredCalling(); | 1942 info()->MarkAsDeferredCalling(); |
1943 if (to.IsTagged()) { | 1943 if (to.IsTagged()) { |
| 1944 LOperand* value = UseRegister(val); |
1944 if (!instr->CheckFlag(HValue::kCanOverflow)) { | 1945 if (!instr->CheckFlag(HValue::kCanOverflow)) { |
1945 LOperand* value = UseRegister(val); | |
1946 return DefineSameAsFirst(new(zone()) LSmiTag(value)); | 1946 return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1947 } else if (val->CheckFlag(HInstruction::kUint32)) { | 1947 } else if (val->CheckFlag(HInstruction::kUint32)) { |
1948 LOperand* value = UseRegister(val); | 1948 LOperand* temp = TempRegister(); |
1949 LOperand* temp1 = TempRegister(); | 1949 LNumberTagU* result = new(zone()) LNumberTagU(value, temp); |
1950 LOperand* temp2 = FixedTemp(xmm1); | |
1951 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); | |
1952 return AssignPointerMap(DefineSameAsFirst(result)); | 1950 return AssignPointerMap(DefineSameAsFirst(result)); |
1953 } else { | 1951 } else { |
1954 LOperand* value = UseRegister(val); | |
1955 LOperand* temp = TempRegister(); | 1952 LOperand* temp = TempRegister(); |
1956 LNumberTagI* result = new(zone()) LNumberTagI(value, temp); | 1953 LNumberTagI* result = new(zone()) LNumberTagI(value, temp); |
1957 return AssignPointerMap(DefineSameAsFirst(result)); | 1954 return AssignPointerMap(DefineSameAsFirst(result)); |
1958 } | 1955 } |
1959 } else if (to.IsSmi()) { | 1956 } else if (to.IsSmi()) { |
1960 LOperand* value = UseRegister(val); | 1957 LOperand* value = UseRegister(val); |
1961 LInstruction* result = DefineSameAsFirst(new(zone()) LSmiTag(value)); | 1958 LInstruction* result = DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1962 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1959 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1963 result = AssignEnvironment(result); | 1960 result = AssignEnvironment(result); |
1964 } | 1961 } |
1965 return result; | 1962 return result; |
1966 } else { | 1963 } else { |
1967 ASSERT(to.IsDouble()); | 1964 ASSERT(to.IsDouble()); |
1968 if (val->CheckFlag(HInstruction::kUint32)) { | 1965 if (val->CheckFlag(HInstruction::kUint32)) { |
1969 LOperand* temp = FixedTemp(xmm1); | 1966 return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val))); |
1970 return DefineAsRegister( | |
1971 new(zone()) LUint32ToDouble(UseRegister(val), temp)); | |
1972 } else { | 1967 } else { |
1973 return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val))); | 1968 return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val))); |
1974 } | 1969 } |
1975 } | 1970 } |
1976 } | 1971 } |
1977 UNREACHABLE(); | 1972 UNREACHABLE(); |
1978 return NULL; | 1973 return NULL; |
1979 } | 1974 } |
1980 | 1975 |
1981 | 1976 |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 LOperand* index = UseTempRegister(instr->index()); | 2673 LOperand* index = UseTempRegister(instr->index()); |
2679 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2674 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2680 LInstruction* result = DefineSameAsFirst(load); | 2675 LInstruction* result = DefineSameAsFirst(load); |
2681 return AssignPointerMap(result); | 2676 return AssignPointerMap(result); |
2682 } | 2677 } |
2683 | 2678 |
2684 | 2679 |
2685 } } // namespace v8::internal | 2680 } } // namespace v8::internal |
2686 | 2681 |
2687 #endif // V8_TARGET_ARCH_IA32 | 2682 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |