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