OLD | NEW |
---|---|
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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 4933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4944 | 4944 |
4945 /** | 4945 /** |
4946 * Callback to check if code generation from strings is allowed. See | 4946 * Callback to check if code generation from strings is allowed. See |
4947 * Context::AllowCodeGenerationFromStrings. | 4947 * Context::AllowCodeGenerationFromStrings. |
4948 */ | 4948 */ |
4949 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); | 4949 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); |
4950 | 4950 |
4951 // --- Garbage Collection Callbacks --- | 4951 // --- Garbage Collection Callbacks --- |
4952 | 4952 |
4953 /** | 4953 /** |
4954 * Applications can register callback functions which will be called | 4954 * Applications can register callback functions which will be called before and |
4955 * before and after a garbage collection. Allocations are not | 4955 * after certain garbage collection operations. Allocations are not allowed in |
4956 * allowed in the callback functions, you therefore cannot manipulate | 4956 * the callback functions, you therefore cannot manipulate objects (set or |
4957 * objects (set or delete properties for example) since it is possible | 4957 * delete properties for example) since it is possible such operations will |
4958 * such operations will result in the allocation of objects. | 4958 * result in the allocation of objects. |
4959 */ | 4959 */ |
4960 enum GCType { | 4960 enum GCType { |
4961 kGCTypeScavenge = 1 << 0, | 4961 kGCTypeScavenge = 1 << 0, |
4962 kGCTypeMarkSweepCompact = 1 << 1, | 4962 kGCTypeMarkSweepCompact = 1 << 1, |
4963 kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact | 4963 kGCTypeIncremental = 1 << 2, |
Hannes Payer (out of office)
2015/08/18 09:18:13
kGCTypeIncrementalMarking maybe?
Michael Lippautz
2015/08/18 10:03:08
Done.
| |
4964 kGCTypeProcessWeakCallbacks = 1 << 3, | |
4965 kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact | kGCTypeIncremental | | |
4966 kGCTypeProcessWeakCallbacks | |
4964 }; | 4967 }; |
4965 | 4968 |
4966 enum GCCallbackFlags { | 4969 enum GCCallbackFlags { |
4967 kNoGCCallbackFlags = 0, | 4970 kNoGCCallbackFlags = 0, |
4968 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, | 4971 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, |
4969 kGCCallbackFlagForced = 1 << 2, | 4972 kGCCallbackFlagForced = 1 << 2, |
4970 kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3 | 4973 kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3 |
4971 }; | 4974 }; |
4972 | 4975 |
4973 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); | 4976 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); |
4974 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); | 4977 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); |
4978 typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); | |
Hannes Payer (out of office)
2015/08/18 09:18:13
We should deprecated the corresponding API functio
Michael Lippautz
2015/08/18 10:03:08
The typedefs are completely (read: 100%) compatibl
| |
4975 | 4979 |
4976 typedef void (*InterruptCallback)(Isolate* isolate, void* data); | 4980 typedef void (*InterruptCallback)(Isolate* isolate, void* data); |
4977 | 4981 |
4978 | 4982 |
4979 /** | 4983 /** |
4980 * Collection of V8 heap information. | 4984 * Collection of V8 heap information. |
4981 * | 4985 * |
4982 * Instances of this class can be passed to v8::V8::HeapStatistics to | 4986 * Instances of this class can be passed to v8::V8::HeapStatistics to |
4983 * get heap statistics from V8. | 4987 * get heap statistics from V8. |
4984 */ | 4988 */ |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5546 */ | 5550 */ |
5547 template<typename T, typename S> | 5551 template<typename T, typename S> |
5548 void SetReference(const Persistent<T>& parent, const Persistent<S>& child); | 5552 void SetReference(const Persistent<T>& parent, const Persistent<S>& child); |
5549 | 5553 |
5550 typedef void (*GCPrologueCallback)(Isolate* isolate, | 5554 typedef void (*GCPrologueCallback)(Isolate* isolate, |
5551 GCType type, | 5555 GCType type, |
5552 GCCallbackFlags flags); | 5556 GCCallbackFlags flags); |
5553 typedef void (*GCEpilogueCallback)(Isolate* isolate, | 5557 typedef void (*GCEpilogueCallback)(Isolate* isolate, |
5554 GCType type, | 5558 GCType type, |
5555 GCCallbackFlags flags); | 5559 GCCallbackFlags flags); |
5560 typedef void (*GCCallback)(Isolate* isolate, GCType type, | |
5561 GCCallbackFlags flags); | |
5556 | 5562 |
5557 /** | 5563 /** |
5558 * Enables the host application to receive a notification before a | 5564 * Enables the host application to receive a notification before a |
5559 * garbage collection. Allocations are allowed in the callback function, | 5565 * garbage collection. Allocations are allowed in the callback function, |
5560 * but the callback is not re-entrant: if the allocation inside it will | 5566 * but the callback is not re-entrant: if the allocation inside it will |
5561 * trigger the garbage collection, the callback won't be called again. | 5567 * trigger the garbage collection, the callback won't be called again. |
5562 * It is possible to specify the GCType filter for your callback. But it is | 5568 * It is possible to specify the GCType filter for your callback. But it is |
5563 * not possible to register the same callback function two times with | 5569 * not possible to register the same callback function two times with |
5564 * different GCType filters. | 5570 * different GCType filters. |
5565 */ | 5571 */ |
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8336 */ | 8342 */ |
8337 | 8343 |
8338 | 8344 |
8339 } // namespace v8 | 8345 } // namespace v8 |
8340 | 8346 |
8341 | 8347 |
8342 #undef TYPE_CHECK | 8348 #undef TYPE_CHECK |
8343 | 8349 |
8344 | 8350 |
8345 #endif // V8_H_ | 8351 #endif // V8_H_ |
OLD | NEW |