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

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

Issue 216643002: Reland "Clean up runtime functions for Maths." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 8 months 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/x64/code-stubs-x64.cc ('k') | no next file » | 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 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 3691
3692 VisitForStackValue(args->at(0)); 3692 VisitForStackValue(args->at(0));
3693 VisitForStackValue(args->at(1)); 3693 VisitForStackValue(args->at(1));
3694 3694
3695 StringCompareStub stub; 3695 StringCompareStub stub;
3696 __ CallStub(&stub); 3696 __ CallStub(&stub);
3697 context()->Plug(rax); 3697 context()->Plug(rax);
3698 } 3698 }
3699 3699
3700 3700
3701 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) {
3702 // Load the argument on the stack and call the runtime function.
3703 ZoneList<Expression*>* args = expr->arguments();
3704 ASSERT(args->length() == 1);
3705 VisitForStackValue(args->at(0));
3706 __ CallRuntime(Runtime::kMath_log, 1);
3707 context()->Plug(rax);
3708 }
3709
3710
3711 void FullCodeGenerator::EmitMathSqrt(CallRuntime* expr) {
3712 // Load the argument on the stack and call the runtime function.
3713 ZoneList<Expression*>* args = expr->arguments();
3714 ASSERT(args->length() == 1);
3715 VisitForStackValue(args->at(0));
3716 __ CallRuntime(Runtime::kMath_sqrt, 1);
3717 context()->Plug(rax);
3718 }
3719
3720
3721 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { 3701 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
3722 ZoneList<Expression*>* args = expr->arguments(); 3702 ZoneList<Expression*>* args = expr->arguments();
3723 ASSERT(args->length() >= 2); 3703 ASSERT(args->length() >= 2);
3724 3704
3725 int arg_count = args->length() - 2; // 2 ~ receiver and function. 3705 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3726 for (int i = 0; i < arg_count + 1; i++) { 3706 for (int i = 0; i < arg_count + 1; i++) {
3727 VisitForStackValue(args->at(i)); 3707 VisitForStackValue(args->at(i));
3728 } 3708 }
3729 VisitForAccumulatorValue(args->last()); // Function. 3709 VisitForAccumulatorValue(args->last()); // Function.
3730 3710
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4912 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4933 Assembler::target_address_at(call_target_address, 4913 Assembler::target_address_at(call_target_address,
4934 unoptimized_code)); 4914 unoptimized_code));
4935 return OSR_AFTER_STACK_CHECK; 4915 return OSR_AFTER_STACK_CHECK;
4936 } 4916 }
4937 4917
4938 4918
4939 } } // namespace v8::internal 4919 } } // namespace v8::internal
4940 4920
4941 #endif // V8_TARGET_ARCH_X64 4921 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698