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

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

Issue 425943002: Inline Math.fround in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm64 port 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/constant-folding-2.js » ('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 // 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_X64 7 #if V8_TARGET_ARCH_X64
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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { 1124 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
1125 LOperand* context = UseFixed(instr->context(), rsi); 1125 LOperand* context = UseFixed(instr->context(), rsi);
1126 LOperand* function = UseFixed(instr->function(), rdi); 1126 LOperand* function = UseFixed(instr->function(), rdi);
1127 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); 1127 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
1128 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1128 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1129 } 1129 }
1130 1130
1131 1131
1132 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1132 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1133 switch (instr->op()) { 1133 switch (instr->op()) {
1134 case kMathFloor: return DoMathFloor(instr); 1134 case kMathFloor:
1135 case kMathRound: return DoMathRound(instr); 1135 return DoMathFloor(instr);
1136 case kMathAbs: return DoMathAbs(instr); 1136 case kMathRound:
1137 case kMathLog: return DoMathLog(instr); 1137 return DoMathRound(instr);
1138 case kMathExp: return DoMathExp(instr); 1138 case kMathFround:
1139 case kMathSqrt: return DoMathSqrt(instr); 1139 return DoMathFround(instr);
1140 case kMathPowHalf: return DoMathPowHalf(instr); 1140 case kMathAbs:
1141 case kMathClz32: return DoMathClz32(instr); 1141 return DoMathAbs(instr);
1142 case kMathLog:
1143 return DoMathLog(instr);
1144 case kMathExp:
1145 return DoMathExp(instr);
1146 case kMathSqrt:
1147 return DoMathSqrt(instr);
1148 case kMathPowHalf:
1149 return DoMathPowHalf(instr);
1150 case kMathClz32:
1151 return DoMathClz32(instr);
1142 default: 1152 default:
1143 UNREACHABLE(); 1153 UNREACHABLE();
1144 return NULL; 1154 return NULL;
1145 } 1155 }
1146 } 1156 }
1147 1157
1148 1158
1149 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { 1159 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
1150 LOperand* input = UseRegisterAtStart(instr->value()); 1160 LOperand* input = UseRegisterAtStart(instr->value());
1151 LMathFloor* result = new(zone()) LMathFloor(input); 1161 LMathFloor* result = new(zone()) LMathFloor(input);
1152 return AssignEnvironment(DefineAsRegister(result)); 1162 return AssignEnvironment(DefineAsRegister(result));
1153 } 1163 }
1154 1164
1155 1165
1156 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { 1166 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
1157 LOperand* input = UseRegister(instr->value()); 1167 LOperand* input = UseRegister(instr->value());
1158 LOperand* temp = FixedTemp(xmm4); 1168 LOperand* temp = FixedTemp(xmm4);
1159 LMathRound* result = new(zone()) LMathRound(input, temp); 1169 LMathRound* result = new(zone()) LMathRound(input, temp);
1160 return AssignEnvironment(DefineAsRegister(result)); 1170 return AssignEnvironment(DefineAsRegister(result));
1161 } 1171 }
1162 1172
1163 1173
1174 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
1175 LOperand* input = UseRegister(instr->value());
1176 LMathFround* result = new (zone()) LMathFround(input);
1177 return DefineAsRegister(result);
1178 }
1179
1180
1164 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { 1181 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
1165 LOperand* context = UseAny(instr->context()); 1182 LOperand* context = UseAny(instr->context());
1166 LOperand* input = UseRegisterAtStart(instr->value()); 1183 LOperand* input = UseRegisterAtStart(instr->value());
1167 LInstruction* result = 1184 LInstruction* result =
1168 DefineSameAsFirst(new(zone()) LMathAbs(context, input)); 1185 DefineSameAsFirst(new(zone()) LMathAbs(context, input));
1169 Representation r = instr->value()->representation(); 1186 Representation r = instr->value()->representation();
1170 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); 1187 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result);
1171 if (!r.IsDouble()) result = AssignEnvironment(result); 1188 if (!r.IsDouble()) result = AssignEnvironment(result);
1172 return result; 1189 return result;
1173 } 1190 }
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 LOperand* function = UseRegisterAtStart(instr->function()); 2674 LOperand* function = UseRegisterAtStart(instr->function());
2658 LAllocateBlockContext* result = 2675 LAllocateBlockContext* result =
2659 new(zone()) LAllocateBlockContext(context, function); 2676 new(zone()) LAllocateBlockContext(context, function);
2660 return MarkAsCall(DefineFixed(result, rsi), instr); 2677 return MarkAsCall(DefineFixed(result, rsi), instr);
2661 } 2678 }
2662 2679
2663 2680
2664 } } // namespace v8::internal 2681 } } // namespace v8::internal
2665 2682
2666 #endif // V8_TARGET_ARCH_X64 2683 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/constant-folding-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698