OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3485 ASSERT_EQ(2, args->length()); | 3485 ASSERT_EQ(2, args->length()); |
3486 VisitForStackValue(args->at(0)); | 3486 VisitForStackValue(args->at(0)); |
3487 VisitForStackValue(args->at(1)); | 3487 VisitForStackValue(args->at(1)); |
3488 | 3488 |
3489 StringCompareStub stub; | 3489 StringCompareStub stub; |
3490 __ CallStub(&stub); | 3490 __ CallStub(&stub); |
3491 context()->Plug(x0); | 3491 context()->Plug(x0); |
3492 } | 3492 } |
3493 | 3493 |
3494 | 3494 |
3495 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { | |
3496 // Load the argument on the stack and call the runtime function. | |
3497 ZoneList<Expression*>* args = expr->arguments(); | |
3498 ASSERT(args->length() == 1); | |
3499 VisitForStackValue(args->at(0)); | |
3500 __ CallRuntime(Runtime::kMath_log, 1); | |
3501 context()->Plug(x0); | |
3502 } | |
3503 | |
3504 | |
3505 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) { | |
3506 // Load the argument on the stack and call the runtime function. | |
3507 ZoneList<Expression*>* args = expr->arguments(); | |
3508 ASSERT(args->length() == 1); | |
3509 VisitForStackValue(args->at(0)); | |
3510 __ CallRuntime(Runtime::kMath_sqrt, 1); | |
3511 context()->Plug(x0); | |
3512 } | |
3513 | |
3514 | |
3515 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | 3495 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
3516 ASM_LOCATION("FullCodeGenerator::EmitCallFunction"); | 3496 ASM_LOCATION("FullCodeGenerator::EmitCallFunction"); |
3517 ZoneList<Expression*>* args = expr->arguments(); | 3497 ZoneList<Expression*>* args = expr->arguments(); |
3518 ASSERT(args->length() >= 2); | 3498 ASSERT(args->length() >= 2); |
3519 | 3499 |
3520 int arg_count = args->length() - 2; // 2 ~ receiver and function. | 3500 int arg_count = args->length() - 2; // 2 ~ receiver and function. |
3521 for (int i = 0; i < arg_count + 1; i++) { | 3501 for (int i = 0; i < arg_count + 1; i++) { |
3522 VisitForStackValue(args->at(i)); | 3502 VisitForStackValue(args->at(i)); |
3523 } | 3503 } |
3524 VisitForAccumulatorValue(args->last()); // Function. | 3504 VisitForAccumulatorValue(args->last()); // Function. |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5006 return previous_; | 4986 return previous_; |
5007 } | 4987 } |
5008 | 4988 |
5009 | 4989 |
5010 #undef __ | 4990 #undef __ |
5011 | 4991 |
5012 | 4992 |
5013 } } // namespace v8::internal | 4993 } } // namespace v8::internal |
5014 | 4994 |
5015 #endif // V8_TARGET_ARCH_ARM64 | 4995 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |