| 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 return AssignEnvironment(DefineAsRegister(res)); | 1929 return AssignEnvironment(DefineAsRegister(res)); |
| 1930 } else { | 1930 } else { |
| 1931 return AssignEnvironment(DefineX87TOS(res)); | 1931 return AssignEnvironment(DefineX87TOS(res)); |
| 1932 } | 1932 } |
| 1933 } else if (to.IsSmi()) { | 1933 } else if (to.IsSmi()) { |
| 1934 HValue* val = instr->value(); | 1934 HValue* val = instr->value(); |
| 1935 LOperand* value = UseRegister(val); | 1935 LOperand* value = UseRegister(val); |
| 1936 if (val->type().IsSmi()) { | 1936 if (val->type().IsSmi()) { |
| 1937 return DefineSameAsFirst(new(zone()) LDummyUse(value)); | 1937 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
| 1938 } | 1938 } |
| 1939 return AssignEnvironment( | 1939 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); |
| 1940 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value))); | |
| 1941 } else { | 1940 } else { |
| 1942 ASSERT(to.IsInteger32()); | 1941 ASSERT(to.IsInteger32()); |
| 1943 if (instr->value()->type().IsSmi()) { | 1942 if (instr->value()->type().IsSmi()) { |
| 1944 LOperand* value = UseRegister(instr->value()); | 1943 LOperand* value = UseRegister(instr->value()); |
| 1945 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); | 1944 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
| 1946 } else { | 1945 } else { |
| 1947 bool truncating = instr->CanTruncateToInt32(); | 1946 bool truncating = instr->CanTruncateToInt32(); |
| 1948 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { | 1947 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 1949 LOperand* value = UseRegister(instr->value()); | 1948 LOperand* value = UseRegister(instr->value()); |
| 1950 LOperand* xmm_temp = | 1949 LOperand* xmm_temp = |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2042 } | 2041 } |
| 2043 | 2042 |
| 2044 | 2043 |
| 2045 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2044 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
| 2046 LUnallocated* temp = TempRegister(); | 2045 LUnallocated* temp = TempRegister(); |
| 2047 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); | 2046 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); |
| 2048 return AssignEnvironment(result); | 2047 return AssignEnvironment(result); |
| 2049 } | 2048 } |
| 2050 | 2049 |
| 2051 | 2050 |
| 2052 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { | |
| 2053 LOperand* value = UseAtStart(instr->value()); | |
| 2054 return AssignEnvironment(new(zone()) LCheckSmi(value)); | |
| 2055 } | |
| 2056 | |
| 2057 | |
| 2058 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { | 2051 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { |
| 2059 // If the target is in new space, we'll emit a global cell compare and so | 2052 // If the target is in new space, we'll emit a global cell compare and so |
| 2060 // want the value in a register. If the target gets promoted before we | 2053 // want the value in a register. If the target gets promoted before we |
| 2061 // emit code, we will still get the register but will do an immediate | 2054 // emit code, we will still get the register but will do an immediate |
| 2062 // compare instead of the cell compare. This is safe. | 2055 // compare instead of the cell compare. This is safe. |
| 2063 LOperand* value = instr->target_in_new_space() | 2056 LOperand* value = instr->target_in_new_space() |
| 2064 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); | 2057 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); |
| 2065 return AssignEnvironment(new(zone()) LCheckFunction(value)); | 2058 return AssignEnvironment(new(zone()) LCheckFunction(value)); |
| 2066 } | 2059 } |
| 2067 | 2060 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2780 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2773 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2781 LOperand* object = UseRegister(instr->object()); | 2774 LOperand* object = UseRegister(instr->object()); |
| 2782 LOperand* index = UseTempRegister(instr->index()); | 2775 LOperand* index = UseTempRegister(instr->index()); |
| 2783 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2776 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2784 } | 2777 } |
| 2785 | 2778 |
| 2786 | 2779 |
| 2787 } } // namespace v8::internal | 2780 } } // namespace v8::internal |
| 2788 | 2781 |
| 2789 #endif // V8_TARGET_ARCH_IA32 | 2782 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |