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

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

Issue 22824003: Eliminate Smi check when changing from Smi to Integer32 (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: rebase to latest source 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
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/x64/lithium-x64.cc » ('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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 return AssignEnvironment(DefineAsRegister(res)); 1922 return AssignEnvironment(DefineAsRegister(res));
1923 } else if (to.IsSmi()) { 1923 } else if (to.IsSmi()) {
1924 HValue* val = instr->value(); 1924 HValue* val = instr->value();
1925 LOperand* value = UseRegister(val); 1925 LOperand* value = UseRegister(val);
1926 if (val->type().IsSmi()) { 1926 if (val->type().IsSmi()) {
1927 return DefineSameAsFirst(new(zone()) LDummyUse(value)); 1927 return DefineSameAsFirst(new(zone()) LDummyUse(value));
1928 } 1928 }
1929 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1929 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
1930 } else { 1930 } else {
1931 ASSERT(to.IsInteger32()); 1931 ASSERT(to.IsInteger32());
1932 if (instr->value()->type().IsSmi()) { 1932 HValue* val = instr->value();
1933 LOperand* value = UseRegister(instr->value()); 1933 if (val->type().IsSmi() || val->representation().IsSmi()) {
1934 LOperand* value = UseRegister(val);
1934 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); 1935 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
1935 } else { 1936 } else {
1936 bool truncating = instr->CanTruncateToInt32(); 1937 bool truncating = instr->CanTruncateToInt32();
1937 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 1938 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
1938 LOperand* value = UseRegister(instr->value()); 1939 LOperand* value = UseRegister(val);
1939 LOperand* xmm_temp = 1940 LOperand* xmm_temp =
1940 (truncating && CpuFeatures::IsSupported(SSE3)) 1941 (truncating && CpuFeatures::IsSupported(SSE3))
1941 ? NULL 1942 ? NULL
1942 : FixedTemp(xmm1); 1943 : FixedTemp(xmm1);
1943 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); 1944 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp);
1944 return AssignEnvironment(DefineSameAsFirst(res)); 1945 return AssignEnvironment(DefineSameAsFirst(res));
1945 } else { 1946 } else {
1946 LOperand* value = UseFixed(instr->value(), ecx); 1947 LOperand* value = UseFixed(val, ecx);
1947 LTaggedToINoSSE2* res = 1948 LTaggedToINoSSE2* res =
1948 new(zone()) LTaggedToINoSSE2(value, TempRegister(), 1949 new(zone()) LTaggedToINoSSE2(value, TempRegister(),
1949 TempRegister(), TempRegister()); 1950 TempRegister(), TempRegister());
1950 return AssignEnvironment(DefineFixed(res, ecx)); 1951 return AssignEnvironment(DefineFixed(res, ecx));
1951 } 1952 }
1952 } 1953 }
1953 } 1954 }
1954 } else if (from.IsDouble()) { 1955 } else if (from.IsDouble()) {
1955 if (to.IsTagged()) { 1956 if (to.IsTagged()) {
1956 info()->MarkAsDeferredCalling(); 1957 info()->MarkAsDeferredCalling();
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2713 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2713 LOperand* object = UseRegister(instr->object()); 2714 LOperand* object = UseRegister(instr->object());
2714 LOperand* index = UseTempRegister(instr->index()); 2715 LOperand* index = UseTempRegister(instr->index());
2715 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2716 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2716 } 2717 }
2717 2718
2718 2719
2719 } } // namespace v8::internal 2720 } } // namespace v8::internal
2720 2721
2721 #endif // V8_TARGET_ARCH_IA32 2722 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698