| 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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 | 1384 |
| 1385 // Checks whether an address/object in a space. | 1385 // Checks whether an address/object in a space. |
| 1386 // Currently used by tests, serialization and heap verification only. | 1386 // Currently used by tests, serialization and heap verification only. |
| 1387 bool InSpace(Address addr, AllocationSpace space); | 1387 bool InSpace(Address addr, AllocationSpace space); |
| 1388 bool InSpace(HeapObject* value, AllocationSpace space); | 1388 bool InSpace(HeapObject* value, AllocationSpace space); |
| 1389 | 1389 |
| 1390 // Finds out which space an object should get promoted to based on its type. | 1390 // Finds out which space an object should get promoted to based on its type. |
| 1391 inline OldSpace* TargetSpace(HeapObject* object); | 1391 inline OldSpace* TargetSpace(HeapObject* object); |
| 1392 static inline AllocationSpace TargetSpaceId(InstanceType type); | 1392 static inline AllocationSpace TargetSpaceId(InstanceType type); |
| 1393 | 1393 |
| 1394 // Checks whether the given object is allowed to be migrated from it's |
| 1395 // current space into the given destination space. Used for debugging. |
| 1396 inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest); |
| 1397 |
| 1394 // Sets the stub_cache_ (only used when expanding the dictionary). | 1398 // Sets the stub_cache_ (only used when expanding the dictionary). |
| 1395 void public_set_code_stubs(UnseededNumberDictionary* value) { | 1399 void public_set_code_stubs(UnseededNumberDictionary* value) { |
| 1396 roots_[kCodeStubsRootIndex] = value; | 1400 roots_[kCodeStubsRootIndex] = value; |
| 1397 } | 1401 } |
| 1398 | 1402 |
| 1399 // Support for computing object sizes for old objects during GCs. Returns | 1403 // Support for computing object sizes for old objects during GCs. Returns |
| 1400 // a function that is guaranteed to be safe for computing object sizes in | 1404 // a function that is guaranteed to be safe for computing object sizes in |
| 1401 // the current GC phase. | 1405 // the current GC phase. |
| 1402 HeapObjectCallback GcSafeSizeOfOldObjectFunction() { | 1406 HeapObjectCallback GcSafeSizeOfOldObjectFunction() { |
| 1403 return gc_safe_size_of_old_object_; | 1407 return gc_safe_size_of_old_object_; |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 ASSERT(sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); | 1865 ASSERT(sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); |
| 1862 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type]++; | 1866 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type]++; |
| 1863 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type] += size; | 1867 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type] += size; |
| 1864 } | 1868 } |
| 1865 } | 1869 } |
| 1866 } | 1870 } |
| 1867 | 1871 |
| 1868 void CheckpointObjectStats(); | 1872 void CheckpointObjectStats(); |
| 1869 | 1873 |
| 1870 // We don't use a ScopedLock here since we want to lock the heap | 1874 // We don't use a ScopedLock here since we want to lock the heap |
| 1871 // only when FLAG_parallel_recompilation is true. | 1875 // only when FLAG_concurrent_recompilation is true. |
| 1872 class RelocationLock { | 1876 class RelocationLock { |
| 1873 public: | 1877 public: |
| 1874 explicit RelocationLock(Heap* heap); | 1878 explicit RelocationLock(Heap* heap); |
| 1875 | 1879 |
| 1876 ~RelocationLock() { | 1880 ~RelocationLock() { |
| 1877 if (FLAG_parallel_recompilation) { | 1881 if (FLAG_concurrent_recompilation) { |
| 1878 #ifdef DEBUG | 1882 #ifdef DEBUG |
| 1879 heap_->relocation_mutex_locked_by_optimizer_thread_ = false; | 1883 heap_->relocation_mutex_locked_by_optimizer_thread_ = false; |
| 1880 #endif // DEBUG | 1884 #endif // DEBUG |
| 1881 heap_->relocation_mutex_->Unlock(); | 1885 heap_->relocation_mutex_->Unlock(); |
| 1882 } | 1886 } |
| 1883 } | 1887 } |
| 1884 | 1888 |
| 1885 #ifdef DEBUG | 1889 #ifdef DEBUG |
| 1886 static bool IsLockedByOptimizerThread(Heap* heap) { | 1890 static bool IsLockedByOptimizerThread(Heap* heap) { |
| 1887 return heap->relocation_mutex_locked_by_optimizer_thread_; | 1891 return heap->relocation_mutex_locked_by_optimizer_thread_; |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3044 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3048 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 3045 | 3049 |
| 3046 private: | 3050 private: |
| 3047 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3051 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3048 }; | 3052 }; |
| 3049 #endif // DEBUG | 3053 #endif // DEBUG |
| 3050 | 3054 |
| 3051 } } // namespace v8::internal | 3055 } } // namespace v8::internal |
| 3052 | 3056 |
| 3053 #endif // V8_HEAP_H_ | 3057 #endif // V8_HEAP_H_ |
| OLD | NEW |