| OLD | NEW |
| 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 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 | 2791 |
| 2792 // Load instance type for both strings. | 2792 // Load instance type for both strings. |
| 2793 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); | 2793 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); |
| 2794 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); | 2794 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); |
| 2795 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2795 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
| 2796 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2796 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
| 2797 | 2797 |
| 2798 // Check that both are flat ASCII strings. | 2798 // Check that both are flat ASCII strings. |
| 2799 const int kFlatAsciiStringMask = | 2799 const int kFlatAsciiStringMask = |
| 2800 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; | 2800 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 2801 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 2801 // Use ASCII_INTERNALIZED_STRING_TYPE because it's internalized bit is zero. |
| 2802 // Since we don't include that bit in the mask above, the test below will |
| 2803 // succeed for ASCII_STRING_TYPE and ASCII_INTERNALIZED_STRING_TYPE. |
| 2804 STATIC_ASSERT(kInternalizedTag == 0); |
| 2805 const int kFlatAsciiStringTag = ASCII_INTERNALIZED_STRING_TYPE; |
| 2802 // Interleave bits from both instance types and compare them in one check. | 2806 // Interleave bits from both instance types and compare them in one check. |
| 2803 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); | 2807 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
| 2804 and_(scratch1, kFlatAsciiStringMask); | 2808 and_(scratch1, kFlatAsciiStringMask); |
| 2805 and_(scratch2, kFlatAsciiStringMask); | 2809 and_(scratch2, kFlatAsciiStringMask); |
| 2806 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2810 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
| 2807 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); | 2811 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); |
| 2808 j(not_equal, failure); | 2812 j(not_equal, failure); |
| 2809 } | 2813 } |
| 2810 | 2814 |
| 2811 | 2815 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3184 j(greater, &no_memento_available); | 3188 j(greater, &no_memento_available); |
| 3185 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), | 3189 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), |
| 3186 Immediate(Handle<Map>(isolate()->heap()->allocation_memento_map()))); | 3190 Immediate(Handle<Map>(isolate()->heap()->allocation_memento_map()))); |
| 3187 bind(&no_memento_available); | 3191 bind(&no_memento_available); |
| 3188 } | 3192 } |
| 3189 | 3193 |
| 3190 | 3194 |
| 3191 } } // namespace v8::internal | 3195 } } // namespace v8::internal |
| 3192 | 3196 |
| 3193 #endif // V8_TARGET_ARCH_IA32 | 3197 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |