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 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2631 and_(scratch1, object2); | 2631 and_(scratch1, object2); |
2632 JumpIfSmi(scratch1, failure); | 2632 JumpIfSmi(scratch1, failure); |
2633 | 2633 |
2634 // Load instance type for both strings. | 2634 // Load instance type for both strings. |
2635 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); | 2635 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); |
2636 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); | 2636 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); |
2637 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2637 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
2638 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2638 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
2639 | 2639 |
2640 // Check that both are flat ASCII strings. | 2640 // Check that both are flat ASCII strings. |
2641 const int kFlatAsciiStringMask = | 2641 const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask |
2642 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; | 2642 | kStringEncodingMask | kAsciiDataHintTag; |
2643 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 2643 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; |
2644 // Interleave bits from both instance types and compare them in one check. | 2644 // Interleave bits from both instance types and compare them in one check. |
2645 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); | 2645 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 8)); |
| 2646 ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask); |
2646 and_(scratch1, kFlatAsciiStringMask); | 2647 and_(scratch1, kFlatAsciiStringMask); |
2647 and_(scratch2, kFlatAsciiStringMask); | 2648 and_(scratch2, kFlatAsciiStringMask); |
2648 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2649 shl(scratch1, 8); |
2649 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); | 2650 or_(scratch1, scratch2); |
| 2651 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 8)); |
2650 j(not_equal, failure); | 2652 j(not_equal, failure); |
2651 } | 2653 } |
2652 | 2654 |
2653 | 2655 |
2654 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { | 2656 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { |
2655 int frame_alignment = OS::ActivationFrameAlignment(); | 2657 int frame_alignment = OS::ActivationFrameAlignment(); |
2656 if (frame_alignment != 0) { | 2658 if (frame_alignment != 0) { |
2657 // Make stack end at alignment and make room for num_arguments words | 2659 // Make stack end at alignment and make room for num_arguments words |
2658 // and the original value of esp. | 2660 // and the original value of esp. |
2659 mov(scratch, esp); | 2661 mov(scratch, esp); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2977 j(not_equal, call_runtime); | 2979 j(not_equal, call_runtime); |
2978 | 2980 |
2979 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2981 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
2980 cmp(ecx, isolate()->factory()->null_value()); | 2982 cmp(ecx, isolate()->factory()->null_value()); |
2981 j(not_equal, &next); | 2983 j(not_equal, &next); |
2982 } | 2984 } |
2983 | 2985 |
2984 } } // namespace v8::internal | 2986 } } // namespace v8::internal |
2985 | 2987 |
2986 #endif // V8_TARGET_ARCH_IA32 | 2988 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |