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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 const char* LArithmeticT::Mnemonic() const { | 158 const char* LArithmeticT::Mnemonic() const { |
159 switch (op()) { | 159 switch (op()) { |
160 case Token::ADD: return "add-t"; | 160 case Token::ADD: return "add-t"; |
161 case Token::SUB: return "sub-t"; | 161 case Token::SUB: return "sub-t"; |
162 case Token::MUL: return "mul-t"; | 162 case Token::MUL: return "mul-t"; |
163 case Token::MOD: return "mod-t"; | 163 case Token::MOD: return "mod-t"; |
164 case Token::DIV: return "div-t"; | 164 case Token::DIV: return "div-t"; |
| 165 case Token::BIT_AND: return "bit-and-t"; |
| 166 case Token::BIT_OR: return "bit-or-t"; |
| 167 case Token::BIT_XOR: return "bit-xor-t"; |
| 168 case Token::SHL: return "sal-t"; |
| 169 case Token::SAR: return "sar-t"; |
| 170 case Token::SHR: return "shr-t"; |
165 default: | 171 default: |
166 UNREACHABLE(); | 172 UNREACHABLE(); |
167 return NULL; | 173 return NULL; |
168 } | 174 } |
169 } | 175 } |
170 | 176 |
171 | 177 |
172 void LGoto::PrintDataTo(StringStream* stream) { | 178 void LGoto::PrintDataTo(StringStream* stream) { |
173 stream->Add("B%d", block_id()); | 179 stream->Add("B%d", block_id()); |
174 } | 180 } |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 738 } |
733 | 739 |
734 | 740 |
735 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { | 741 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { |
736 return AssignEnvironment(new LDeoptimize); | 742 return AssignEnvironment(new LDeoptimize); |
737 } | 743 } |
738 | 744 |
739 | 745 |
740 LInstruction* LChunkBuilder::DoBit(Token::Value op, | 746 LInstruction* LChunkBuilder::DoBit(Token::Value op, |
741 HBitwiseBinaryOperation* instr) { | 747 HBitwiseBinaryOperation* instr) { |
742 ASSERT(instr->representation().IsInteger32()); | 748 if (instr->representation().IsInteger32()) { |
743 ASSERT(instr->left()->representation().IsInteger32()); | 749 ASSERT(instr->left()->representation().IsInteger32()); |
744 ASSERT(instr->right()->representation().IsInteger32()); | 750 ASSERT(instr->right()->representation().IsInteger32()); |
745 | 751 |
746 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); | 752 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); |
747 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); | 753 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); |
748 return DefineSameAsFirst(new LBitI(op, left, right)); | 754 return DefineSameAsFirst(new LBitI(op, left, right)); |
| 755 } else { |
| 756 ASSERT(instr->representation().IsTagged()); |
| 757 ASSERT(instr->left()->representation().IsTagged()); |
| 758 ASSERT(instr->right()->representation().IsTagged()); |
| 759 |
| 760 LOperand* left = UseFixed(instr->left(), edx); |
| 761 LOperand* right = UseFixed(instr->right(), eax); |
| 762 LArithmeticT* result = new LArithmeticT(op, left, right); |
| 763 return MarkAsCall(DefineFixed(result, eax), instr); |
| 764 } |
749 } | 765 } |
750 | 766 |
751 | 767 |
752 LInstruction* LChunkBuilder::DoShift(Token::Value op, | 768 LInstruction* LChunkBuilder::DoShift(Token::Value op, |
753 HBitwiseBinaryOperation* instr) { | 769 HBitwiseBinaryOperation* instr) { |
| 770 if (instr->representation().IsTagged()) { |
| 771 ASSERT(instr->left()->representation().IsTagged()); |
| 772 ASSERT(instr->right()->representation().IsTagged()); |
| 773 |
| 774 LOperand* left = UseFixed(instr->left(), edx); |
| 775 LOperand* right = UseFixed(instr->right(), eax); |
| 776 LArithmeticT* result = new LArithmeticT(op, left, right); |
| 777 return MarkAsCall(DefineFixed(result, eax), instr); |
| 778 } |
| 779 |
754 ASSERT(instr->representation().IsInteger32()); | 780 ASSERT(instr->representation().IsInteger32()); |
755 ASSERT(instr->OperandAt(0)->representation().IsInteger32()); | 781 ASSERT(instr->OperandAt(0)->representation().IsInteger32()); |
756 ASSERT(instr->OperandAt(1)->representation().IsInteger32()); | 782 ASSERT(instr->OperandAt(1)->representation().IsInteger32()); |
757 LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); | 783 LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); |
758 | 784 |
759 HValue* right_value = instr->OperandAt(1); | 785 HValue* right_value = instr->OperandAt(1); |
760 LOperand* right = NULL; | 786 LOperand* right = NULL; |
761 int constant_value = 0; | 787 int constant_value = 0; |
762 if (right_value->IsConstant()) { | 788 if (right_value->IsConstant()) { |
763 HConstant* constant = HConstant::cast(right_value); | 789 HConstant* constant = HConstant::cast(right_value); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1912 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
1887 HEnvironment* outer = current_block_->last_environment()->outer(); | 1913 HEnvironment* outer = current_block_->last_environment()->outer(); |
1888 current_block_->UpdateEnvironment(outer); | 1914 current_block_->UpdateEnvironment(outer); |
1889 return NULL; | 1915 return NULL; |
1890 } | 1916 } |
1891 | 1917 |
1892 | 1918 |
1893 } } // namespace v8::internal | 1919 } } // namespace v8::internal |
1894 | 1920 |
1895 #endif // V8_TARGET_ARCH_IA32 | 1921 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |