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 3744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3755 | 3755 |
3756 VisitForStackValue(args->at(0)); | 3756 VisitForStackValue(args->at(0)); |
3757 VisitForStackValue(args->at(1)); | 3757 VisitForStackValue(args->at(1)); |
3758 | 3758 |
3759 StringCompareStub stub; | 3759 StringCompareStub stub; |
3760 __ CallStub(&stub); | 3760 __ CallStub(&stub); |
3761 context()->Plug(v0); | 3761 context()->Plug(v0); |
3762 } | 3762 } |
3763 | 3763 |
3764 | 3764 |
3765 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { | 3765 void FullCodeGenerator::EmitMathSin(CallRuntime* expr) { |
3766 // Load the argument on the stack and call the stub. | 3766 // Load the argument on the stack and call the stub. |
3767 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3767 TranscendentalCacheStub stub(TranscendentalCache::SIN, |
3768 TranscendentalCacheStub::TAGGED); | 3768 TranscendentalCacheStub::TAGGED); |
3769 ZoneList<Expression*>* args = expr->arguments(); | 3769 ZoneList<Expression*>* args = expr->arguments(); |
3770 ASSERT(args->length() == 1); | 3770 ASSERT(args->length() == 1); |
3771 VisitForStackValue(args->at(0)); | 3771 VisitForStackValue(args->at(0)); |
3772 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. | 3772 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. |
3773 __ CallStub(&stub); | 3773 __ CallStub(&stub); |
3774 context()->Plug(v0); | 3774 context()->Plug(v0); |
3775 } | 3775 } |
3776 | 3776 |
3777 | 3777 |
| 3778 void FullCodeGenerator::EmitMathCos(CallRuntime* expr) { |
| 3779 // Load the argument on the stack and call the stub. |
| 3780 TranscendentalCacheStub stub(TranscendentalCache::COS, |
| 3781 TranscendentalCacheStub::TAGGED); |
| 3782 ZoneList<Expression*>* args = expr->arguments(); |
| 3783 ASSERT(args->length() == 1); |
| 3784 VisitForStackValue(args->at(0)); |
| 3785 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. |
| 3786 __ CallStub(&stub); |
| 3787 context()->Plug(v0); |
| 3788 } |
| 3789 |
| 3790 |
| 3791 void FullCodeGenerator::EmitMathTan(CallRuntime* expr) { |
| 3792 // Load the argument on the stack and call the stub. |
| 3793 TranscendentalCacheStub stub(TranscendentalCache::TAN, |
| 3794 TranscendentalCacheStub::TAGGED); |
| 3795 ZoneList<Expression*>* args = expr->arguments(); |
| 3796 ASSERT(args->length() == 1); |
| 3797 VisitForStackValue(args->at(0)); |
| 3798 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. |
| 3799 __ CallStub(&stub); |
| 3800 context()->Plug(v0); |
| 3801 } |
| 3802 |
| 3803 |
| 3804 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { |
| 3805 // Load the argument on the stack and call the stub. |
| 3806 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 3807 TranscendentalCacheStub::TAGGED); |
| 3808 ZoneList<Expression*>* args = expr->arguments(); |
| 3809 ASSERT(args->length() == 1); |
| 3810 VisitForStackValue(args->at(0)); |
| 3811 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. |
| 3812 __ CallStub(&stub); |
| 3813 context()->Plug(v0); |
| 3814 } |
| 3815 |
| 3816 |
3778 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) { | 3817 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) { |
3779 // Load the argument on the stack and call the runtime function. | 3818 // Load the argument on the stack and call the runtime function. |
3780 ZoneList<Expression*>* args = expr->arguments(); | 3819 ZoneList<Expression*>* args = expr->arguments(); |
3781 ASSERT(args->length() == 1); | 3820 ASSERT(args->length() == 1); |
3782 VisitForStackValue(args->at(0)); | 3821 VisitForStackValue(args->at(0)); |
3783 __ CallRuntime(Runtime::kMath_sqrt, 1); | 3822 __ CallRuntime(Runtime::kMath_sqrt, 1); |
3784 context()->Plug(v0); | 3823 context()->Plug(v0); |
3785 } | 3824 } |
3786 | 3825 |
3787 | |
3788 void FullCodeGenerator::EmitMathFloor(CallRuntime* expr) { | |
3789 // Load the argument on the stack and call the runtime function. | |
3790 ZoneList<Expression*>* args = expr->arguments(); | |
3791 ASSERT(args->length() == 1); | |
3792 VisitForStackValue(args->at(0)); | |
3793 __ CallRuntime(Runtime::kMath_floor, 1); | |
3794 context()->Plug(v0); | |
3795 } | |
3796 | |
3797 | 3826 |
3798 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | 3827 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
3799 ZoneList<Expression*>* args = expr->arguments(); | 3828 ZoneList<Expression*>* args = expr->arguments(); |
3800 ASSERT(args->length() >= 2); | 3829 ASSERT(args->length() >= 2); |
3801 | 3830 |
3802 int arg_count = args->length() - 2; // 2 ~ receiver and function. | 3831 int arg_count = args->length() - 2; // 2 ~ receiver and function. |
3803 for (int i = 0; i < arg_count + 1; i++) { | 3832 for (int i = 0; i < arg_count + 1; i++) { |
3804 VisitForStackValue(args->at(i)); | 3833 VisitForStackValue(args->at(i)); |
3805 } | 3834 } |
3806 VisitForAccumulatorValue(args->last()); // Function. | 3835 VisitForAccumulatorValue(args->last()); // Function. |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4987 Assembler::target_address_at(pc_immediate_load_address)) == | 5016 Assembler::target_address_at(pc_immediate_load_address)) == |
4988 reinterpret_cast<uint32_t>( | 5017 reinterpret_cast<uint32_t>( |
4989 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5018 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4990 return OSR_AFTER_STACK_CHECK; | 5019 return OSR_AFTER_STACK_CHECK; |
4991 } | 5020 } |
4992 | 5021 |
4993 | 5022 |
4994 } } // namespace v8::internal | 5023 } } // namespace v8::internal |
4995 | 5024 |
4996 #endif // V8_TARGET_ARCH_MIPS | 5025 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |