| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 | 1204 |
| 1205 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1205 LInstruction* LChunkBuilder::DoCallConstantFunction( |
| 1206 HCallConstantFunction* instr) { | 1206 HCallConstantFunction* instr) { |
| 1207 argument_count_ -= instr->argument_count(); | 1207 argument_count_ -= instr->argument_count(); |
| 1208 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr); | 1208 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 | 1211 |
| 1212 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1212 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1213 BuiltinFunctionId op = instr->op(); | 1213 BuiltinFunctionId op = instr->op(); |
| 1214 LOperand* input = UseRegisterAtStart(instr->value()); | 1214 if (op == kMathLog || op == kMathSin || op == kMathCos) { |
| 1215 LOperand* temp = (op == kMathFloor) ? TempRegister() : NULL; | 1215 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1216 LUnaryMathOperation* result = new LUnaryMathOperation(input, temp); | 1216 LUnaryMathOperation* result = new LUnaryMathOperation(input, NULL); |
| 1217 switch (op) { | 1217 return MarkAsCall(DefineFixedDouble(result, d2), instr); |
| 1218 case kMathAbs: | 1218 } else { |
| 1219 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1219 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1220 case kMathFloor: | 1220 LOperand* temp = (op == kMathFloor) ? TempRegister() : NULL; |
| 1221 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1221 LUnaryMathOperation* result = new LUnaryMathOperation(input, temp); |
| 1222 case kMathSqrt: | 1222 switch (op) { |
| 1223 return DefineSameAsFirst(result); | 1223 case kMathAbs: |
| 1224 case kMathRound: | 1224 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| 1225 return AssignEnvironment(DefineAsRegister(result)); | 1225 case kMathFloor: |
| 1226 case kMathPowHalf: | 1226 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1227 Abort("MathPowHalf LUnaryMathOperation not implemented"); | 1227 case kMathSqrt: |
| 1228 return NULL; | 1228 return DefineSameAsFirst(result); |
| 1229 case kMathLog: | 1229 case kMathRound: |
| 1230 Abort("MathLog LUnaryMathOperation not implemented"); | 1230 return AssignEnvironment(DefineAsRegister(result)); |
| 1231 return NULL; | 1231 case kMathPowHalf: |
| 1232 case kMathCos: | 1232 Abort("MathPowHalf LUnaryMathOperation not implemented"); |
| 1233 Abort("MathCos LUnaryMathOperation not implemented"); | 1233 return NULL; |
| 1234 return NULL; | 1234 default: |
| 1235 case kMathSin: | 1235 UNREACHABLE(); |
| 1236 Abort("MathSin LUnaryMathOperation not implemented"); | 1236 return NULL; |
| 1237 return NULL; | 1237 } |
| 1238 default: | |
| 1239 UNREACHABLE(); | |
| 1240 return NULL; | |
| 1241 } | 1238 } |
| 1242 } | 1239 } |
| 1243 | 1240 |
| 1244 | 1241 |
| 1245 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { | 1242 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { |
| 1246 ASSERT(instr->key()->representation().IsTagged()); | 1243 ASSERT(instr->key()->representation().IsTagged()); |
| 1247 argument_count_ -= instr->argument_count(); | 1244 argument_count_ -= instr->argument_count(); |
| 1248 LOperand* key = UseFixed(instr->key(), r2); | 1245 LOperand* key = UseFixed(instr->key(), r2); |
| 1249 return MarkAsCall(DefineFixed(new LCallKeyed(key), r0), instr); | 1246 return MarkAsCall(DefineFixed(new LCallKeyed(key), r0), instr); |
| 1250 } | 1247 } |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 | 2030 |
| 2034 | 2031 |
| 2035 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2032 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2036 HEnvironment* outer = current_block_->last_environment()->outer(); | 2033 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2037 current_block_->UpdateEnvironment(outer); | 2034 current_block_->UpdateEnvironment(outer); |
| 2038 return NULL; | 2035 return NULL; |
| 2039 } | 2036 } |
| 2040 | 2037 |
| 2041 | 2038 |
| 2042 } } // namespace v8::internal | 2039 } } // namespace v8::internal |
| OLD | NEW |