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

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

Issue 15932011: Don't explicitly pass requested representations to constants; implement ConstantS (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/x64/lithium-codegen-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 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 ? UseFixed(instr->context(), esi) 2101 ? UseFixed(instr->context(), esi)
2102 : NULL; 2102 : NULL;
2103 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); 2103 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count());
2104 return new(zone()) LReturn(UseFixed(instr->value(), eax), context, 2104 return new(zone()) LReturn(UseFixed(instr->value(), eax), context,
2105 parameter_count); 2105 parameter_count);
2106 } 2106 }
2107 2107
2108 2108
2109 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { 2109 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
2110 Representation r = instr->representation(); 2110 Representation r = instr->representation();
2111 if (r.IsInteger32()) { 2111 if (r.IsSmi()) {
2112 return DefineAsRegister(new(zone()) LConstantS);
2113 } else if (r.IsInteger32()) {
2112 return DefineAsRegister(new(zone()) LConstantI); 2114 return DefineAsRegister(new(zone()) LConstantI);
2113 } else if (r.IsDouble()) { 2115 } else if (r.IsDouble()) {
2114 double value = instr->DoubleValue(); 2116 double value = instr->DoubleValue();
2115 bool value_is_zero = BitCast<uint64_t, double>(value) == 0; 2117 bool value_is_zero = BitCast<uint64_t, double>(value) == 0;
2116 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 2118 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
2117 LOperand* temp = value_is_zero ? NULL : TempRegister(); 2119 LOperand* temp = value_is_zero ? NULL : TempRegister();
2118 return DefineAsRegister(new(zone()) LConstantD(temp)); 2120 return DefineAsRegister(new(zone()) LConstantD(temp));
2119 } else { 2121 } else {
2120 return DefineX87TOS(new(zone()) LConstantD(NULL)); 2122 return DefineX87TOS(new(zone()) LConstantD(NULL));
2121 } 2123 }
2122 } else if (r.IsSmiOrTagged()) { 2124 } else if (r.IsTagged()) {
2123 return DefineAsRegister(new(zone()) LConstantT); 2125 return DefineAsRegister(new(zone()) LConstantT);
2124 } else { 2126 } else {
2125 UNREACHABLE(); 2127 UNREACHABLE();
2126 return NULL; 2128 return NULL;
2127 } 2129 }
2128 } 2130 }
2129 2131
2130 2132
2131 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2133 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
2132 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; 2134 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell;
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2776 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2775 LOperand* object = UseRegister(instr->object()); 2777 LOperand* object = UseRegister(instr->object());
2776 LOperand* index = UseTempRegister(instr->index()); 2778 LOperand* index = UseTempRegister(instr->index());
2777 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2779 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2778 } 2780 }
2779 2781
2780 2782
2781 } } // namespace v8::internal 2783 } } // namespace v8::internal
2782 2784
2783 #endif // V8_TARGET_ARCH_IA32 2785 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698