OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 | 1091 |
1092 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1092 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1093 switch (instr->op()) { | 1093 switch (instr->op()) { |
1094 case kMathFloor: return DoMathFloor(instr); | 1094 case kMathFloor: return DoMathFloor(instr); |
1095 case kMathRound: return DoMathRound(instr); | 1095 case kMathRound: return DoMathRound(instr); |
1096 case kMathAbs: return DoMathAbs(instr); | 1096 case kMathAbs: return DoMathAbs(instr); |
1097 case kMathLog: return DoMathLog(instr); | 1097 case kMathLog: return DoMathLog(instr); |
1098 case kMathExp: return DoMathExp(instr); | 1098 case kMathExp: return DoMathExp(instr); |
1099 case kMathSqrt: return DoMathSqrt(instr); | 1099 case kMathSqrt: return DoMathSqrt(instr); |
1100 case kMathPowHalf: return DoMathPowHalf(instr); | 1100 case kMathPowHalf: return DoMathPowHalf(instr); |
| 1101 case kMathClz32: return DoMathClz32(instr); |
1101 default: | 1102 default: |
1102 UNREACHABLE(); | 1103 UNREACHABLE(); |
1103 return NULL; | 1104 return NULL; |
1104 } | 1105 } |
1105 } | 1106 } |
1106 | 1107 |
1107 | 1108 |
1108 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1109 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
1109 LOperand* input = UseRegister(instr->value()); | 1110 LOperand* input = UseRegister(instr->value()); |
1110 LMathFloor* result = new(zone()) LMathFloor(input); | 1111 LMathFloor* result = new(zone()) LMathFloor(input); |
(...skipping 21 matching lines...) Expand all Loading... |
1132 | 1133 |
1133 | 1134 |
1134 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1135 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
1135 ASSERT(instr->representation().IsDouble()); | 1136 ASSERT(instr->representation().IsDouble()); |
1136 ASSERT(instr->value()->representation().IsDouble()); | 1137 ASSERT(instr->value()->representation().IsDouble()); |
1137 LOperand* input = UseFixedDouble(instr->value(), d0); | 1138 LOperand* input = UseFixedDouble(instr->value(), d0); |
1138 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d0), instr); | 1139 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d0), instr); |
1139 } | 1140 } |
1140 | 1141 |
1141 | 1142 |
| 1143 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |
| 1144 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1145 LMathClz32* result = new(zone()) LMathClz32(input); |
| 1146 return DefineAsRegister(result); |
| 1147 } |
| 1148 |
| 1149 |
1142 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1150 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
1143 ASSERT(instr->representation().IsDouble()); | 1151 ASSERT(instr->representation().IsDouble()); |
1144 ASSERT(instr->value()->representation().IsDouble()); | 1152 ASSERT(instr->value()->representation().IsDouble()); |
1145 LOperand* input = UseRegister(instr->value()); | 1153 LOperand* input = UseRegister(instr->value()); |
1146 LOperand* temp1 = TempRegister(); | 1154 LOperand* temp1 = TempRegister(); |
1147 LOperand* temp2 = TempRegister(); | 1155 LOperand* temp2 = TempRegister(); |
1148 LOperand* double_temp = FixedTemp(d3); // Chosen by fair dice roll. | 1156 LOperand* double_temp = FixedTemp(d3); // Chosen by fair dice roll. |
1149 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); | 1157 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); |
1150 return DefineAsRegister(result); | 1158 return DefineAsRegister(result); |
1151 } | 1159 } |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 } | 2476 } |
2469 | 2477 |
2470 | 2478 |
2471 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2479 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2472 LOperand* object = UseRegister(instr->object()); | 2480 LOperand* object = UseRegister(instr->object()); |
2473 LOperand* index = UseRegister(instr->index()); | 2481 LOperand* index = UseRegister(instr->index()); |
2474 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2482 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2475 } | 2483 } |
2476 | 2484 |
2477 } } // namespace v8::internal | 2485 } } // namespace v8::internal |
OLD | NEW |