| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 | 1212 |
| 1213 | 1213 |
| 1214 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1214 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1215 BuiltinFunctionId op = instr->op(); | 1215 BuiltinFunctionId op = instr->op(); |
| 1216 if (op == kMathLog || op == kMathSin || op == kMathCos) { | 1216 if (op == kMathLog || op == kMathSin || op == kMathCos) { |
| 1217 LOperand* input = UseFixedDouble(instr->value(), d2); | 1217 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1218 LUnaryMathOperation* result = new LUnaryMathOperation(input, NULL); | 1218 LUnaryMathOperation* result = new LUnaryMathOperation(input, NULL); |
| 1219 return MarkAsCall(DefineFixedDouble(result, d2), instr); | 1219 return MarkAsCall(DefineFixedDouble(result, d2), instr); |
| 1220 } else { | 1220 } else { |
| 1221 LOperand* input = UseRegisterAtStart(instr->value()); | 1221 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1222 LOperand* temp = (op == kMathFloor) ? TempRegister() : NULL; | 1222 LOperand* temp = (op == kMathFloor || op == kMathRound) |
| 1223 ? TempRegister() |
| 1224 : NULL; |
| 1223 LUnaryMathOperation* result = new LUnaryMathOperation(input, temp); | 1225 LUnaryMathOperation* result = new LUnaryMathOperation(input, temp); |
| 1224 switch (op) { | 1226 switch (op) { |
| 1225 case kMathAbs: | 1227 case kMathAbs: |
| 1226 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1228 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| 1227 case kMathFloor: | 1229 case kMathFloor: |
| 1228 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1230 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1229 case kMathSqrt: | 1231 case kMathSqrt: |
| 1230 return DefineSameAsFirst(result); | 1232 return DefineSameAsFirst(result); |
| 1231 case kMathRound: | 1233 case kMathRound: |
| 1232 return AssignEnvironment(DefineAsRegister(result)); | 1234 return AssignEnvironment(DefineAsRegister(result)); |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 | 2112 |
| 2111 | 2113 |
| 2112 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2114 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2113 HEnvironment* outer = current_block_->last_environment()->outer(); | 2115 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2114 current_block_->UpdateEnvironment(outer); | 2116 current_block_->UpdateEnvironment(outer); |
| 2115 return NULL; | 2117 return NULL; |
| 2116 } | 2118 } |
| 2117 | 2119 |
| 2118 | 2120 |
| 2119 } } // namespace v8::internal | 2121 } } // namespace v8::internal |
| OLD | NEW |