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

Side by Side Diff: src/ia32/full-codegen-ia32.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/hydrogen.cc ('k') | src/math.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 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 3686
3687 VisitForStackValue(args->at(0)); 3687 VisitForStackValue(args->at(0));
3688 VisitForStackValue(args->at(1)); 3688 VisitForStackValue(args->at(1));
3689 3689
3690 StringCompareStub stub; 3690 StringCompareStub stub;
3691 __ CallStub(&stub); 3691 __ CallStub(&stub);
3692 context()->Plug(eax); 3692 context()->Plug(eax);
3693 } 3693 }
3694 3694
3695 3695
3696 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { 3696 void FullCodeGenerator::EmitMathSin(CallRuntime* expr) {
3697 // Load the argument on the stack and call the stub. 3697 // Load the argument on the stack and call the stub.
3698 TranscendentalCacheStub stub(TranscendentalCache::LOG, 3698 TranscendentalCacheStub stub(TranscendentalCache::SIN,
3699 TranscendentalCacheStub::TAGGED); 3699 TranscendentalCacheStub::TAGGED);
3700 ZoneList<Expression*>* args = expr->arguments(); 3700 ZoneList<Expression*>* args = expr->arguments();
3701 ASSERT(args->length() == 1); 3701 ASSERT(args->length() == 1);
3702 VisitForStackValue(args->at(0)); 3702 VisitForStackValue(args->at(0));
3703 __ CallStub(&stub); 3703 __ CallStub(&stub);
3704 context()->Plug(eax); 3704 context()->Plug(eax);
3705 } 3705 }
3706 3706
3707 3707
3708 void FullCodeGenerator::EmitMathCos(CallRuntime* expr) {
3709 // Load the argument on the stack and call the stub.
3710 TranscendentalCacheStub stub(TranscendentalCache::COS,
3711 TranscendentalCacheStub::TAGGED);
3712 ZoneList<Expression*>* args = expr->arguments();
3713 ASSERT(args->length() == 1);
3714 VisitForStackValue(args->at(0));
3715 __ CallStub(&stub);
3716 context()->Plug(eax);
3717 }
3718
3719
3720 void FullCodeGenerator::EmitMathTan(CallRuntime* expr) {
3721 // Load the argument on the stack and call the stub.
3722 TranscendentalCacheStub stub(TranscendentalCache::TAN,
3723 TranscendentalCacheStub::TAGGED);
3724 ZoneList<Expression*>* args = expr->arguments();
3725 ASSERT(args->length() == 1);
3726 VisitForStackValue(args->at(0));
3727 __ CallStub(&stub);
3728 context()->Plug(eax);
3729 }
3730
3731
3732 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) {
3733 // Load the argument on the stack and call the stub.
3734 TranscendentalCacheStub stub(TranscendentalCache::LOG,
3735 TranscendentalCacheStub::TAGGED);
3736 ZoneList<Expression*>* args = expr->arguments();
3737 ASSERT(args->length() == 1);
3738 VisitForStackValue(args->at(0));
3739 __ CallStub(&stub);
3740 context()->Plug(eax);
3741 }
3742
3743
3708 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) { 3744 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) {
3709 // Load the argument on the stack and call the runtime function. 3745 // Load the argument on the stack and call the runtime function.
3710 ZoneList<Expression*>* args = expr->arguments(); 3746 ZoneList<Expression*>* args = expr->arguments();
3711 ASSERT(args->length() == 1); 3747 ASSERT(args->length() == 1);
3712 VisitForStackValue(args->at(0)); 3748 VisitForStackValue(args->at(0));
3713 __ CallRuntime(Runtime::kMath_sqrt, 1); 3749 __ CallRuntime(Runtime::kMath_sqrt, 1);
3714 context()->Plug(eax); 3750 context()->Plug(eax);
3715 } 3751 }
3716 3752
3717
3718 void FullCodeGenerator::EmitMathFloor(CallRuntime* expr) {
3719 // Load the argument on the stack and call the runtime function.
3720 ZoneList<Expression*>* args = expr->arguments();
3721 ASSERT(args->length() == 1);
3722 VisitForStackValue(args->at(0));
3723 __ CallRuntime(Runtime::kMath_floor, 1);
3724 context()->Plug(eax);
3725 }
3726
3727 3753
3728 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { 3754 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
3729 ZoneList<Expression*>* args = expr->arguments(); 3755 ZoneList<Expression*>* args = expr->arguments();
3730 ASSERT(args->length() >= 2); 3756 ASSERT(args->length() >= 2);
3731 3757
3732 int arg_count = args->length() - 2; // 2 ~ receiver and function. 3758 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3733 for (int i = 0; i < arg_count + 1; ++i) { 3759 for (int i = 0; i < arg_count + 1; ++i) {
3734 VisitForStackValue(args->at(i)); 3760 VisitForStackValue(args->at(i));
3735 } 3761 }
3736 VisitForAccumulatorValue(args->last()); // Function. 3762 VisitForAccumulatorValue(args->last()); // Function.
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 4969
4944 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4970 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4945 Assembler::target_address_at(call_target_address)); 4971 Assembler::target_address_at(call_target_address));
4946 return OSR_AFTER_STACK_CHECK; 4972 return OSR_AFTER_STACK_CHECK;
4947 } 4973 }
4948 4974
4949 4975
4950 } } // namespace v8::internal 4976 } } // namespace v8::internal
4951 4977
4952 #endif // V8_TARGET_ARCH_IA32 4978 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698