OLD | NEW |
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 5662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5673 *required_shift = 2; | 5673 *required_shift = 2; |
5674 break; | 5674 break; |
5675 default: | 5675 default: |
5676 ASSERT(!IsPowerOf2(known_int)); // That would be very inefficient. | 5676 ASSERT(!IsPowerOf2(known_int)); // That would be very inefficient. |
5677 __ mul(result, source, known_int_register); | 5677 __ mul(result, source, known_int_register); |
5678 *required_shift = 0; | 5678 *required_shift = 0; |
5679 } | 5679 } |
5680 } | 5680 } |
5681 | 5681 |
5682 | 5682 |
| 5683 const char* GenericBinaryOpStub::GetName() { |
| 5684 if (name_ != NULL) return name_; |
| 5685 const int len = 100; |
| 5686 name_ = Bootstrapper::AllocateAutoDeletedArray(len); |
| 5687 if (name_ == NULL) return "OOM"; |
| 5688 const char* op_name = Token::Name(op_); |
| 5689 const char* overwrite_name; |
| 5690 switch (mode_) { |
| 5691 case NO_OVERWRITE: overwrite_name = "Alloc"; break; |
| 5692 case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break; |
| 5693 case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break; |
| 5694 default: overwrite_name = "UnknownOverwrite"; break; |
| 5695 } |
| 5696 |
| 5697 OS::SNPrintF(Vector<char>(name_, len), |
| 5698 "GenericBinaryOpStub_%s_%s%s", |
| 5699 op_name, |
| 5700 overwrite_name, |
| 5701 specialized_on_rhs_ ? "_ConstantRhs" : 0); |
| 5702 return name_; |
| 5703 } |
| 5704 |
| 5705 |
5683 void GenericBinaryOpStub::Generate(MacroAssembler* masm) { | 5706 void GenericBinaryOpStub::Generate(MacroAssembler* masm) { |
5684 // r1 : x | 5707 // r1 : x |
5685 // r0 : y | 5708 // r0 : y |
5686 // result : r0 | 5709 // result : r0 |
5687 | 5710 |
5688 // All ops need to know whether we are dealing with two Smis. Set up r2 to | 5711 // All ops need to know whether we are dealing with two Smis. Set up r2 to |
5689 // tell us that. | 5712 // tell us that. |
5690 __ orr(r2, r1, Operand(r0)); // r2 = x | y; | 5713 __ orr(r2, r1, Operand(r0)); // r2 = x | y; |
5691 | 5714 |
5692 switch (op_) { | 5715 switch (op_) { |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6559 int CompareStub::MinorKey() { | 6582 int CompareStub::MinorKey() { |
6560 // Encode the two parameters in a unique 16 bit value. | 6583 // Encode the two parameters in a unique 16 bit value. |
6561 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6584 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6562 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6585 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6563 } | 6586 } |
6564 | 6587 |
6565 | 6588 |
6566 #undef __ | 6589 #undef __ |
6567 | 6590 |
6568 } } // namespace v8::internal | 6591 } } // namespace v8::internal |
OLD | NEW |