Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 22290005: Move ToI conversions to the MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 return DefineSameAsFirst(new(zone()) LDummyUse(value)); 1937 return DefineSameAsFirst(new(zone()) LDummyUse(value));
1938 } 1938 }
1939 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1939 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
1940 } else { 1940 } else {
1941 ASSERT(to.IsInteger32()); 1941 ASSERT(to.IsInteger32());
1942 if (instr->value()->type().IsSmi()) { 1942 if (instr->value()->type().IsSmi()) {
1943 LOperand* value = UseRegister(instr->value()); 1943 LOperand* value = UseRegister(instr->value());
1944 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); 1944 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
1945 } else { 1945 } else {
1946 bool truncating = instr->CanTruncateToInt32(); 1946 bool truncating = instr->CanTruncateToInt32();
1947 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 1947 LOperand* value = UseRegister(instr->value());
1948 LOperand* value = UseRegister(instr->value()); 1948 LOperand* xmm_temp =
1949 LOperand* xmm_temp = 1949 (CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating)
1950 (truncating && CpuFeatures::IsSupported(SSE3)) 1950 ? FixedTemp(xmm1) : NULL;
1951 ? NULL 1951 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp);
1952 : FixedTemp(xmm1); 1952 return AssignEnvironment(DefineSameAsFirst(res));
1953 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp);
1954 return AssignEnvironment(DefineSameAsFirst(res));
1955 } else {
1956 LOperand* value = UseFixed(instr->value(), ecx);
1957 LTaggedToINoSSE2* res =
1958 new(zone()) LTaggedToINoSSE2(value, TempRegister(),
1959 TempRegister(), TempRegister());
1960 return AssignEnvironment(DefineFixed(res, ecx));
1961 }
1962 } 1953 }
1963 } 1954 }
1964 } else if (from.IsDouble()) { 1955 } else if (from.IsDouble()) {
1965 if (to.IsTagged()) { 1956 if (to.IsTagged()) {
1966 info()->MarkAsDeferredCalling(); 1957 info()->MarkAsDeferredCalling();
1967 LOperand* value = UseRegisterAtStart(instr->value()); 1958 LOperand* value = UseRegisterAtStart(instr->value());
1968 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; 1959 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL;
1969 1960
1970 // Make sure that temp and result_temp are different registers. 1961 // Make sure that temp and result_temp are different registers.
1971 LUnallocated* result_temp = TempRegister(); 1962 LUnallocated* result_temp = TempRegister();
1972 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); 1963 LNumberTagD* result = new(zone()) LNumberTagD(value, temp);
1973 return AssignPointerMap(Define(result, result_temp)); 1964 return AssignPointerMap(Define(result, result_temp));
1974 } else if (to.IsSmi()) { 1965 } else if (to.IsSmi()) {
1975 LOperand* value = UseRegister(instr->value()); 1966 LOperand* value = UseRegister(instr->value());
1976 return AssignEnvironment( 1967 return AssignEnvironment(
1977 DefineAsRegister(new(zone()) LDoubleToSmi(value))); 1968 DefineAsRegister(new(zone()) LDoubleToSmi(value)));
1978 } else { 1969 } else {
1979 ASSERT(to.IsInteger32()); 1970 ASSERT(to.IsInteger32());
1980 bool truncating = instr->CanTruncateToInt32(); 1971 bool truncating = instr->CanTruncateToInt32();
1981 bool needs_temp = truncating && !CpuFeatures::IsSupported(SSE3); 1972 bool needs_temp = CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating;
1982 LOperand* value = needs_temp ? 1973 LOperand* value = needs_temp ?
1983 UseTempRegister(instr->value()) : UseRegister(instr->value()); 1974 UseTempRegister(instr->value()) : UseRegister(instr->value());
1984 LOperand* temp = needs_temp ? TempRegister() : NULL; 1975 LOperand* temp = needs_temp ? TempRegister() : NULL;
1985 return AssignEnvironment( 1976 return AssignEnvironment(
1986 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); 1977 DefineAsRegister(new(zone()) LDoubleToI(value, temp)));
1987 } 1978 }
1988 } else if (from.IsInteger32()) { 1979 } else if (from.IsInteger32()) {
1989 info()->MarkAsDeferredCalling(); 1980 info()->MarkAsDeferredCalling();
1990 if (to.IsTagged()) { 1981 if (to.IsTagged()) {
1991 HValue* val = instr->value(); 1982 HValue* val = instr->value();
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2724 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2734 LOperand* object = UseRegister(instr->object()); 2725 LOperand* object = UseRegister(instr->object());
2735 LOperand* index = UseTempRegister(instr->index()); 2726 LOperand* index = UseTempRegister(instr->index());
2736 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2727 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2737 } 2728 }
2738 2729
2739 2730
2740 } } // namespace v8::internal 2731 } } // namespace v8::internal
2741 2732
2742 #endif // V8_TARGET_ARCH_IA32 2733 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698