| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/platform/platform.h" | 7 #include "src/base/platform/platform.h" |
| 8 #include "src/full-codegen.h" | 8 #include "src/full-codegen.h" |
| 9 #include "src/heap/mark-compact.h" | 9 #include "src/heap/mark-compact.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 2857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2868 uintptr_t limit = base + (page->size() - 1) / MemoryChunk::kAlignment; | 2868 uintptr_t limit = base + (page->size() - 1) / MemoryChunk::kAlignment; |
| 2869 for (uintptr_t key = base; key <= limit; key++) { | 2869 for (uintptr_t key = base; key <= limit; key++) { |
| 2870 HashMap::Entry* entry = chunk_map_.Lookup(reinterpret_cast<void*>(key), | 2870 HashMap::Entry* entry = chunk_map_.Lookup(reinterpret_cast<void*>(key), |
| 2871 static_cast<uint32_t>(key), true); | 2871 static_cast<uint32_t>(key), true); |
| 2872 DCHECK(entry != NULL); | 2872 DCHECK(entry != NULL); |
| 2873 entry->value = page; | 2873 entry->value = page; |
| 2874 } | 2874 } |
| 2875 | 2875 |
| 2876 HeapObject* object = page->GetObject(); | 2876 HeapObject* object = page->GetObject(); |
| 2877 | 2877 |
| 2878 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), object_size); |
| 2879 |
| 2878 if (Heap::ShouldZapGarbage()) { | 2880 if (Heap::ShouldZapGarbage()) { |
| 2879 // Make the object consistent so the heap can be verified in OldSpaceStep. | 2881 // Make the object consistent so the heap can be verified in OldSpaceStep. |
| 2880 // We only need to do this in debug builds or if verify_heap is on. | 2882 // We only need to do this in debug builds or if verify_heap is on. |
| 2881 reinterpret_cast<Object**>(object->address())[0] = | 2883 reinterpret_cast<Object**>(object->address())[0] = |
| 2882 heap()->fixed_array_map(); | 2884 heap()->fixed_array_map(); |
| 2883 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0); | 2885 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0); |
| 2884 } | 2886 } |
| 2885 | 2887 |
| 2886 heap()->incremental_marking()->OldSpaceStep(object_size); | 2888 heap()->incremental_marking()->OldSpaceStep(object_size); |
| 2887 return object; | 2889 return object; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 object->ShortPrint(); | 3101 object->ShortPrint(); |
| 3100 PrintF("\n"); | 3102 PrintF("\n"); |
| 3101 } | 3103 } |
| 3102 printf(" --------------------------------------\n"); | 3104 printf(" --------------------------------------\n"); |
| 3103 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3105 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3104 } | 3106 } |
| 3105 | 3107 |
| 3106 #endif // DEBUG | 3108 #endif // DEBUG |
| 3107 } | 3109 } |
| 3108 } // namespace v8::internal | 3110 } // namespace v8::internal |
| OLD | NEW |