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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 } else { | 1908 } else { |
1909 ASSERT(to.IsInteger32()); | 1909 ASSERT(to.IsInteger32()); |
1910 LOperand* value = NULL; | 1910 LOperand* value = NULL; |
1911 LInstruction* res = NULL; | 1911 LInstruction* res = NULL; |
1912 if (instr->value()->type().IsSmi()) { | 1912 if (instr->value()->type().IsSmi()) { |
1913 value = UseRegisterAtStart(instr->value()); | 1913 value = UseRegisterAtStart(instr->value()); |
1914 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); | 1914 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); |
1915 } else { | 1915 } else { |
1916 value = UseRegister(instr->value()); | 1916 value = UseRegister(instr->value()); |
1917 LOperand* temp1 = TempRegister(); | 1917 LOperand* temp1 = TempRegister(); |
1918 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() | 1918 LOperand* temp2 = FixedTemp(d11); |
1919 : NULL; | |
1920 LOperand* temp3 = FixedTemp(d11); | |
1921 res = DefineSameAsFirst(new(zone()) LTaggedToI(value, | 1919 res = DefineSameAsFirst(new(zone()) LTaggedToI(value, |
1922 temp1, | 1920 temp1, |
1923 temp2, | 1921 temp2)); |
1924 temp3)); | |
1925 res = AssignEnvironment(res); | 1922 res = AssignEnvironment(res); |
1926 } | 1923 } |
1927 return res; | 1924 return res; |
1928 } | 1925 } |
1929 } else if (from.IsDouble()) { | 1926 } else if (from.IsDouble()) { |
1930 if (to.IsTagged()) { | 1927 if (to.IsTagged()) { |
1931 info()->MarkAsDeferredCalling(); | 1928 info()->MarkAsDeferredCalling(); |
1932 LOperand* value = UseRegister(instr->value()); | 1929 LOperand* value = UseRegister(instr->value()); |
1933 LOperand* temp1 = TempRegister(); | 1930 LOperand* temp1 = TempRegister(); |
1934 LOperand* temp2 = TempRegister(); | 1931 LOperand* temp2 = TempRegister(); |
1935 | 1932 |
1936 // Make sure that the temp and result_temp registers are | 1933 // Make sure that the temp and result_temp registers are |
1937 // different. | 1934 // different. |
1938 LUnallocated* result_temp = TempRegister(); | 1935 LUnallocated* result_temp = TempRegister(); |
1939 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); | 1936 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); |
1940 Define(result, result_temp); | 1937 Define(result, result_temp); |
1941 return AssignPointerMap(result); | 1938 return AssignPointerMap(result); |
1942 } else if (to.IsSmi()) { | 1939 } else if (to.IsSmi()) { |
1943 LOperand* value = UseRegister(instr->value()); | 1940 LOperand* value = UseRegister(instr->value()); |
1944 return AssignEnvironment(DefineAsRegister(new(zone()) LDoubleToSmi(value, | 1941 return AssignEnvironment( |
1945 TempRegister(), TempRegister()))); | 1942 DefineAsRegister(new(zone()) LDoubleToSmi(value))); |
1946 } else { | 1943 } else { |
1947 ASSERT(to.IsInteger32()); | 1944 ASSERT(to.IsInteger32()); |
1948 LOperand* value = UseRegister(instr->value()); | 1945 LOperand* value = UseRegister(instr->value()); |
1949 LOperand* temp1 = TempRegister(); | 1946 LDoubleToI* res = new(zone()) LDoubleToI(value); |
1950 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL; | |
1951 LDoubleToI* res = new(zone()) LDoubleToI(value, temp1, temp2); | |
1952 return AssignEnvironment(DefineAsRegister(res)); | 1947 return AssignEnvironment(DefineAsRegister(res)); |
1953 } | 1948 } |
1954 } else if (from.IsInteger32()) { | 1949 } else if (from.IsInteger32()) { |
1955 info()->MarkAsDeferredCalling(); | 1950 info()->MarkAsDeferredCalling(); |
1956 if (to.IsTagged()) { | 1951 if (to.IsTagged()) { |
1957 HValue* val = instr->value(); | 1952 HValue* val = instr->value(); |
1958 LOperand* value = UseRegisterAtStart(val); | 1953 LOperand* value = UseRegisterAtStart(val); |
1959 if (val->CheckFlag(HInstruction::kUint32)) { | 1954 if (val->CheckFlag(HInstruction::kUint32)) { |
1960 LNumberTagU* result = new(zone()) LNumberTagU(value); | 1955 LNumberTagU* result = new(zone()) LNumberTagU(value); |
1961 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1956 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 | 2584 |
2590 | 2585 |
2591 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2586 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2592 LOperand* object = UseRegister(instr->object()); | 2587 LOperand* object = UseRegister(instr->object()); |
2593 LOperand* index = UseRegister(instr->index()); | 2588 LOperand* index = UseRegister(instr->index()); |
2594 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2589 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2595 } | 2590 } |
2596 | 2591 |
2597 | 2592 |
2598 } } // namespace v8::internal | 2593 } } // namespace v8::internal |
OLD | NEW |