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/ia32/lithium-ia32.h" | 5 #include "src/crankshaft/ia32/lithium-ia32.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1086 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
1087 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1087 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
1088 result->MarkAsSyntacticTailCall(); | 1088 result->MarkAsSyntacticTailCall(); |
1089 } | 1089 } |
1090 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1090 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1091 } | 1091 } |
1092 | 1092 |
1093 | 1093 |
1094 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1094 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1095 switch (instr->op()) { | 1095 switch (instr->op()) { |
| 1096 case kMathCos: |
| 1097 return DoMathCos(instr); |
1096 case kMathFloor: | 1098 case kMathFloor: |
1097 return DoMathFloor(instr); | 1099 return DoMathFloor(instr); |
1098 case kMathRound: | 1100 case kMathRound: |
1099 return DoMathRound(instr); | 1101 return DoMathRound(instr); |
1100 case kMathFround: | 1102 case kMathFround: |
1101 return DoMathFround(instr); | 1103 return DoMathFround(instr); |
1102 case kMathAbs: | 1104 case kMathAbs: |
1103 return DoMathAbs(instr); | 1105 return DoMathAbs(instr); |
1104 case kMathLog: | 1106 case kMathLog: |
1105 return DoMathLog(instr); | 1107 return DoMathLog(instr); |
1106 case kMathExp: | 1108 case kMathExp: |
1107 return DoMathExp(instr); | 1109 return DoMathExp(instr); |
1108 case kMathSqrt: | 1110 case kMathSqrt: |
1109 return DoMathSqrt(instr); | 1111 return DoMathSqrt(instr); |
1110 case kMathPowHalf: | 1112 case kMathPowHalf: |
1111 return DoMathPowHalf(instr); | 1113 return DoMathPowHalf(instr); |
1112 case kMathClz32: | 1114 case kMathClz32: |
1113 return DoMathClz32(instr); | 1115 return DoMathClz32(instr); |
| 1116 case kMathSin: |
| 1117 return DoMathSin(instr); |
1114 default: | 1118 default: |
1115 UNREACHABLE(); | 1119 UNREACHABLE(); |
1116 return NULL; | 1120 return NULL; |
1117 } | 1121 } |
1118 } | 1122 } |
1119 | 1123 |
1120 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1124 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
1121 DCHECK(instr->value()->representation().IsDouble()); | 1125 DCHECK(instr->value()->representation().IsDouble()); |
1122 LOperand* input = UseRegisterAtStart(instr->value()); | 1126 LOperand* input = UseRegisterAtStart(instr->value()); |
1123 if (instr->representation().IsInteger32()) { | 1127 if (instr->representation().IsInteger32()) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); | 1174 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); |
1171 } | 1175 } |
1172 | 1176 |
1173 | 1177 |
1174 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { | 1178 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |
1175 LOperand* input = UseRegisterAtStart(instr->value()); | 1179 LOperand* input = UseRegisterAtStart(instr->value()); |
1176 LMathClz32* result = new(zone()) LMathClz32(input); | 1180 LMathClz32* result = new(zone()) LMathClz32(input); |
1177 return DefineAsRegister(result); | 1181 return DefineAsRegister(result); |
1178 } | 1182 } |
1179 | 1183 |
| 1184 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { |
| 1185 DCHECK(instr->representation().IsDouble()); |
| 1186 DCHECK(instr->value()->representation().IsDouble()); |
| 1187 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1188 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathCos(input)), instr); |
| 1189 } |
| 1190 |
| 1191 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { |
| 1192 DCHECK(instr->representation().IsDouble()); |
| 1193 DCHECK(instr->value()->representation().IsDouble()); |
| 1194 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1195 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathSin(input)), instr); |
| 1196 } |
1180 | 1197 |
1181 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1198 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
1182 DCHECK(instr->representation().IsDouble()); | 1199 DCHECK(instr->representation().IsDouble()); |
1183 DCHECK(instr->value()->representation().IsDouble()); | 1200 DCHECK(instr->value()->representation().IsDouble()); |
1184 LOperand* input = UseRegisterAtStart(instr->value()); | 1201 LOperand* input = UseRegisterAtStart(instr->value()); |
1185 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathExp(input)), instr); | 1202 return MarkAsCall(DefineSameAsFirst(new (zone()) LMathExp(input)), instr); |
1186 } | 1203 } |
1187 | 1204 |
1188 | 1205 |
1189 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { | 1206 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2563 LOperand* index = UseTempRegister(instr->index()); | 2580 LOperand* index = UseTempRegister(instr->index()); |
2564 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2581 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2565 LInstruction* result = DefineSameAsFirst(load); | 2582 LInstruction* result = DefineSameAsFirst(load); |
2566 return AssignPointerMap(result); | 2583 return AssignPointerMap(result); |
2567 } | 2584 } |
2568 | 2585 |
2569 } // namespace internal | 2586 } // namespace internal |
2570 } // namespace v8 | 2587 } // namespace v8 |
2571 | 2588 |
2572 #endif // V8_TARGET_ARCH_IA32 | 2589 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |