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 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4824 __ shl(temp.reg(), kSmiTagSize); | 4824 __ shl(temp.reg(), kSmiTagSize); |
4825 __ jmp(&end); | 4825 __ jmp(&end); |
4826 | 4826 |
4827 // Handle non-flat strings. | 4827 // Handle non-flat strings. |
4828 __ bind(¬_a_flat_string); | 4828 __ bind(¬_a_flat_string); |
4829 __ and_(temp.reg(), kStringRepresentationMask); | 4829 __ and_(temp.reg(), kStringRepresentationMask); |
4830 __ cmp(temp.reg(), kConsStringTag); | 4830 __ cmp(temp.reg(), kConsStringTag); |
4831 __ j(not_equal, &slow_case); | 4831 __ j(not_equal, &slow_case); |
4832 | 4832 |
4833 // ConsString. | 4833 // ConsString. |
| 4834 // Check that the right hand side is the empty string (ie if this is really a |
| 4835 // flat string in a cons string). If that is not the case we would rather go |
| 4836 // to the runtime system now, to flatten the string. |
| 4837 __ mov(temp.reg(), FieldOperand(object.reg(), ConsString::kSecondOffset)); |
| 4838 __ cmp(Operand(temp.reg()), Immediate(Handle<String>(Heap::empty_string()))); |
| 4839 __ j(not_equal, &slow_case); |
4834 // Get the first of the two strings. | 4840 // Get the first of the two strings. |
4835 __ mov(object.reg(), FieldOperand(object.reg(), ConsString::kFirstOffset)); | 4841 __ mov(object.reg(), FieldOperand(object.reg(), ConsString::kFirstOffset)); |
4836 __ jmp(&try_again_with_new_string); | 4842 __ jmp(&try_again_with_new_string); |
4837 | 4843 |
4838 __ bind(&slow_case); | 4844 __ bind(&slow_case); |
4839 // Move the undefined value into the result register, which will | 4845 // Move the undefined value into the result register, which will |
4840 // trigger the slow case. | 4846 // trigger the slow case. |
4841 __ Set(temp.reg(), Immediate(Factory::undefined_value())); | 4847 __ Set(temp.reg(), Immediate(Factory::undefined_value())); |
4842 | 4848 |
4843 __ bind(&end); | 4849 __ bind(&end); |
(...skipping 3282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8126 | 8132 |
8127 int CompareStub::MinorKey() { | 8133 int CompareStub::MinorKey() { |
8128 // Encode the two parameters in a unique 16 bit value. | 8134 // Encode the two parameters in a unique 16 bit value. |
8129 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 8135 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
8130 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 8136 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
8131 } | 8137 } |
8132 | 8138 |
8133 #undef __ | 8139 #undef __ |
8134 | 8140 |
8135 } } // namespace v8::internal | 8141 } } // namespace v8::internal |
OLD | NEW |