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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 125121: Optimize Math.sin and Math.cos by avoiding runtime calls. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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/arm/codegen-arm.h ('k') | src/arm/codegen-arm-inl.h » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3407 3407
3408 void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) { 3408 void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
3409 VirtualFrame::SpilledScope spilled_scope; 3409 VirtualFrame::SpilledScope spilled_scope;
3410 ASSERT(args->length() == 0); 3410 ASSERT(args->length() == 0);
3411 __ Call(ExternalReference::random_positive_smi_function().address(), 3411 __ Call(ExternalReference::random_positive_smi_function().address(),
3412 RelocInfo::RUNTIME_ENTRY); 3412 RelocInfo::RUNTIME_ENTRY);
3413 frame_->EmitPush(r0); 3413 frame_->EmitPush(r0);
3414 } 3414 }
3415 3415
3416 3416
3417 void CodeGenerator::GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args) {
3418 VirtualFrame::SpilledScope spilled_scope;
3419 Load(args->at(0));
3420 switch (op) {
3421 case SIN:
3422 __ CallRuntime(Runtime::kMath_sin, 1);
3423 break;
3424 case COS:
3425 __ CallRuntime(Runtime::kMath_cos, 1);
3426 break;
3427 }
3428 frame_->EmitPush(r0);
3429 }
3430
3431
3417 void CodeGenerator::GenerateObjectEquals(ZoneList<Expression*>* args) { 3432 void CodeGenerator::GenerateObjectEquals(ZoneList<Expression*>* args) {
3418 VirtualFrame::SpilledScope spilled_scope; 3433 VirtualFrame::SpilledScope spilled_scope;
3419 ASSERT(args->length() == 2); 3434 ASSERT(args->length() == 2);
3420 3435
3421 // Load the two objects into registers and perform the comparison. 3436 // Load the two objects into registers and perform the comparison.
3422 LoadAndSpill(args->at(0)); 3437 LoadAndSpill(args->at(0));
3423 LoadAndSpill(args->at(1)); 3438 LoadAndSpill(args->at(1));
3424 frame_->EmitPop(r0); 3439 frame_->EmitPop(r0);
3425 frame_->EmitPop(r1); 3440 frame_->EmitPop(r1);
3426 __ cmp(r0, Operand(r1)); 3441 __ cmp(r0, Operand(r1));
(...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after
5662 __ mov(r2, Operand(0)); 5677 __ mov(r2, Operand(0));
5663 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 5678 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
5664 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 5679 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
5665 RelocInfo::CODE_TARGET); 5680 RelocInfo::CODE_TARGET);
5666 } 5681 }
5667 5682
5668 5683
5669 #undef __ 5684 #undef __
5670 5685
5671 } } // namespace v8::internal 5686 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/arm/codegen-arm-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698