| 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 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2608 | 2608 |
| 2609 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii( | 2609 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii( |
| 2610 Register instance_type, | 2610 Register instance_type, |
| 2611 Register scratch, | 2611 Register scratch, |
| 2612 Label* failure) { | 2612 Label* failure) { |
| 2613 if (!scratch.is(instance_type)) { | 2613 if (!scratch.is(instance_type)) { |
| 2614 mov(scratch, instance_type); | 2614 mov(scratch, instance_type); |
| 2615 } | 2615 } |
| 2616 and_(scratch, | 2616 and_(scratch, |
| 2617 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask); | 2617 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask); |
| 2618 cmp(scratch, kStringTag | kSeqStringTag | kAsciiStringTag); | 2618 cmp(scratch, kStringTag | kSeqStringTag | kOneByteStringTag); |
| 2619 j(not_equal, failure); | 2619 j(not_equal, failure); |
| 2620 } | 2620 } |
| 2621 | 2621 |
| 2622 | 2622 |
| 2623 void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1, | 2623 void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1, |
| 2624 Register object2, | 2624 Register object2, |
| 2625 Register scratch1, | 2625 Register scratch1, |
| 2626 Register scratch2, | 2626 Register scratch2, |
| 2627 Label* failure) { | 2627 Label* failure) { |
| 2628 // Check that both objects are not smis. | 2628 // Check that both objects are not smis. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2899 // set. | 2899 // set. |
| 2900 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); | 2900 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); |
| 2901 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); | 2901 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); |
| 2902 test_b(instance_type, kExternalStringTag); | 2902 test_b(instance_type, kExternalStringTag); |
| 2903 j(zero, ¬_external, Label::kNear); | 2903 j(zero, ¬_external, Label::kNear); |
| 2904 mov(length, Immediate(ExternalString::kSize)); | 2904 mov(length, Immediate(ExternalString::kSize)); |
| 2905 jmp(&is_data_object, Label::kNear); | 2905 jmp(&is_data_object, Label::kNear); |
| 2906 | 2906 |
| 2907 bind(¬_external); | 2907 bind(¬_external); |
| 2908 // Sequential string, either ASCII or UC16. | 2908 // Sequential string, either ASCII or UC16. |
| 2909 ASSERT(kAsciiStringTag == 0x04); | 2909 ASSERT(kOneByteStringTag == 0x04); |
| 2910 and_(length, Immediate(kStringEncodingMask)); | 2910 and_(length, Immediate(kStringEncodingMask)); |
| 2911 xor_(length, Immediate(kStringEncodingMask)); | 2911 xor_(length, Immediate(kStringEncodingMask)); |
| 2912 add(length, Immediate(0x04)); | 2912 add(length, Immediate(0x04)); |
| 2913 // Value now either 4 (if ASCII) or 8 (if UC16), i.e., char-size shifted | 2913 // Value now either 4 (if ASCII) or 8 (if UC16), i.e., char-size shifted |
| 2914 // by 2. If we multiply the string length as smi by this, it still | 2914 // by 2. If we multiply the string length as smi by this, it still |
| 2915 // won't overflow a 32-bit value. | 2915 // won't overflow a 32-bit value. |
| 2916 ASSERT_EQ(SeqAsciiString::kMaxSize, SeqTwoByteString::kMaxSize); | 2916 ASSERT_EQ(SeqAsciiString::kMaxSize, SeqTwoByteString::kMaxSize); |
| 2917 ASSERT(SeqAsciiString::kMaxSize <= | 2917 ASSERT(SeqAsciiString::kMaxSize <= |
| 2918 static_cast<int>(0xffffffffu >> (2 + kSmiTagSize))); | 2918 static_cast<int>(0xffffffffu >> (2 + kSmiTagSize))); |
| 2919 imul(length, FieldOperand(value, String::kLengthOffset)); | 2919 imul(length, FieldOperand(value, String::kLengthOffset)); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2977 j(not_equal, call_runtime); | 2977 j(not_equal, call_runtime); |
| 2978 | 2978 |
| 2979 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2979 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
| 2980 cmp(ecx, isolate()->factory()->null_value()); | 2980 cmp(ecx, isolate()->factory()->null_value()); |
| 2981 j(not_equal, &next); | 2981 j(not_equal, &next); |
| 2982 } | 2982 } |
| 2983 | 2983 |
| 2984 } } // namespace v8::internal | 2984 } } // namespace v8::internal |
| 2985 | 2985 |
| 2986 #endif // V8_TARGET_ARCH_IA32 | 2986 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |