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 #include "src/arm/lithium-arm.h" | 7 #include "src/arm/lithium-arm.h" |
8 #include "src/arm/lithium-codegen-arm.h" | 8 #include "src/arm/lithium-codegen-arm.h" |
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1103 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
1104 LOperand* context = UseFixed(instr->context(), cp); | 1104 LOperand* context = UseFixed(instr->context(), cp); |
1105 LOperand* function = UseFixed(instr->function(), r1); | 1105 LOperand* function = UseFixed(instr->function(), r1); |
1106 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1106 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
1107 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1107 return MarkAsCall(DefineFixed(result, r0), 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 kMathFloor: |
1114 case kMathRound: return DoMathRound(instr); | 1114 return DoMathFloor(instr); |
1115 case kMathAbs: return DoMathAbs(instr); | 1115 case kMathRound: |
1116 case kMathLog: return DoMathLog(instr); | 1116 return DoMathRound(instr); |
1117 case kMathExp: return DoMathExp(instr); | 1117 case kMathFround: |
1118 case kMathSqrt: return DoMathSqrt(instr); | 1118 return DoMathFround(instr); |
1119 case kMathPowHalf: return DoMathPowHalf(instr); | 1119 case kMathAbs: |
1120 case kMathClz32: return DoMathClz32(instr); | 1120 return DoMathAbs(instr); |
| 1121 case kMathLog: |
| 1122 return DoMathLog(instr); |
| 1123 case kMathExp: |
| 1124 return DoMathExp(instr); |
| 1125 case kMathSqrt: |
| 1126 return DoMathSqrt(instr); |
| 1127 case kMathPowHalf: |
| 1128 return DoMathPowHalf(instr); |
| 1129 case kMathClz32: |
| 1130 return DoMathClz32(instr); |
1121 default: | 1131 default: |
1122 UNREACHABLE(); | 1132 UNREACHABLE(); |
1123 return NULL; | 1133 return NULL; |
1124 } | 1134 } |
1125 } | 1135 } |
1126 | 1136 |
1127 | 1137 |
1128 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1138 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
1129 LOperand* input = UseRegister(instr->value()); | 1139 LOperand* input = UseRegister(instr->value()); |
1130 LMathFloor* result = new(zone()) LMathFloor(input); | 1140 LMathFloor* result = new(zone()) LMathFloor(input); |
1131 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1141 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
1132 } | 1142 } |
1133 | 1143 |
1134 | 1144 |
1135 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { | 1145 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { |
1136 LOperand* input = UseRegister(instr->value()); | 1146 LOperand* input = UseRegister(instr->value()); |
1137 LOperand* temp = TempDoubleRegister(); | 1147 LOperand* temp = TempDoubleRegister(); |
1138 LMathRound* result = new(zone()) LMathRound(input, temp); | 1148 LMathRound* result = new(zone()) LMathRound(input, temp); |
1139 return AssignEnvironment(DefineAsRegister(result)); | 1149 return AssignEnvironment(DefineAsRegister(result)); |
1140 } | 1150 } |
1141 | 1151 |
1142 | 1152 |
| 1153 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { |
| 1154 LOperand* input = UseRegister(instr->value()); |
| 1155 LMathFround* result = new (zone()) LMathFround(input); |
| 1156 return DefineAsRegister(result); |
| 1157 } |
| 1158 |
| 1159 |
1143 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { | 1160 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { |
1144 Representation r = instr->value()->representation(); | 1161 Representation r = instr->value()->representation(); |
1145 LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32()) | 1162 LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32()) |
1146 ? NULL | 1163 ? NULL |
1147 : UseFixed(instr->context(), cp); | 1164 : UseFixed(instr->context(), cp); |
1148 LOperand* input = UseRegister(instr->value()); | 1165 LOperand* input = UseRegister(instr->value()); |
1149 LInstruction* result = | 1166 LInstruction* result = |
1150 DefineAsRegister(new(zone()) LMathAbs(context, input)); | 1167 DefineAsRegister(new(zone()) LMathAbs(context, input)); |
1151 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); | 1168 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); |
1152 if (!r.IsDouble()) result = AssignEnvironment(result); | 1169 if (!r.IsDouble()) result = AssignEnvironment(result); |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2620 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
2604 HAllocateBlockContext* instr) { | 2621 HAllocateBlockContext* instr) { |
2605 LOperand* context = UseFixed(instr->context(), cp); | 2622 LOperand* context = UseFixed(instr->context(), cp); |
2606 LOperand* function = UseRegisterAtStart(instr->function()); | 2623 LOperand* function = UseRegisterAtStart(instr->function()); |
2607 LAllocateBlockContext* result = | 2624 LAllocateBlockContext* result = |
2608 new(zone()) LAllocateBlockContext(context, function); | 2625 new(zone()) LAllocateBlockContext(context, function); |
2609 return MarkAsCall(DefineFixed(result, cp), instr); | 2626 return MarkAsCall(DefineFixed(result, cp), instr); |
2610 } | 2627 } |
2611 | 2628 |
2612 } } // namespace v8::internal | 2629 } } // namespace v8::internal |
OLD | NEW |