OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 const char* LArithmeticT::Mnemonic() const { | 154 const char* LArithmeticT::Mnemonic() const { |
155 switch (op()) { | 155 switch (op()) { |
156 case Token::ADD: return "add-t"; | 156 case Token::ADD: return "add-t"; |
157 case Token::SUB: return "sub-t"; | 157 case Token::SUB: return "sub-t"; |
158 case Token::MUL: return "mul-t"; | 158 case Token::MUL: return "mul-t"; |
159 case Token::MOD: return "mod-t"; | 159 case Token::MOD: return "mod-t"; |
160 case Token::DIV: return "div-t"; | 160 case Token::DIV: return "div-t"; |
| 161 case Token::BIT_AND: return "bit-and-t"; |
| 162 case Token::BIT_OR: return "bit-or-t"; |
| 163 case Token::BIT_XOR: return "bit-xor-t"; |
161 default: | 164 default: |
162 UNREACHABLE(); | 165 UNREACHABLE(); |
163 return NULL; | 166 return NULL; |
164 } | 167 } |
165 } | 168 } |
166 | 169 |
167 | 170 |
168 void LGoto::PrintDataTo(StringStream* stream) { | 171 void LGoto::PrintDataTo(StringStream* stream) { |
169 stream->Add("B%d", block_id()); | 172 stream->Add("B%d", block_id()); |
170 } | 173 } |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 } | 746 } |
744 | 747 |
745 | 748 |
746 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { | 749 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { |
747 return AssignEnvironment(new LDeoptimize); | 750 return AssignEnvironment(new LDeoptimize); |
748 } | 751 } |
749 | 752 |
750 | 753 |
751 LInstruction* LChunkBuilder::DoBit(Token::Value op, | 754 LInstruction* LChunkBuilder::DoBit(Token::Value op, |
752 HBitwiseBinaryOperation* instr) { | 755 HBitwiseBinaryOperation* instr) { |
753 ASSERT(instr->representation().IsInteger32()); | 756 if (instr->representation().IsInteger32()) { |
754 ASSERT(instr->left()->representation().IsInteger32()); | 757 ASSERT(instr->left()->representation().IsInteger32()); |
755 ASSERT(instr->right()->representation().IsInteger32()); | 758 ASSERT(instr->right()->representation().IsInteger32()); |
756 | 759 |
757 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); | 760 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); |
758 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); | 761 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); |
759 return DefineSameAsFirst(new LBitI(op, left, right)); | 762 return DefineSameAsFirst(new LBitI(op, left, right)); |
| 763 } else { |
| 764 ASSERT(instr->representation().IsTagged()); |
| 765 ASSERT(instr->left()->representation().IsTagged()); |
| 766 ASSERT(instr->right()->representation().IsTagged()); |
| 767 |
| 768 LOperand* left = UseFixed(instr->left(), r1); |
| 769 LOperand* right = UseFixed(instr->right(), r0); |
| 770 LArithmeticT* result = new LArithmeticT(op, left, right); |
| 771 return MarkAsCall(DefineFixed(result, r0), instr); |
| 772 } |
760 } | 773 } |
761 | 774 |
762 | 775 |
763 LInstruction* LChunkBuilder::DoShift(Token::Value op, | 776 LInstruction* LChunkBuilder::DoShift(Token::Value op, |
764 HBitwiseBinaryOperation* instr) { | 777 HBitwiseBinaryOperation* instr) { |
765 ASSERT(instr->representation().IsInteger32()); | 778 ASSERT(instr->representation().IsInteger32()); |
766 ASSERT(instr->OperandAt(0)->representation().IsInteger32()); | 779 ASSERT(instr->OperandAt(0)->representation().IsInteger32()); |
767 ASSERT(instr->OperandAt(1)->representation().IsInteger32()); | 780 ASSERT(instr->OperandAt(1)->representation().IsInteger32()); |
768 LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); | 781 LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); |
769 | 782 |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 | 1920 |
1908 | 1921 |
1909 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1922 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
1910 HEnvironment* outer = current_block_->last_environment()->outer(); | 1923 HEnvironment* outer = current_block_->last_environment()->outer(); |
1911 current_block_->UpdateEnvironment(outer); | 1924 current_block_->UpdateEnvironment(outer); |
1912 return NULL; | 1925 return NULL; |
1913 } | 1926 } |
1914 | 1927 |
1915 | 1928 |
1916 } } // namespace v8::internal | 1929 } } // namespace v8::internal |
OLD | NEW |