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

Side by Side Diff: src/mips/lithium-mips.cc

Issue 23800005: Refactoring only: Make it clear that MOD is special. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 return DoArithmeticT(op, instr); 754 return DoArithmeticT(op, instr);
755 } 755 }
756 } 756 }
757 757
758 758
759 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, 759 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
760 HArithmeticBinaryOperation* instr) { 760 HArithmeticBinaryOperation* instr) {
761 ASSERT(instr->representation().IsDouble()); 761 ASSERT(instr->representation().IsDouble());
762 ASSERT(instr->left()->representation().IsDouble()); 762 ASSERT(instr->left()->representation().IsDouble());
763 ASSERT(instr->right()->representation().IsDouble()); 763 ASSERT(instr->right()->representation().IsDouble());
764 LOperand* left = NULL;
765 LOperand* right = NULL;
766 if (op == Token::MOD) { 764 if (op == Token::MOD) {
767 left = UseFixedDouble(instr->left(), f2); 765 LOperand* left = UseFixedDouble(instr->left(), f2);
768 right = UseFixedDouble(instr->right(), f4); 766 LOperand* right = UseFixedDouble(instr->right(), f4);
769 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); 767 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
770 // We call a C function for double modulo. It can't trigger a GC. We need 768 // We call a C function for double modulo. It can't trigger a GC. We need
771 // to use fixed result register for the call. 769 // to use fixed result register for the call.
772 // TODO(fschneider): Allow any register as input registers. 770 // TODO(fschneider): Allow any register as input registers.
773 return MarkAsCall(DefineFixedDouble(result, f2), instr); 771 return MarkAsCall(DefineFixedDouble(result, f2), instr);
772 } else {
773 LOperand* left = UseRegisterAtStart(instr->left());
774 LOperand* right = UseRegisterAtStart(instr->right());
775 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
776 return DefineAsRegister(result);
774 } 777 }
775 left = UseRegisterAtStart(instr->left());
776 right = UseRegisterAtStart(instr->right());
777 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
778 return DefineAsRegister(result);
779 } 778 }
780 779
781 780
782 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, 781 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
783 HBinaryOperation* instr) { 782 HBinaryOperation* instr) {
784 HValue* left = instr->left(); 783 HValue* left = instr->left();
785 HValue* right = instr->right(); 784 HValue* right = instr->right();
786 ASSERT(left->representation().IsTagged()); 785 ASSERT(left->representation().IsTagged());
787 ASSERT(right->representation().IsTagged()); 786 ASSERT(right->representation().IsTagged());
788 LOperand* left_operand = UseFixed(left, a1); 787 LOperand* left_operand = UseFixed(left, a1);
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 2507
2509 2508
2510 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2509 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2511 LOperand* object = UseRegister(instr->object()); 2510 LOperand* object = UseRegister(instr->object());
2512 LOperand* index = UseRegister(instr->index()); 2511 LOperand* index = UseRegister(instr->index());
2513 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2512 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2514 } 2513 }
2515 2514
2516 2515
2517 } } // namespace v8::internal 2516 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698