| 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 const int kFlatAsciiStringTag = |
| 2802 kStringTag | kOneByteStringTag | kSeqStringTag; |
| 2802 // Interleave bits from both instance types and compare them in one check. | 2803 // Interleave bits from both instance types and compare them in one check. |
| 2803 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); | 2804 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
| 2804 and_(scratch1, kFlatAsciiStringMask); | 2805 and_(scratch1, kFlatAsciiStringMask); |
| 2805 and_(scratch2, kFlatAsciiStringMask); | 2806 and_(scratch2, kFlatAsciiStringMask); |
| 2806 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2807 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
| 2807 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); | 2808 cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3)); |
| 2808 j(not_equal, failure); | 2809 j(not_equal, failure); |
| 2809 } | 2810 } |
| 2810 | 2811 |
| 2811 | 2812 |
| 2812 void MacroAssembler::JumpIfNotUniqueName(Operand operand, | 2813 void MacroAssembler::JumpIfNotUniqueName(Operand operand, |
| 2813 Label* not_unique_name, | 2814 Label* not_unique_name, |
| 2814 Label::Distance distance) { | 2815 Label::Distance distance) { |
| 2815 STATIC_ASSERT(((SYMBOL_TYPE - 1) & kIsInternalizedMask) == kInternalizedTag); | 2816 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
| 2816 cmp(operand, Immediate(kInternalizedTag)); | 2817 Label succeed; |
| 2817 j(less, not_unique_name, distance); | 2818 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); |
| 2818 cmp(operand, Immediate(SYMBOL_TYPE)); | 2819 j(zero, &succeed); |
| 2819 j(greater, not_unique_name, distance); | 2820 cmpb(operand, static_cast<uint8_t>(SYMBOL_TYPE)); |
| 2821 j(not_equal, not_unique_name, distance); |
| 2822 |
| 2823 bind(&succeed); |
| 2820 } | 2824 } |
| 2821 | 2825 |
| 2822 | 2826 |
| 2823 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { | 2827 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { |
| 2824 int frame_alignment = OS::ActivationFrameAlignment(); | 2828 int frame_alignment = OS::ActivationFrameAlignment(); |
| 2825 if (frame_alignment != 0) { | 2829 if (frame_alignment != 0) { |
| 2826 // Make stack end at alignment and make room for num_arguments words | 2830 // Make stack end at alignment and make room for num_arguments words |
| 2827 // and the original value of esp. | 2831 // and the original value of esp. |
| 2828 mov(scratch, esp); | 2832 mov(scratch, esp); |
| 2829 sub(esp, Immediate((num_arguments + 1) * kPointerSize)); | 2833 sub(esp, Immediate((num_arguments + 1) * kPointerSize)); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3156 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset)); | 3160 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset)); |
| 3157 cmp(ecx, isolate()->factory()->empty_fixed_array()); | 3161 cmp(ecx, isolate()->factory()->empty_fixed_array()); |
| 3158 j(not_equal, call_runtime); | 3162 j(not_equal, call_runtime); |
| 3159 | 3163 |
| 3160 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 3164 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
| 3161 cmp(ecx, isolate()->factory()->null_value()); | 3165 cmp(ecx, isolate()->factory()->null_value()); |
| 3162 j(not_equal, &next); | 3166 j(not_equal, &next); |
| 3163 } | 3167 } |
| 3164 | 3168 |
| 3165 | 3169 |
| 3166 void MacroAssembler::TestJSArrayForAllocationSiteInfo( | 3170 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 3167 Register receiver_reg, | 3171 Register receiver_reg, |
| 3168 Register scratch_reg) { | 3172 Register scratch_reg) { |
| 3169 Label no_info_available; | 3173 Label no_memento_available; |
| 3170 | 3174 |
| 3171 ExternalReference new_space_start = | 3175 ExternalReference new_space_start = |
| 3172 ExternalReference::new_space_start(isolate()); | 3176 ExternalReference::new_space_start(isolate()); |
| 3173 ExternalReference new_space_allocation_top = | 3177 ExternalReference new_space_allocation_top = |
| 3174 ExternalReference::new_space_allocation_top_address(isolate()); | 3178 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3175 | 3179 |
| 3176 lea(scratch_reg, Operand(receiver_reg, | 3180 lea(scratch_reg, Operand(receiver_reg, |
| 3177 JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag)); | 3181 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); |
| 3178 cmp(scratch_reg, Immediate(new_space_start)); | 3182 cmp(scratch_reg, Immediate(new_space_start)); |
| 3179 j(less, &no_info_available); | 3183 j(less, &no_memento_available); |
| 3180 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); | 3184 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); |
| 3181 j(greater, &no_info_available); | 3185 j(greater, &no_memento_available); |
| 3182 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3186 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), |
| 3183 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3187 Immediate(Handle<Map>(isolate()->heap()->allocation_memento_map()))); |
| 3184 bind(&no_info_available); | 3188 bind(&no_memento_available); |
| 3185 } | 3189 } |
| 3186 | 3190 |
| 3187 | 3191 |
| 3188 } } // namespace v8::internal | 3192 } } // namespace v8::internal |
| 3189 | 3193 |
| 3190 #endif // V8_TARGET_ARCH_IA32 | 3194 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |