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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 UseTempRegister(instr->value()) : UseRegister(instr->value()); | 1929 UseTempRegister(instr->value()) : UseRegister(instr->value()); |
1930 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1930 LOperand* temp = needs_temp ? TempRegister() : NULL; |
1931 return AssignEnvironment( | 1931 return AssignEnvironment( |
1932 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); | 1932 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); |
1933 } | 1933 } |
1934 } else if (from.IsInteger32()) { | 1934 } else if (from.IsInteger32()) { |
1935 info()->MarkAsDeferredCalling(); | 1935 info()->MarkAsDeferredCalling(); |
1936 if (to.IsTagged()) { | 1936 if (to.IsTagged()) { |
1937 HValue* val = instr->value(); | 1937 HValue* val = instr->value(); |
1938 LOperand* value = UseRegister(val); | 1938 LOperand* value = UseRegister(val); |
1939 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1939 if (!instr->CheckFlag(HValue::kCanOverflow)) { |
1940 return DefineSameAsFirst(new(zone()) LSmiTag(value)); | 1940 return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1941 } else if (val->CheckFlag(HInstruction::kUint32)) { | 1941 } else if (val->CheckFlag(HInstruction::kUint32)) { |
1942 LOperand* temp1 = TempRegister(); | 1942 LOperand* temp1 = TempRegister(); |
1943 LOperand* temp2 = CpuFeatures::IsSupported(SSE2) ? FixedTemp(xmm1) | 1943 LOperand* temp2 = CpuFeatures::IsSupported(SSE2) ? FixedTemp(xmm1) |
1944 : NULL; | 1944 : NULL; |
1945 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); | 1945 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); |
1946 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1946 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1947 } else { | 1947 } else { |
1948 LOperand* temp = TempRegister(); | 1948 LOperand* temp = TempRegister(); |
1949 LNumberTagI* result = new(zone()) LNumberTagI(value, temp); | 1949 LNumberTagI* result = new(zone()) LNumberTagI(value, temp); |
1950 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1950 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1951 } | 1951 } |
1952 } else if (to.IsSmi()) { | 1952 } else if (to.IsSmi()) { |
1953 HValue* val = instr->value(); | 1953 HValue* val = instr->value(); |
1954 LOperand* value = UseRegister(val); | 1954 LOperand* value = UseRegister(val); |
1955 LInstruction* result = val->CheckFlag(HInstruction::kUint32) | 1955 LInstruction* result = DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1956 ? DefineSameAsFirst(new(zone()) LUint32ToSmi(value)) | 1956 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1957 : DefineSameAsFirst(new(zone()) LInteger32ToSmi(value)); | 1957 result = AssignEnvironment(result); |
1958 if (val->HasRange() && val->range()->IsInSmiRange()) { | |
1959 return result; | |
1960 } | 1958 } |
1961 return AssignEnvironment(result); | 1959 return result; |
1962 } else { | 1960 } else { |
1963 ASSERT(to.IsDouble()); | 1961 ASSERT(to.IsDouble()); |
1964 if (instr->value()->CheckFlag(HInstruction::kUint32)) { | 1962 if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
1965 LOperand* temp = FixedTemp(xmm1); | 1963 LOperand* temp = FixedTemp(xmm1); |
1966 return DefineAsRegister( | 1964 return DefineAsRegister( |
1967 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); | 1965 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); |
1968 } else { | 1966 } else { |
1969 return DefineAsRegister( | 1967 return DefineAsRegister( |
1970 new(zone()) LInteger32ToDouble(Use(instr->value()))); | 1968 new(zone()) LInteger32ToDouble(Use(instr->value()))); |
1971 } | 1969 } |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2679 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2682 LOperand* object = UseRegister(instr->object()); | 2680 LOperand* object = UseRegister(instr->object()); |
2683 LOperand* index = UseTempRegister(instr->index()); | 2681 LOperand* index = UseTempRegister(instr->index()); |
2684 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2682 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2685 } | 2683 } |
2686 | 2684 |
2687 | 2685 |
2688 } } // namespace v8::internal | 2686 } } // namespace v8::internal |
2689 | 2687 |
2690 #endif // V8_TARGET_ARCH_IA32 | 2688 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |