Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: src/heap/heap.h

Issue 904633003: Just visit young array buffers during scavenge. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 String* hidden_string() { return hidden_string_; } 837 String* hidden_string() { return hidden_string_; }
838 838
839 void set_native_contexts_list(Object* object) { 839 void set_native_contexts_list(Object* object) {
840 native_contexts_list_ = object; 840 native_contexts_list_ = object;
841 } 841 }
842 Object* native_contexts_list() const { return native_contexts_list_; } 842 Object* native_contexts_list() const { return native_contexts_list_; }
843 843
844 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; } 844 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; }
845 Object* array_buffers_list() const { return array_buffers_list_; } 845 Object* array_buffers_list() const { return array_buffers_list_; }
846 846
847 void set_new_array_buffers_view_list(Object* object) {
848 new_array_buffers_view_list_ = object;
849 }
850 Object* new_array_buffers_view_list() const {
851 return new_array_buffers_view_list_;
852 }
853
847 void set_allocation_sites_list(Object* object) { 854 void set_allocation_sites_list(Object* object) {
848 allocation_sites_list_ = object; 855 allocation_sites_list_ = object;
849 } 856 }
850 Object* allocation_sites_list() { return allocation_sites_list_; } 857 Object* allocation_sites_list() { return allocation_sites_list_; }
851 858
852 // Used in CreateAllocationSiteStub and the (de)serializer. 859 // Used in CreateAllocationSiteStub and the (de)serializer.
853 Object** allocation_sites_list_address() { return &allocation_sites_list_; } 860 Object** allocation_sites_list_address() { return &allocation_sites_list_; }
854 861
855 Object* weak_object_to_code_table() { return weak_object_to_code_table_; } 862 Object* weak_object_to_code_table() { return weak_object_to_code_table_; }
856 863
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 // trigger the event. In order to track ALL allocations one must turn off 1444 // trigger the event. In order to track ALL allocations one must turn off
1438 // FLAG_inline_new and FLAG_use_allocation_folding. 1445 // FLAG_inline_new and FLAG_use_allocation_folding.
1439 inline void OnAllocationEvent(HeapObject* object, int size_in_bytes); 1446 inline void OnAllocationEvent(HeapObject* object, int size_in_bytes);
1440 1447
1441 // This event is triggered after object is moved to a new place. 1448 // This event is triggered after object is moved to a new place.
1442 inline void OnMoveEvent(HeapObject* target, HeapObject* source, 1449 inline void OnMoveEvent(HeapObject* target, HeapObject* source,
1443 int size_in_bytes); 1450 int size_in_bytes);
1444 1451
1445 bool deserialization_complete() const { return deserialization_complete_; } 1452 bool deserialization_complete() const { return deserialization_complete_; }
1446 1453
1454 bool promotion_failure() const { return promotion_failure_; }
1455 void set_promotion_failure(bool promotion_failure) {
1456 promotion_failure_ = promotion_failure;
1457 }
1458
1447 protected: 1459 protected:
1448 // Methods made available to tests. 1460 // Methods made available to tests.
1449 1461
1450 // Allocates a JS Map in the heap. 1462 // Allocates a JS Map in the heap.
1451 MUST_USE_RESULT AllocationResult 1463 MUST_USE_RESULT AllocationResult
1452 AllocateMap(InstanceType instance_type, int instance_size, 1464 AllocateMap(InstanceType instance_type, int instance_size,
1453 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 1465 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
1454 1466
1455 // Allocates and initializes a new JavaScript object based on a 1467 // Allocates and initializes a new JavaScript object based on a
1456 // constructor. 1468 // constructor.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 bool old_gen_exhausted_; 1617 bool old_gen_exhausted_;
1606 1618
1607 // Indicates that inline bump-pointer allocation has been globally disabled 1619 // Indicates that inline bump-pointer allocation has been globally disabled
1608 // for all spaces. This is used to disable allocations in generated code. 1620 // for all spaces. This is used to disable allocations in generated code.
1609 bool inline_allocation_disabled_; 1621 bool inline_allocation_disabled_;
1610 1622
1611 // Weak list heads, threaded through the objects. 1623 // Weak list heads, threaded through the objects.
1612 // List heads are initilized lazily and contain the undefined_value at start. 1624 // List heads are initilized lazily and contain the undefined_value at start.
1613 Object* native_contexts_list_; 1625 Object* native_contexts_list_;
1614 Object* array_buffers_list_; 1626 Object* array_buffers_list_;
1627 Object* new_array_buffers_view_list_;
1615 Object* allocation_sites_list_; 1628 Object* allocation_sites_list_;
1616 1629
1617 // WeakHashTable that maps objects embedded in optimized code to dependent 1630 // WeakHashTable that maps objects embedded in optimized code to dependent
1618 // code list. It is initilized lazily and contains the undefined_value at 1631 // code list. It is initilized lazily and contains the undefined_value at
1619 // start. 1632 // start.
1620 Object* weak_object_to_code_table_; 1633 Object* weak_object_to_code_table_;
1621 1634
1622 // List of encountered weak collections (JSWeakMap and JSWeakSet) during 1635 // List of encountered weak collections (JSWeakMap and JSWeakSet) during
1623 // marking. It is initialized during marking, destroyed after marking and 1636 // marking. It is initialized during marking, destroyed after marking and
1624 // contains Smi(0) while marking is not active. 1637 // contains Smi(0) while marking is not active.
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 StoreBufferEvent event); 1957 StoreBufferEvent event);
1945 1958
1946 // Performs a major collection in the whole heap. 1959 // Performs a major collection in the whole heap.
1947 void MarkCompact(); 1960 void MarkCompact();
1948 1961
1949 // Code to be run before and after mark-compact. 1962 // Code to be run before and after mark-compact.
1950 void MarkCompactPrologue(); 1963 void MarkCompactPrologue();
1951 void MarkCompactEpilogue(); 1964 void MarkCompactEpilogue();
1952 1965
1953 void ProcessNativeContexts(WeakObjectRetainer* retainer); 1966 void ProcessNativeContexts(WeakObjectRetainer* retainer);
1954 void ProcessArrayBuffers(WeakObjectRetainer* retainer); 1967 void ProcessArrayBuffers(WeakObjectRetainer* retainer, bool stop_after_young);
1968 void ProcessNewArrayBufferViews(WeakObjectRetainer* retainer);
1955 void ProcessAllocationSites(WeakObjectRetainer* retainer); 1969 void ProcessAllocationSites(WeakObjectRetainer* retainer);
1956 1970
1957 // Deopts all code that contains allocation instruction which are tenured or 1971 // Deopts all code that contains allocation instruction which are tenured or
1958 // not tenured. Moreover it clears the pretenuring allocation site statistics. 1972 // not tenured. Moreover it clears the pretenuring allocation site statistics.
1959 void ResetAllAllocationSitesDependentCode(PretenureFlag flag); 1973 void ResetAllAllocationSitesDependentCode(PretenureFlag flag);
1960 1974
1961 // Evaluates local pretenuring for the old space and calls 1975 // Evaluates local pretenuring for the old space and calls
1962 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in 1976 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in
1963 // the old space. 1977 // the old space.
1964 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc); 1978 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; 2131 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
2118 2132
2119 MemoryChunk* chunks_queued_for_free_; 2133 MemoryChunk* chunks_queued_for_free_;
2120 2134
2121 base::Mutex relocation_mutex_; 2135 base::Mutex relocation_mutex_;
2122 2136
2123 int gc_callbacks_depth_; 2137 int gc_callbacks_depth_;
2124 2138
2125 bool deserialization_complete_; 2139 bool deserialization_complete_;
2126 2140
2141 bool promotion_failure_;
2142
2127 friend class AlwaysAllocateScope; 2143 friend class AlwaysAllocateScope;
2128 friend class Deserializer; 2144 friend class Deserializer;
2129 friend class Factory; 2145 friend class Factory;
2130 friend class GCCallbacksScope; 2146 friend class GCCallbacksScope;
2131 friend class GCTracer; 2147 friend class GCTracer;
2132 friend class HeapIterator; 2148 friend class HeapIterator;
2133 friend class Isolate; 2149 friend class Isolate;
2134 friend class MarkCompactCollector; 2150 friend class MarkCompactCollector;
2135 friend class MarkCompactMarkingVisitor; 2151 friend class MarkCompactMarkingVisitor;
2136 friend class MapCompact; 2152 friend class MapCompact;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2601 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2586 2602
2587 private: 2603 private:
2588 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2604 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2589 }; 2605 };
2590 #endif // DEBUG 2606 #endif // DEBUG
2591 } 2607 }
2592 } // namespace v8::internal 2608 } // namespace v8::internal
2593 2609
2594 #endif // V8_HEAP_HEAP_H_ 2610 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.cc » ('j') | src/runtime/runtime-typedarray.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698