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 2688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2699 and_(scratch1, object2); | 2699 and_(scratch1, object2); |
2700 JumpIfSmi(scratch1, failure); | 2700 JumpIfSmi(scratch1, failure); |
2701 | 2701 |
2702 // Load instance type for both strings. | 2702 // Load instance type for both strings. |
2703 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); | 2703 mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset)); |
2704 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); | 2704 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); |
2705 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2705 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
2706 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2706 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
2707 | 2707 |
2708 // Check that both are flat ASCII strings. | 2708 // Check that both are flat ASCII strings. |
2709 const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask | 2709 const int kFlatAsciiStringMask = |
2710 | kStringEncodingMask | kAsciiDataHintTag; | 2710 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
2711 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 2711 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; |
2712 // Interleave bits from both instance types and compare them in one check. | 2712 // Interleave bits from both instance types and compare them in one check. |
2713 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 8)); | 2713 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
2714 ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask); | |
2715 and_(scratch1, kFlatAsciiStringMask); | 2714 and_(scratch1, kFlatAsciiStringMask); |
2716 and_(scratch2, kFlatAsciiStringMask); | 2715 and_(scratch2, kFlatAsciiStringMask); |
2717 shl(scratch1, 8); | 2716 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
2718 or_(scratch1, scratch2); | 2717 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); |
2719 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 8)); | |
2720 j(not_equal, failure); | 2718 j(not_equal, failure); |
2721 } | 2719 } |
2722 | 2720 |
2723 | 2721 |
2724 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { | 2722 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { |
2725 int frame_alignment = OS::ActivationFrameAlignment(); | 2723 int frame_alignment = OS::ActivationFrameAlignment(); |
2726 if (frame_alignment != 0) { | 2724 if (frame_alignment != 0) { |
2727 // Make stack end at alignment and make room for num_arguments words | 2725 // Make stack end at alignment and make room for num_arguments words |
2728 // and the original value of esp. | 2726 // and the original value of esp. |
2729 mov(scratch, esp); | 2727 mov(scratch, esp); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3071 cmp(MemOperand(scratch_reg, 0), | 3069 cmp(MemOperand(scratch_reg, 0), |
3072 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3070 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
3073 j(equal, allocation_info_present); | 3071 j(equal, allocation_info_present); |
3074 bind(&no_info_available); | 3072 bind(&no_info_available); |
3075 } | 3073 } |
3076 | 3074 |
3077 | 3075 |
3078 } } // namespace v8::internal | 3076 } } // namespace v8::internal |
3079 | 3077 |
3080 #endif // V8_TARGET_ARCH_IA32 | 3078 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |