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 5402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5413 bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) { | 5413 bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) { |
5414 if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; | 5414 if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; |
5415 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); | 5415 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); |
5416 switch (id) { | 5416 switch (id) { |
5417 case kMathRound: | 5417 case kMathRound: |
5418 case kMathAbs: | 5418 case kMathAbs: |
5419 case kMathSqrt: | 5419 case kMathSqrt: |
5420 case kMathLog: | 5420 case kMathLog: |
5421 case kMathSin: | 5421 case kMathSin: |
5422 case kMathCos: | 5422 case kMathCos: |
| 5423 case kMathTan: |
5423 if (expr->arguments()->length() == 1) { | 5424 if (expr->arguments()->length() == 1) { |
5424 HValue* argument = Pop(); | 5425 HValue* argument = Pop(); |
5425 HValue* context = environment()->LookupContext(); | 5426 HValue* context = environment()->LookupContext(); |
5426 Drop(1); // Receiver. | 5427 Drop(1); // Receiver. |
5427 HUnaryMathOperation* op = | 5428 HUnaryMathOperation* op = |
5428 new(zone()) HUnaryMathOperation(context, argument, id); | 5429 new(zone()) HUnaryMathOperation(context, argument, id); |
5429 op->set_position(expr->position()); | 5430 op->set_position(expr->position()); |
5430 if (drop_extra) Drop(1); // Optionally drop the function. | 5431 if (drop_extra) Drop(1); // Optionally drop the function. |
5431 ast_context()->ReturnInstruction(op, expr->id()); | 5432 ast_context()->ReturnInstruction(op, expr->id()); |
5432 return true; | 5433 return true; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5473 return true; | 5474 return true; |
5474 } | 5475 } |
5475 break; | 5476 break; |
5476 case kMathRound: | 5477 case kMathRound: |
5477 case kMathFloor: | 5478 case kMathFloor: |
5478 case kMathAbs: | 5479 case kMathAbs: |
5479 case kMathSqrt: | 5480 case kMathSqrt: |
5480 case kMathLog: | 5481 case kMathLog: |
5481 case kMathSin: | 5482 case kMathSin: |
5482 case kMathCos: | 5483 case kMathCos: |
| 5484 case kMathTan: |
5483 if (argument_count == 2 && check_type == RECEIVER_MAP_CHECK) { | 5485 if (argument_count == 2 && check_type == RECEIVER_MAP_CHECK) { |
5484 AddCheckConstantFunction(expr, receiver, receiver_map, true); | 5486 AddCheckConstantFunction(expr, receiver, receiver_map, true); |
5485 HValue* argument = Pop(); | 5487 HValue* argument = Pop(); |
5486 HValue* context = environment()->LookupContext(); | 5488 HValue* context = environment()->LookupContext(); |
5487 Drop(1); // Receiver. | 5489 Drop(1); // Receiver. |
5488 HUnaryMathOperation* op = | 5490 HUnaryMathOperation* op = |
5489 new(zone()) HUnaryMathOperation(context, argument, id); | 5491 new(zone()) HUnaryMathOperation(context, argument, id); |
5490 op->set_position(expr->position()); | 5492 op->set_position(expr->position()); |
5491 ast_context()->ReturnInstruction(op, expr->id()); | 5493 ast_context()->ReturnInstruction(op, expr->id()); |
5492 return true; | 5494 return true; |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8045 } | 8047 } |
8046 } | 8048 } |
8047 | 8049 |
8048 #ifdef DEBUG | 8050 #ifdef DEBUG |
8049 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8051 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
8050 if (allocator_ != NULL) allocator_->Verify(); | 8052 if (allocator_ != NULL) allocator_->Verify(); |
8051 #endif | 8053 #endif |
8052 } | 8054 } |
8053 | 8055 |
8054 } } // namespace v8::internal | 8056 } } // namespace v8::internal |
OLD | NEW |