| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2820 static void CheckLayoutDescriptorAndDie(Heap* heap, Object** slot); | 2820 static void CheckLayoutDescriptorAndDie(Heap* heap, Object** slot); |
| 2821 | 2821 |
| 2822 Heap* heap_; | 2822 Heap* heap_; |
| 2823 }; | 2823 }; |
| 2824 | 2824 |
| 2825 | 2825 |
| 2826 #if V8_TARGET_ARCH_64_BIT | 2826 #if V8_TARGET_ARCH_64_BIT |
| 2827 // TODO(ishell): remove, once crbug/454297 is caught. | 2827 // TODO(ishell): remove, once crbug/454297 is caught. |
| 2828 void PointersUpdatingVisitor::CheckLayoutDescriptorAndDie(Heap* heap, | 2828 void PointersUpdatingVisitor::CheckLayoutDescriptorAndDie(Heap* heap, |
| 2829 Object** slot) { | 2829 Object** slot) { |
| 2830 const int kDataBufferSize = 1280; | 2830 const int kDataBufferSize = 128; |
| 2831 uintptr_t data[kDataBufferSize] = {0}; | 2831 uintptr_t data[kDataBufferSize] = {0}; |
| 2832 int index = 0; | 2832 int index = 0; |
| 2833 data[index++] = 0x10aaaaaaaaUL; // begin marker | 2833 data[index++] = 0x10aaaaaaaaUL; // begin marker |
| 2834 |
| 2835 data[index++] = reinterpret_cast<uintptr_t>(slot); |
| 2836 data[index++] = 0x15aaaaaaaaUL; |
| 2837 |
| 2834 Address slot_address = reinterpret_cast<Address>(slot); | 2838 Address slot_address = reinterpret_cast<Address>(slot); |
| 2835 | 2839 |
| 2836 uintptr_t space_owner_id = 0xb001; | 2840 uintptr_t space_owner_id = 0xb001; |
| 2837 if (heap->new_space()->ToSpaceContains(slot_address)) { | 2841 if (heap->new_space()->ToSpaceContains(slot_address)) { |
| 2838 space_owner_id = 1; | 2842 space_owner_id = 1; |
| 2839 } else if (heap->new_space()->FromSpaceContains(slot_address)) { | 2843 } else if (heap->new_space()->FromSpaceContains(slot_address)) { |
| 2840 space_owner_id = 2; | 2844 space_owner_id = 2; |
| 2841 } else if (heap->old_pointer_space()->ContainsSafe(slot_address)) { | 2845 } else if (heap->old_pointer_space()->ContainsSafe(slot_address)) { |
| 2842 space_owner_id = 3; | 2846 space_owner_id = 3; |
| 2843 } else if (heap->old_data_space()->ContainsSafe(slot_address)) { | 2847 } else if (heap->old_data_space()->ContainsSafe(slot_address)) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2855 space_owner_id = 9; | 2859 space_owner_id = 9; |
| 2856 } | 2860 } |
| 2857 data[index++] = space_owner_id; | 2861 data[index++] = space_owner_id; |
| 2858 data[index++] = 0x20aaaaaaaaUL; | 2862 data[index++] = 0x20aaaaaaaaUL; |
| 2859 | 2863 |
| 2860 // Find map word lying near before the slot address (usually the map word is | 2864 // Find map word lying near before the slot address (usually the map word is |
| 2861 // at -3 words from the slot but just in case we look up further. | 2865 // at -3 words from the slot but just in case we look up further. |
| 2862 Object** map_slot = slot; | 2866 Object** map_slot = slot; |
| 2863 bool found = false; | 2867 bool found = false; |
| 2864 const int kMaxDistanceToMap = 64; | 2868 const int kMaxDistanceToMap = 64; |
| 2865 for (int i = 0; i < kMaxDistanceToMap; i++, map_slot -= kPointerSize) { | 2869 for (int i = 0; i < kMaxDistanceToMap; i++, map_slot--) { |
| 2866 Address map_address = reinterpret_cast<Address>(*map_slot); | 2870 Address map_address = reinterpret_cast<Address>(*map_slot); |
| 2867 if (heap->map_space()->ContainsSafe(map_address)) { | 2871 if (heap->map_space()->ContainsSafe(map_address)) { |
| 2868 found = true; | 2872 found = true; |
| 2869 break; | 2873 break; |
| 2870 } | 2874 } |
| 2871 } | 2875 } |
| 2872 data[index++] = found; | 2876 data[index++] = found; |
| 2873 data[index++] = 0x30aaaaaaaaUL; | 2877 data[index++] = 0x30aaaaaaaaUL; |
| 2878 data[index++] = reinterpret_cast<uintptr_t>(map_slot); |
| 2879 data[index++] = 0x35aaaaaaaaUL; |
| 2880 |
| 2874 if (found) { | 2881 if (found) { |
| 2875 Address obj_address = reinterpret_cast<Address>(map_slot); | 2882 Address obj_address = reinterpret_cast<Address>(map_slot); |
| 2876 Address end_of_page = | 2883 Address end_of_page = |
| 2877 reinterpret_cast<Address>(Page::FromAddress(obj_address)) + | 2884 reinterpret_cast<Address>(Page::FromAddress(obj_address)) + |
| 2878 Page::kPageSize; | 2885 Page::kPageSize; |
| 2879 Address end_address = | 2886 Address end_address = |
| 2880 Min(obj_address + kPointerSize * kMaxDistanceToMap, end_of_page); | 2887 Min(obj_address + kPointerSize * kMaxDistanceToMap, end_of_page); |
| 2881 int size = static_cast<int>(end_address - obj_address); | 2888 int size = static_cast<int>(end_address - obj_address); |
| 2882 data[index++] = size / kPointerSize; | 2889 data[index++] = size / kPointerSize; |
| 2883 data[index++] = 0x40aaaaaaaaUL; | 2890 data[index++] = 0x40aaaaaaaaUL; |
| (...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4418 SlotsBuffer* buffer = *buffer_address; | 4425 SlotsBuffer* buffer = *buffer_address; |
| 4419 while (buffer != NULL) { | 4426 while (buffer != NULL) { |
| 4420 SlotsBuffer* next_buffer = buffer->next(); | 4427 SlotsBuffer* next_buffer = buffer->next(); |
| 4421 DeallocateBuffer(buffer); | 4428 DeallocateBuffer(buffer); |
| 4422 buffer = next_buffer; | 4429 buffer = next_buffer; |
| 4423 } | 4430 } |
| 4424 *buffer_address = NULL; | 4431 *buffer_address = NULL; |
| 4425 } | 4432 } |
| 4426 } | 4433 } |
| 4427 } // namespace v8::internal | 4434 } // namespace v8::internal |
| OLD | NEW |