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

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

Issue 429143003: X87: Inline Math.fround in optimized code. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 4 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/x87/lithium-x87.h ('k') | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/hydrogen-osr.h" 9 #include "src/hydrogen-osr.h"
10 #include "src/lithium-allocator-inl.h" 10 #include "src/lithium-allocator-inl.h"
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 LOperand* function = UseFixed(instr->function(), edi); 1141 LOperand* function = UseFixed(instr->function(), edi);
1142 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); 1142 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
1143 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1143 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1144 } 1144 }
1145 1145
1146 1146
1147 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1147 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1148 switch (instr->op()) { 1148 switch (instr->op()) {
1149 case kMathFloor: return DoMathFloor(instr); 1149 case kMathFloor: return DoMathFloor(instr);
1150 case kMathRound: return DoMathRound(instr); 1150 case kMathRound: return DoMathRound(instr);
1151 case kMathFround: return DoMathFround(instr);
1151 case kMathAbs: return DoMathAbs(instr); 1152 case kMathAbs: return DoMathAbs(instr);
1152 case kMathLog: return DoMathLog(instr); 1153 case kMathLog: return DoMathLog(instr);
1153 case kMathExp: return DoMathExp(instr); 1154 case kMathExp: return DoMathExp(instr);
1154 case kMathSqrt: return DoMathSqrt(instr); 1155 case kMathSqrt: return DoMathSqrt(instr);
1155 case kMathPowHalf: return DoMathPowHalf(instr); 1156 case kMathPowHalf: return DoMathPowHalf(instr);
1156 case kMathClz32: return DoMathClz32(instr); 1157 case kMathClz32: return DoMathClz32(instr);
1157 default: 1158 default:
1158 UNREACHABLE(); 1159 UNREACHABLE();
1159 return NULL; 1160 return NULL;
1160 } 1161 }
1161 } 1162 }
1162 1163
1163 1164
1164 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { 1165 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
1165 LOperand* input = UseRegisterAtStart(instr->value()); 1166 LOperand* input = UseRegisterAtStart(instr->value());
1166 LMathFloor* result = new(zone()) LMathFloor(input); 1167 LMathFloor* result = new(zone()) LMathFloor(input);
1167 return AssignEnvironment(DefineAsRegister(result)); 1168 return AssignEnvironment(DefineAsRegister(result));
1168 } 1169 }
1169 1170
1170 1171
1171 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { 1172 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
1172 // Crankshaft is turned off for nosse2. 1173 // Crankshaft is turned off for nosse2.
1173 UNREACHABLE(); 1174 UNREACHABLE();
1174 return NULL; 1175 return NULL;
1175 } 1176 }
1176 1177
1177 1178
1179 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
1180 LOperand* input = UseRegisterAtStart(instr->value());
1181 LMathFround* result = new (zone()) LMathFround(input);
1182 return AssignEnvironment(DefineAsRegister(result));
1183 }
1184
1185
1178 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { 1186 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
1179 LOperand* context = UseAny(instr->context()); // Deferred use. 1187 LOperand* context = UseAny(instr->context()); // Deferred use.
1180 LOperand* input = UseRegisterAtStart(instr->value()); 1188 LOperand* input = UseRegisterAtStart(instr->value());
1181 LInstruction* result = 1189 LInstruction* result =
1182 DefineSameAsFirst(new(zone()) LMathAbs(context, input)); 1190 DefineSameAsFirst(new(zone()) LMathAbs(context, input));
1183 Representation r = instr->value()->representation(); 1191 Representation r = instr->value()->representation();
1184 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); 1192 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result);
1185 if (!r.IsDouble()) result = AssignEnvironment(result); 1193 if (!r.IsDouble()) result = AssignEnvironment(result);
1186 return result; 1194 return result;
1187 } 1195 }
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 LOperand* function = UseRegisterAtStart(instr->function()); 2674 LOperand* function = UseRegisterAtStart(instr->function());
2667 LAllocateBlockContext* result = 2675 LAllocateBlockContext* result =
2668 new(zone()) LAllocateBlockContext(context, function); 2676 new(zone()) LAllocateBlockContext(context, function);
2669 return MarkAsCall(DefineFixed(result, esi), instr); 2677 return MarkAsCall(DefineFixed(result, esi), instr);
2670 } 2678 }
2671 2679
2672 2680
2673 } } // namespace v8::internal 2681 } } // namespace v8::internal
2674 2682
2675 #endif // V8_TARGET_ARCH_X87 2683 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/lithium-x87.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698