Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 59153007: Revert "Implement Math.sin, cos and tan using table lookup and spline interpolation." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/sin-cos.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 3643
3644 VisitForStackValue(args->at(0)); 3644 VisitForStackValue(args->at(0));
3645 VisitForStackValue(args->at(1)); 3645 VisitForStackValue(args->at(1));
3646 3646
3647 StringCompareStub stub; 3647 StringCompareStub stub;
3648 __ CallStub(&stub); 3648 __ CallStub(&stub);
3649 context()->Plug(rax); 3649 context()->Plug(rax);
3650 } 3650 }
3651 3651
3652 3652
3653 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { 3653 void FullCodeGenerator::EmitMathSin(CallRuntime* expr) {
3654 // Load the argument on the stack and call the stub. 3654 // Load the argument on the stack and call the stub.
3655 TranscendentalCacheStub stub(TranscendentalCache::LOG, 3655 TranscendentalCacheStub stub(TranscendentalCache::SIN,
3656 TranscendentalCacheStub::TAGGED); 3656 TranscendentalCacheStub::TAGGED);
3657 ZoneList<Expression*>* args = expr->arguments(); 3657 ZoneList<Expression*>* args = expr->arguments();
3658 ASSERT(args->length() == 1); 3658 ASSERT(args->length() == 1);
3659 VisitForStackValue(args->at(0)); 3659 VisitForStackValue(args->at(0));
3660 __ CallStub(&stub); 3660 __ CallStub(&stub);
3661 context()->Plug(rax); 3661 context()->Plug(rax);
3662 } 3662 }
3663 3663
3664 3664
3665 void FullCodeGenerator::EmitMathCos(CallRuntime* expr) {
3666 // Load the argument on the stack and call the stub.
3667 TranscendentalCacheStub stub(TranscendentalCache::COS,
3668 TranscendentalCacheStub::TAGGED);
3669 ZoneList<Expression*>* args = expr->arguments();
3670 ASSERT(args->length() == 1);
3671 VisitForStackValue(args->at(0));
3672 __ CallStub(&stub);
3673 context()->Plug(rax);
3674 }
3675
3676
3677 void FullCodeGenerator::EmitMathTan(CallRuntime* expr) {
3678 // Load the argument on the stack and call the stub.
3679 TranscendentalCacheStub stub(TranscendentalCache::TAN,
3680 TranscendentalCacheStub::TAGGED);
3681 ZoneList<Expression*>* args = expr->arguments();
3682 ASSERT(args->length() == 1);
3683 VisitForStackValue(args->at(0));
3684 __ CallStub(&stub);
3685 context()->Plug(rax);
3686 }
3687
3688
3689 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) {
3690 // Load the argument on the stack and call the stub.
3691 TranscendentalCacheStub stub(TranscendentalCache::LOG,
3692 TranscendentalCacheStub::TAGGED);
3693 ZoneList<Expression*>* args = expr->arguments();
3694 ASSERT(args->length() == 1);
3695 VisitForStackValue(args->at(0));
3696 __ CallStub(&stub);
3697 context()->Plug(rax);
3698 }
3699
3700
3665 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) { 3701 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) {
3666 // Load the argument on the stack and call the runtime function. 3702 // Load the argument on the stack and call the runtime function.
3667 ZoneList<Expression*>* args = expr->arguments(); 3703 ZoneList<Expression*>* args = expr->arguments();
3668 ASSERT(args->length() == 1); 3704 ASSERT(args->length() == 1);
3669 VisitForStackValue(args->at(0)); 3705 VisitForStackValue(args->at(0));
3670 __ CallRuntime(Runtime::kMath_sqrt, 1); 3706 __ CallRuntime(Runtime::kMath_sqrt, 1);
3671 context()->Plug(rax); 3707 context()->Plug(rax);
3672 } 3708 }
3673 3709
3674
3675 void FullCodeGenerator::EmitMathFloor(CallRuntime* expr) {
3676 // Load the argument on the stack and call the runtime function.
3677 ZoneList<Expression*>* args = expr->arguments();
3678 ASSERT(args->length() == 1);
3679 VisitForStackValue(args->at(0));
3680 __ CallRuntime(Runtime::kMath_floor, 1);
3681 context()->Plug(rax);
3682 }
3683
3684 3710
3685 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { 3711 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
3686 ZoneList<Expression*>* args = expr->arguments(); 3712 ZoneList<Expression*>* args = expr->arguments();
3687 ASSERT(args->length() >= 2); 3713 ASSERT(args->length() >= 2);
3688 3714
3689 int arg_count = args->length() - 2; // 2 ~ receiver and function. 3715 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3690 for (int i = 0; i < arg_count + 1; i++) { 3716 for (int i = 0; i < arg_count + 1; i++) {
3691 VisitForStackValue(args->at(i)); 3717 VisitForStackValue(args->at(i));
3692 } 3718 }
3693 VisitForAccumulatorValue(args->last()); // Function. 3719 VisitForAccumulatorValue(args->last()); // Function.
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
4925 4951
4926 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4952 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4927 Assembler::target_address_at(call_target_address)); 4953 Assembler::target_address_at(call_target_address));
4928 return OSR_AFTER_STACK_CHECK; 4954 return OSR_AFTER_STACK_CHECK;
4929 } 4955 }
4930 4956
4931 4957
4932 } } // namespace v8::internal 4958 } } // namespace v8::internal
4933 4959
4934 #endif // V8_TARGET_ARCH_X64 4960 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/sin-cos.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698