OLD | NEW |
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/crankshaft/x87/lithium-x87.h" | 5 #include "src/crankshaft/x87/lithium-x87.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X87 | 9 #if V8_TARGET_ARCH_X87 |
10 | 10 |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1103 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
1104 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1104 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
1105 result->MarkAsSyntacticTailCall(); | 1105 result->MarkAsSyntacticTailCall(); |
1106 } | 1106 } |
1107 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1107 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1108 } | 1108 } |
1109 | 1109 |
1110 | 1110 |
1111 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1111 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1112 switch (instr->op()) { | 1112 switch (instr->op()) { |
1113 case kMathFloor: return DoMathFloor(instr); | 1113 case kMathCos: |
1114 case kMathRound: return DoMathRound(instr); | 1114 return DoMathCos(instr); |
1115 case kMathFround: return DoMathFround(instr); | 1115 case kMathFloor: |
1116 case kMathAbs: return DoMathAbs(instr); | 1116 return DoMathFloor(instr); |
1117 case kMathLog: return DoMathLog(instr); | 1117 case kMathRound: |
1118 case kMathExp: return DoMathExp(instr); | 1118 return DoMathRound(instr); |
1119 case kMathSqrt: return DoMathSqrt(instr); | 1119 case kMathFround: |
1120 case kMathPowHalf: return DoMathPowHalf(instr); | 1120 return DoMathFround(instr); |
1121 case kMathClz32: return DoMathClz32(instr); | 1121 case kMathAbs: |
| 1122 return DoMathAbs(instr); |
| 1123 case kMathLog: |
| 1124 return DoMathLog(instr); |
| 1125 case kMathExp: |
| 1126 return DoMathExp(instr); |
| 1127 case kMathSqrt: |
| 1128 return DoMathSqrt(instr); |
| 1129 case kMathPowHalf: |
| 1130 return DoMathPowHalf(instr); |
| 1131 case kMathClz32: |
| 1132 return DoMathClz32(instr); |
| 1133 case kMathSin: |
| 1134 return DoMathSin(instr); |
1122 default: | 1135 default: |
1123 UNREACHABLE(); | 1136 UNREACHABLE(); |
1124 return NULL; | 1137 return NULL; |
1125 } | 1138 } |
1126 } | 1139 } |
1127 | 1140 |
1128 | 1141 |
1129 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1142 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
1130 LOperand* input = UseRegisterAtStart(instr->value()); | 1143 LOperand* input = UseRegisterAtStart(instr->value()); |
1131 LMathFloor* result = new(zone()) LMathFloor(input); | 1144 LMathFloor* result = new(zone()) LMathFloor(input); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); | 1179 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); |
1167 } | 1180 } |
1168 | 1181 |
1169 | 1182 |
1170 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { | 1183 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |
1171 LOperand* input = UseRegisterAtStart(instr->value()); | 1184 LOperand* input = UseRegisterAtStart(instr->value()); |
1172 LMathClz32* result = new(zone()) LMathClz32(input); | 1185 LMathClz32* result = new(zone()) LMathClz32(input); |
1173 return DefineAsRegister(result); | 1186 return DefineAsRegister(result); |
1174 } | 1187 } |
1175 | 1188 |
| 1189 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { |
| 1190 DCHECK(instr->representation().IsDouble()); |
| 1191 DCHECK(instr->value()->representation().IsDouble()); |
| 1192 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1193 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathCos(input)), instr); |
| 1194 } |
| 1195 |
| 1196 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { |
| 1197 DCHECK(instr->representation().IsDouble()); |
| 1198 DCHECK(instr->value()->representation().IsDouble()); |
| 1199 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1200 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathSin(input)), instr); |
| 1201 } |
1176 | 1202 |
1177 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1203 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
1178 DCHECK(instr->representation().IsDouble()); | 1204 DCHECK(instr->representation().IsDouble()); |
1179 DCHECK(instr->value()->representation().IsDouble()); | 1205 DCHECK(instr->value()->representation().IsDouble()); |
1180 LOperand* input = UseRegisterAtStart(instr->value()); | 1206 LOperand* input = UseRegisterAtStart(instr->value()); |
1181 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathExp(input)), instr); | 1207 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathExp(input)), instr); |
1182 } | 1208 } |
1183 | 1209 |
1184 | 1210 |
1185 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { | 1211 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2553 LOperand* index = UseTempRegister(instr->index()); | 2579 LOperand* index = UseTempRegister(instr->index()); |
2554 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2580 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2555 LInstruction* result = DefineSameAsFirst(load); | 2581 LInstruction* result = DefineSameAsFirst(load); |
2556 return AssignPointerMap(result); | 2582 return AssignPointerMap(result); |
2557 } | 2583 } |
2558 | 2584 |
2559 } // namespace internal | 2585 } // namespace internal |
2560 } // namespace v8 | 2586 } // namespace v8 |
2561 | 2587 |
2562 #endif // V8_TARGET_ARCH_X87 | 2588 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |