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

Unified Diff: src/heap/heap.h

Issue 1298113003: [api,heap] Fix external GC callbacks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Got rid of too many V8::Type vs Isolate::Type casts Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/global-handles.cc ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 728637873255c2710cf17398b6d0f8e970113f91..2f188b5352554a89d73f8186abc8bcd0436186ca 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -883,13 +883,13 @@ class Heap {
PromotionQueue* promotion_queue() { return &promotion_queue_; }
- void AddGCPrologueCallback(v8::Isolate::GCPrologueCallback callback,
+ void AddGCPrologueCallback(v8::Isolate::GCCallback callback,
GCType gc_type_filter, bool pass_isolate = true);
- void RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback);
+ void RemoveGCPrologueCallback(v8::Isolate::GCCallback callback);
- void AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback,
+ void AddGCEpilogueCallback(v8::Isolate::GCCallback callback,
GCType gc_type_filter, bool pass_isolate = true);
- void RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback);
+ void RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback);
// Heap root getters. We have versions with and without type::cast() here.
// You can't use type::cast during GC because the assert fails.
@@ -1858,35 +1858,22 @@ class Heap {
void AddPrivateGlobalSymbols(Handle<Object> private_intern_table);
- // GC callback function, called before and after mark-compact GC.
- // Allocations in the callback function are disallowed.
- struct GCPrologueCallbackPair {
- GCPrologueCallbackPair(v8::Isolate::GCPrologueCallback callback,
- GCType gc_type, bool pass_isolate)
- : callback(callback), gc_type(gc_type), pass_isolate_(pass_isolate) {}
- bool operator==(const GCPrologueCallbackPair& pair) const {
- return pair.callback == callback;
- }
- v8::Isolate::GCPrologueCallback callback;
- GCType gc_type;
- // TODO(dcarney): remove variable
- bool pass_isolate_;
- };
- List<GCPrologueCallbackPair> gc_prologue_callbacks_;
-
- struct GCEpilogueCallbackPair {
- GCEpilogueCallbackPair(v8::Isolate::GCPrologueCallback callback,
- GCType gc_type, bool pass_isolate)
- : callback(callback), gc_type(gc_type), pass_isolate_(pass_isolate) {}
- bool operator==(const GCEpilogueCallbackPair& pair) const {
- return pair.callback == callback;
+ struct GCCallbackPair {
+ GCCallbackPair(v8::Isolate::GCCallback callback, GCType gc_type,
+ bool pass_isolate)
+ : callback(callback), gc_type(gc_type), pass_isolate(pass_isolate) {}
+
+ bool operator==(const GCCallbackPair& other) const {
+ return other.callback == callback;
}
- v8::Isolate::GCPrologueCallback callback;
+
+ v8::Isolate::GCCallback callback;
GCType gc_type;
- // TODO(dcarney): remove variable
- bool pass_isolate_;
+ bool pass_isolate;
};
- List<GCEpilogueCallbackPair> gc_epilogue_callbacks_;
+
+ List<GCCallbackPair> gc_epilogue_callbacks_;
+ List<GCCallbackPair> gc_prologue_callbacks_;
// Code that should be run before and after each GC. Includes some
// reporting/verification activities when compiled with DEBUG set.
« no previous file with comments | « src/global-handles.cc ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698