| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 stream->Add("#%d / ", arity()); | 290 stream->Add("#%d / ", arity()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 | 293 |
| 294 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { | 294 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { |
| 295 stream->Add("/%s ", hydrogen()->OpName()); | 295 stream->Add("/%s ", hydrogen()->OpName()); |
| 296 value()->PrintTo(stream); | 296 value()->PrintTo(stream); |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 void LMathExp::PrintDataTo(StringStream* stream) { |
| 301 value()->PrintTo(stream); |
| 302 } |
| 303 |
| 304 |
| 300 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 305 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
| 301 context()->PrintTo(stream); | 306 context()->PrintTo(stream); |
| 302 stream->Add("[%d]", slot_index()); | 307 stream->Add("[%d]", slot_index()); |
| 303 } | 308 } |
| 304 | 309 |
| 305 | 310 |
| 306 void LStoreContextSlot::PrintDataTo(StringStream* stream) { | 311 void LStoreContextSlot::PrintDataTo(StringStream* stream) { |
| 307 context()->PrintTo(stream); | 312 context()->PrintTo(stream); |
| 308 stream->Add("[%d] <- ", slot_index()); | 313 stream->Add("[%d] <- ", slot_index()); |
| 309 value()->PrintTo(stream); | 314 value()->PrintTo(stream); |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1039 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1035 } | 1040 } |
| 1036 | 1041 |
| 1037 | 1042 |
| 1038 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1043 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1039 BuiltinFunctionId op = instr->op(); | 1044 BuiltinFunctionId op = instr->op(); |
| 1040 if (op == kMathLog || op == kMathSin || op == kMathCos || op == kMathTan) { | 1045 if (op == kMathLog || op == kMathSin || op == kMathCos || op == kMathTan) { |
| 1041 LOperand* input = UseFixedDouble(instr->value(), d2); | 1046 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1042 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, NULL); | 1047 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, NULL); |
| 1043 return MarkAsCall(DefineFixedDouble(result, d2), instr); | 1048 return MarkAsCall(DefineFixedDouble(result, d2), instr); |
| 1049 } else if (op == kMathExp) { |
| 1050 ASSERT(instr->representation().IsDouble()); |
| 1051 ASSERT(instr->value()->representation().IsDouble()); |
| 1052 LOperand* input = UseTempRegister(instr->value()); |
| 1053 LOperand* temp1 = TempRegister(); |
| 1054 LOperand* temp2 = TempRegister(); |
| 1055 LOperand* double_temp = FixedTemp(d3); // Chosen by fair dice roll. |
| 1056 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); |
| 1057 return DefineAsRegister(result); |
| 1044 } else if (op == kMathPowHalf) { | 1058 } else if (op == kMathPowHalf) { |
| 1045 LOperand* input = UseFixedDouble(instr->value(), d2); | 1059 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1046 LOperand* temp = FixedTemp(d3); | 1060 LOperand* temp = FixedTemp(d3); |
| 1047 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, temp); | 1061 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, temp); |
| 1048 return DefineFixedDouble(result, d2); | 1062 return DefineFixedDouble(result, d2); |
| 1049 } else { | 1063 } else { |
| 1050 LOperand* input = UseRegisterAtStart(instr->value()); | 1064 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1051 | 1065 |
| 1052 LOperand* temp = (op == kMathRound) ? FixedTemp(d3) : NULL; | 1066 LOperand* temp = (op == kMathRound) ? FixedTemp(d3) : NULL; |
| 1053 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, temp); | 1067 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input, temp); |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2341 | 2355 |
| 2342 | 2356 |
| 2343 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2357 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2344 LOperand* object = UseRegister(instr->object()); | 2358 LOperand* object = UseRegister(instr->object()); |
| 2345 LOperand* index = UseRegister(instr->index()); | 2359 LOperand* index = UseRegister(instr->index()); |
| 2346 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2360 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2347 } | 2361 } |
| 2348 | 2362 |
| 2349 | 2363 |
| 2350 } } // namespace v8::internal | 2364 } } // namespace v8::internal |
| OLD | NEW |