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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ia32/lithium-codegen-ia32.h" | 10 #include "src/ia32/lithium-codegen-ia32.h" |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1144 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
1145 LOperand* context = UseFixed(instr->context(), esi); | 1145 LOperand* context = UseFixed(instr->context(), esi); |
1146 LOperand* function = UseFixed(instr->function(), edi); | 1146 LOperand* function = UseFixed(instr->function(), edi); |
1147 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1147 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
1148 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1148 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1149 } | 1149 } |
1150 | 1150 |
1151 | 1151 |
1152 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1152 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1153 switch (instr->op()) { | 1153 switch (instr->op()) { |
1154 case kMathFloor: return DoMathFloor(instr); | 1154 case kMathFloor: |
1155 case kMathRound: return DoMathRound(instr); | 1155 return DoMathFloor(instr); |
1156 case kMathAbs: return DoMathAbs(instr); | 1156 case kMathRound: |
1157 case kMathLog: return DoMathLog(instr); | 1157 return DoMathRound(instr); |
1158 case kMathExp: return DoMathExp(instr); | 1158 case kMathFround: |
1159 case kMathSqrt: return DoMathSqrt(instr); | 1159 return DoMathFround(instr); |
1160 case kMathPowHalf: return DoMathPowHalf(instr); | 1160 case kMathAbs: |
1161 case kMathClz32: return DoMathClz32(instr); | 1161 return DoMathAbs(instr); |
| 1162 case kMathLog: |
| 1163 return DoMathLog(instr); |
| 1164 case kMathExp: |
| 1165 return DoMathExp(instr); |
| 1166 case kMathSqrt: |
| 1167 return DoMathSqrt(instr); |
| 1168 case kMathPowHalf: |
| 1169 return DoMathPowHalf(instr); |
| 1170 case kMathClz32: |
| 1171 return DoMathClz32(instr); |
1162 default: | 1172 default: |
1163 UNREACHABLE(); | 1173 UNREACHABLE(); |
1164 return NULL; | 1174 return NULL; |
1165 } | 1175 } |
1166 } | 1176 } |
1167 | 1177 |
1168 | 1178 |
1169 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1179 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
1170 LOperand* input = UseRegisterAtStart(instr->value()); | 1180 LOperand* input = UseRegisterAtStart(instr->value()); |
1171 LMathFloor* result = new(zone()) LMathFloor(input); | 1181 LMathFloor* result = new(zone()) LMathFloor(input); |
1172 return AssignEnvironment(DefineAsRegister(result)); | 1182 return AssignEnvironment(DefineAsRegister(result)); |
1173 } | 1183 } |
1174 | 1184 |
1175 | 1185 |
1176 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { | 1186 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { |
1177 LOperand* input = UseRegister(instr->value()); | 1187 LOperand* input = UseRegister(instr->value()); |
1178 LOperand* temp = FixedTemp(xmm4); | 1188 LOperand* temp = FixedTemp(xmm4); |
1179 LMathRound* result = new(zone()) LMathRound(input, temp); | 1189 LMathRound* result = new(zone()) LMathRound(input, temp); |
1180 return AssignEnvironment(DefineAsRegister(result)); | 1190 return AssignEnvironment(DefineAsRegister(result)); |
1181 } | 1191 } |
1182 | 1192 |
1183 | 1193 |
| 1194 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { |
| 1195 LOperand* input = UseRegister(instr->value()); |
| 1196 LMathFround* result = new (zone()) LMathFround(input); |
| 1197 return DefineAsRegister(result); |
| 1198 } |
| 1199 |
| 1200 |
1184 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { | 1201 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { |
1185 LOperand* context = UseAny(instr->context()); // Deferred use. | 1202 LOperand* context = UseAny(instr->context()); // Deferred use. |
1186 LOperand* input = UseRegisterAtStart(instr->value()); | 1203 LOperand* input = UseRegisterAtStart(instr->value()); |
1187 LInstruction* result = | 1204 LInstruction* result = |
1188 DefineSameAsFirst(new(zone()) LMathAbs(context, input)); | 1205 DefineSameAsFirst(new(zone()) LMathAbs(context, input)); |
1189 Representation r = instr->value()->representation(); | 1206 Representation r = instr->value()->representation(); |
1190 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); | 1207 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); |
1191 if (!r.IsDouble()) result = AssignEnvironment(result); | 1208 if (!r.IsDouble()) result = AssignEnvironment(result); |
1192 return result; | 1209 return result; |
1193 } | 1210 } |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 LOperand* function = UseRegisterAtStart(instr->function()); | 2698 LOperand* function = UseRegisterAtStart(instr->function()); |
2682 LAllocateBlockContext* result = | 2699 LAllocateBlockContext* result = |
2683 new(zone()) LAllocateBlockContext(context, function); | 2700 new(zone()) LAllocateBlockContext(context, function); |
2684 return MarkAsCall(DefineFixed(result, esi), instr); | 2701 return MarkAsCall(DefineFixed(result, esi), instr); |
2685 } | 2702 } |
2686 | 2703 |
2687 | 2704 |
2688 } } // namespace v8::internal | 2705 } } // namespace v8::internal |
2689 | 2706 |
2690 #endif // V8_TARGET_ARCH_IA32 | 2707 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |