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

Unified Diff: include/v8.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 | « no previous file | src/api.cc » ('j') | src/heap/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 95edfdb10cad504069835b8a87afaca55b5e594d..9a577765b439ae90c50f0cd866603924c087528f 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4951,16 +4951,19 @@ typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context);
// --- Garbage Collection Callbacks ---
/**
- * Applications can register callback functions which will be called
- * before and after a garbage collection. Allocations are not
- * allowed in the callback functions, you therefore cannot manipulate
- * objects (set or delete properties for example) since it is possible
- * such operations will result in the allocation of objects.
+ * Applications can register callback functions which will be called before and
+ * after certain garbage collection operations. Allocations are not allowed in
+ * the callback functions, you therefore cannot manipulate objects (set or
+ * delete properties for example) since it is possible such operations will
+ * result in the allocation of objects.
*/
enum GCType {
kGCTypeScavenge = 1 << 0,
kGCTypeMarkSweepCompact = 1 << 1,
- kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact
+ kGCTypeIncrementalMarking = 1 << 2,
+ kGCTypeProcessWeakCallbacks = 1 << 3,
+ kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact |
+ kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks
};
enum GCCallbackFlags {
@@ -4970,8 +4973,13 @@ enum GCCallbackFlags {
kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3
};
-typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags);
-typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags);
+V8_DEPRECATE_SOON("Use GCCallBack instead",
+ typedef void (*GCPrologueCallback)(GCType type,
+ GCCallbackFlags flags));
+V8_DEPRECATE_SOON("Use GCCallBack instead",
+ typedef void (*GCEpilogueCallback)(GCType type,
+ GCCallbackFlags flags));
+typedef void (*GCCallback)(GCType type, GCCallbackFlags flags);
typedef void (*InterruptCallback)(Isolate* isolate, void* data);
@@ -5547,12 +5555,16 @@ class V8_EXPORT Isolate {
template<typename T, typename S>
void SetReference(const Persistent<T>& parent, const Persistent<S>& child);
- typedef void (*GCPrologueCallback)(Isolate* isolate,
- GCType type,
- GCCallbackFlags flags);
- typedef void (*GCEpilogueCallback)(Isolate* isolate,
- GCType type,
- GCCallbackFlags flags);
+ V8_DEPRECATE_SOON("Use GCCallBack instead",
+ typedef void (*GCPrologueCallback)(Isolate* isolate,
+ GCType type,
+ GCCallbackFlags flags));
+ V8_DEPRECATE_SOON("Use GCCallBack instead",
+ typedef void (*GCEpilogueCallback)(Isolate* isolate,
+ GCType type,
+ GCCallbackFlags flags));
+ typedef void (*GCCallback)(Isolate* isolate, GCType type,
+ GCCallbackFlags flags);
/**
* Enables the host application to receive a notification before a
@@ -5563,14 +5575,14 @@ class V8_EXPORT Isolate {
* not possible to register the same callback function two times with
* different GCType filters.
*/
- void AddGCPrologueCallback(
- GCPrologueCallback callback, GCType gc_type_filter = kGCTypeAll);
+ void AddGCPrologueCallback(GCCallback callback,
+ GCType gc_type_filter = kGCTypeAll);
/**
* This function removes callback which was installed by
* AddGCPrologueCallback function.
*/
- void RemoveGCPrologueCallback(GCPrologueCallback callback);
+ void RemoveGCPrologueCallback(GCCallback callback);
/**
* Enables the host application to receive a notification after a
@@ -5581,15 +5593,14 @@ class V8_EXPORT Isolate {
* not possible to register the same callback function two times with
* different GCType filters.
*/
- void AddGCEpilogueCallback(
- GCEpilogueCallback callback, GCType gc_type_filter = kGCTypeAll);
+ void AddGCEpilogueCallback(GCCallback callback,
+ GCType gc_type_filter = kGCTypeAll);
/**
* This function removes callback which was installed by
* AddGCEpilogueCallback function.
*/
- void RemoveGCEpilogueCallback(GCEpilogueCallback callback);
-
+ void RemoveGCEpilogueCallback(GCCallback callback);
/**
* Forcefully terminate the current thread of JavaScript execution
@@ -6046,7 +6057,7 @@ class V8_EXPORT V8 {
*/
static V8_DEPRECATE_SOON(
"Use isolate version",
- void AddGCPrologueCallback(GCPrologueCallback callback,
+ void AddGCPrologueCallback(GCCallback callback,
GCType gc_type_filter = kGCTypeAll));
/**
@@ -6055,7 +6066,7 @@ class V8_EXPORT V8 {
*/
V8_INLINE static V8_DEPRECATE_SOON(
"Use isolate version",
- void RemoveGCPrologueCallback(GCPrologueCallback callback));
+ void RemoveGCPrologueCallback(GCCallback callback));
/**
* Enables the host application to receive a notification after a
@@ -6069,7 +6080,7 @@ class V8_EXPORT V8 {
*/
static V8_DEPRECATE_SOON(
"Use isolate version",
- void AddGCEpilogueCallback(GCEpilogueCallback callback,
+ void AddGCEpilogueCallback(GCCallback callback,
GCType gc_type_filter = kGCTypeAll));
/**
@@ -6078,7 +6089,7 @@ class V8_EXPORT V8 {
*/
V8_INLINE static V8_DEPRECATE_SOON(
"Use isolate version",
- void RemoveGCEpilogueCallback(GCEpilogueCallback callback));
+ void RemoveGCEpilogueCallback(GCCallback callback));
/**
* Enables the host application to provide a mechanism to be notified
@@ -8257,17 +8268,17 @@ void V8::SetFatalErrorHandler(FatalErrorCallback callback) {
}
-void V8::RemoveGCPrologueCallback(GCPrologueCallback callback) {
+void V8::RemoveGCPrologueCallback(GCCallback callback) {
Isolate* isolate = Isolate::GetCurrent();
isolate->RemoveGCPrologueCallback(
- reinterpret_cast<v8::Isolate::GCPrologueCallback>(callback));
+ reinterpret_cast<v8::Isolate::GCCallback>(callback));
}
-void V8::RemoveGCEpilogueCallback(GCEpilogueCallback callback) {
+void V8::RemoveGCEpilogueCallback(GCCallback callback) {
Isolate* isolate = Isolate::GetCurrent();
isolate->RemoveGCEpilogueCallback(
- reinterpret_cast<v8::Isolate::GCEpilogueCallback>(callback));
+ reinterpret_cast<v8::Isolate::GCCallback>(callback));
}
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698