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

Side by Side Diff: src/crankshaft/ppc/lithium-ppc.cc

Issue 1839643007: PPC: [crankshaft] Address the deoptimization loops of Math.floor, Math.round and Math.ceil. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix DEBUG Created 4 years, 8 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/crankshaft/ppc/lithium-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/crankshaft/ppc/lithium-ppc.h" 5 #include "src/crankshaft/ppc/lithium-ppc.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/lithium-inl.h" 10 #include "src/crankshaft/lithium-inl.h"
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 case kMathClz32: 1133 case kMathClz32:
1134 return DoMathClz32(instr); 1134 return DoMathClz32(instr);
1135 default: 1135 default:
1136 UNREACHABLE(); 1136 UNREACHABLE();
1137 return NULL; 1137 return NULL;
1138 } 1138 }
1139 } 1139 }
1140 1140
1141 1141
1142 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { 1142 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
1143 DCHECK(instr->value()->representation().IsDouble());
1143 LOperand* input = UseRegister(instr->value()); 1144 LOperand* input = UseRegister(instr->value());
1144 LMathFloor* result = new (zone()) LMathFloor(input); 1145 if (instr->representation().IsInteger32()) {
1145 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 1146 LMathFloorI* result = new (zone()) LMathFloorI(input);
1147 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1148 } else {
1149 DCHECK(instr->representation().IsDouble());
1150 LMathFloorD* result = new (zone()) LMathFloorD(input);
1151 return DefineAsRegister(result);
1152 }
1146 } 1153 }
1147 1154
1148
1149 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { 1155 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
1156 DCHECK(instr->value()->representation().IsDouble());
1150 LOperand* input = UseRegister(instr->value()); 1157 LOperand* input = UseRegister(instr->value());
1151 LOperand* temp = TempDoubleRegister(); 1158 if (instr->representation().IsInteger32()) {
1152 LMathRound* result = new (zone()) LMathRound(input, temp); 1159 LOperand* temp = TempDoubleRegister();
1153 return AssignEnvironment(DefineAsRegister(result)); 1160 LMathRoundI* result = new (zone()) LMathRoundI(input, temp);
1161 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1162 } else {
1163 DCHECK(instr->representation().IsDouble());
1164 LMathRoundD* result = new (zone()) LMathRoundD(input);
1165 return DefineAsRegister(result);
1166 }
1154 } 1167 }
1155 1168
1156
1157 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { 1169 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
1158 LOperand* input = UseRegister(instr->value()); 1170 LOperand* input = UseRegister(instr->value());
1159 LMathFround* result = new (zone()) LMathFround(input); 1171 LMathFround* result = new (zone()) LMathFround(input);
1160 return DefineAsRegister(result); 1172 return DefineAsRegister(result);
1161 } 1173 }
1162 1174
1163 1175
1164 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { 1176 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
1165 Representation r = instr->value()->representation(); 1177 Representation r = instr->value()->representation();
1166 LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32()) 1178 LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32())
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2524 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2513 LOperand* object = UseRegister(instr->object()); 2525 LOperand* object = UseRegister(instr->object());
2514 LOperand* index = UseTempRegister(instr->index()); 2526 LOperand* index = UseTempRegister(instr->index());
2515 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); 2527 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index);
2516 LInstruction* result = DefineSameAsFirst(load); 2528 LInstruction* result = DefineSameAsFirst(load);
2517 return AssignPointerMap(result); 2529 return AssignPointerMap(result);
2518 } 2530 }
2519 2531
2520 } // namespace internal 2532 } // namespace internal
2521 } // namespace v8 2533 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698