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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 | 1174 |
1175 | 1175 |
1176 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1176 LInstruction* LChunkBuilder::DoCallConstantFunction( |
1177 HCallConstantFunction* instr) { | 1177 HCallConstantFunction* instr) { |
1178 argument_count_ -= instr->argument_count(); | 1178 argument_count_ -= instr->argument_count(); |
1179 return MarkAsCall(DefineFixed(new LCallConstantFunction, rax), instr); | 1179 return MarkAsCall(DefineFixed(new LCallConstantFunction, rax), instr); |
1180 } | 1180 } |
1181 | 1181 |
1182 | 1182 |
1183 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1183 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1184 Abort("Unimplemented: %s", "DoUnaryMathOperation"); | 1184 BuiltinFunctionId op = instr->op(); |
1185 return NULL; | 1185 if (op == kMathLog || op == kMathSin || op == kMathCos) { |
| 1186 LOperand* input = UseFixedDouble(instr->value(), xmm1); |
| 1187 LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| 1188 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
| 1189 } else { |
| 1190 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1191 LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| 1192 switch (op) { |
| 1193 case kMathAbs: |
| 1194 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| 1195 case kMathFloor: |
| 1196 return AssignEnvironment(DefineAsRegister(result)); |
| 1197 case kMathRound: |
| 1198 return AssignEnvironment(DefineAsRegister(result)); |
| 1199 case kMathSqrt: |
| 1200 return DefineSameAsFirst(result); |
| 1201 case kMathPowHalf: |
| 1202 return DefineSameAsFirst(result); |
| 1203 default: |
| 1204 UNREACHABLE(); |
| 1205 return NULL; |
| 1206 } |
| 1207 } |
1186 } | 1208 } |
1187 | 1209 |
1188 | 1210 |
1189 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { | 1211 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { |
1190 Abort("Unimplemented: %s", "DoCallKeyed"); | 1212 Abort("Unimplemented: %s", "DoCallKeyed"); |
1191 return NULL; | 1213 return NULL; |
1192 } | 1214 } |
1193 | 1215 |
1194 | 1216 |
1195 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { | 1217 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 | 1935 |
1914 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1936 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
1915 HEnvironment* outer = current_block_->last_environment()->outer(); | 1937 HEnvironment* outer = current_block_->last_environment()->outer(); |
1916 current_block_->UpdateEnvironment(outer); | 1938 current_block_->UpdateEnvironment(outer); |
1917 return NULL; | 1939 return NULL; |
1918 } | 1940 } |
1919 | 1941 |
1920 } } // namespace v8::internal | 1942 } } // namespace v8::internal |
1921 | 1943 |
1922 #endif // V8_TARGET_ARCH_X64 | 1944 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |