| v8.h | | v8.h | |
| | | | |
| skipping to change at line 579 | | skipping to change at line 579 | |
| template <class S> | | template <class S> | |
| V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other); | | V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other); | |
| /** | | /** | |
| * If non-empty, destroy the underlying storage cell | | * If non-empty, destroy the underlying storage cell | |
| * and create a new one with the contents of other if other is non empty | | * and create a new one with the contents of other if other is non empty | |
| */ | | */ | |
| template <class S, class M2> | | template <class S, class M2> | |
| V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other); | | V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other); | |
| // TODO(dcarney): deprecate | | // TODO(dcarney): deprecate | |
| V8_INLINE void Dispose() { Reset(); } | | V8_INLINE void Dispose() { Reset(); } | |
|
| V8_DEPRECATED(V8_INLINE void Dispose(Isolate* isolate)) { Reset(); } | | | |
| | | | |
| V8_INLINE bool IsEmpty() const { return val_ == 0; } | | V8_INLINE bool IsEmpty() const { return val_ == 0; } | |
| | | | |
| // TODO(dcarney): this is pretty useless, fix or remove | | // TODO(dcarney): this is pretty useless, fix or remove | |
| template <class S> | | template <class S> | |
| V8_INLINE static Persistent<T>& Cast(Persistent<S>& that) { // NOLINT | | V8_INLINE static Persistent<T>& Cast(Persistent<S>& that) { // NOLINT | |
| #ifdef V8_ENABLE_CHECKS | | #ifdef V8_ENABLE_CHECKS | |
| // If we're going to perform the type check then we have to check | | // If we're going to perform the type check then we have to check | |
| // that the handle isn't empty before doing the checked cast. | | // that the handle isn't empty before doing the checked cast. | |
| if (!that.IsEmpty()) T::Cast(*that); | | if (!that.IsEmpty()) T::Cast(*that); | |
| | | | |
| skipping to change at line 649 | | skipping to change at line 648 | |
| typename WeakReferenceCallbacks<S, P>::Revivable callback); | | typename WeakReferenceCallbacks<S, P>::Revivable callback); | |
| | | | |
| // TODO(dcarney): deprecate | | // TODO(dcarney): deprecate | |
| template<typename P> | | template<typename P> | |
| V8_INLINE void MakeWeak( | | V8_INLINE void MakeWeak( | |
| P* parameter, | | P* parameter, | |
| typename WeakReferenceCallbacks<T, P>::Revivable callback); | | typename WeakReferenceCallbacks<T, P>::Revivable callback); | |
| | | | |
| V8_INLINE void ClearWeak(); | | V8_INLINE void ClearWeak(); | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE void ClearWeak(Isolate* isolate)) { ClearWeak(); | | | |
| } | | | |
| | | | |
| /** | | /** | |
| * Marks the reference to this object independent. Garbage collector is f
ree | | * Marks the reference to this object independent. Garbage collector is f
ree | |
| * to ignore any object groups containing this object. Weak callback for
an | | * to ignore any object groups containing this object. Weak callback for
an | |
| * independent handle should not assume that it will be preceded by a glo
bal | | * independent handle should not assume that it will be preceded by a glo
bal | |
| * GC prologue callback or followed by a global GC epilogue callback. | | * GC prologue callback or followed by a global GC epilogue callback. | |
| */ | | */ | |
| V8_INLINE void MarkIndependent(); | | V8_INLINE void MarkIndependent(); | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE void MarkIndependent(Isolate* isolate)) { | | | |
| MarkIndependent(); | | | |
| } | | | |
| | | | |
| /** | | /** | |
| * Marks the reference to this object partially dependent. Partially depe
ndent | | * Marks the reference to this object partially dependent. Partially depe
ndent | |
| * handles only depend on other partially dependent handles and these | | * handles only depend on other partially dependent handles and these | |
| * dependencies are provided through object groups. It provides a way to
build | | * dependencies are provided through object groups. It provides a way to
build | |
| * smaller object groups for young objects that represent only a subset o
f all | | * smaller object groups for young objects that represent only a subset o
f all | |
| * external dependencies. This mark is automatically cleared after each | | * external dependencies. This mark is automatically cleared after each | |
| * garbage collection. | | * garbage collection. | |
| */ | | */ | |
| V8_INLINE void MarkPartiallyDependent(); | | V8_INLINE void MarkPartiallyDependent(); | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE void MarkPartiallyDependent(Isolate* isolate)) { | | | |
| MarkPartiallyDependent(); | | | |
| } | | | |
| | | | |
| V8_INLINE bool IsIndependent() const; | | V8_INLINE bool IsIndependent() const; | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE bool IsIndependent(Isolate* isolate) const) { | | | |
| return IsIndependent(); | | | |
| } | | | |
| | | | |
| /** Checks if the handle holds the only reference to an object. */ | | /** Checks if the handle holds the only reference to an object. */ | |
| V8_INLINE bool IsNearDeath() const; | | V8_INLINE bool IsNearDeath() const; | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE bool IsNearDeath(Isolate* isolate) const) { | | | |
| return IsNearDeath(); | | | |
| } | | | |
| | | | |
| /** Returns true if the handle's reference is weak. */ | | /** Returns true if the handle's reference is weak. */ | |
| V8_INLINE bool IsWeak() const; | | V8_INLINE bool IsWeak() const; | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE bool IsWeak(Isolate* isolate) const) { | | | |
| return IsWeak(); | | | |
| } | | | |
| | | | |
| /** | | /** | |
| * Assigns a wrapper class ID to the handle. See RetainedObjectInfo inter
face | | * Assigns a wrapper class ID to the handle. See RetainedObjectInfo inter
face | |
| * description in v8-profiler.h for details. | | * description in v8-profiler.h for details. | |
| */ | | */ | |
| V8_INLINE void SetWrapperClassId(uint16_t class_id); | | V8_INLINE void SetWrapperClassId(uint16_t class_id); | |
| | | | |
|
| V8_DEPRECATED( | | | |
| V8_INLINE void SetWrapperClassId(Isolate * isolate, uint16_t class_id | | | |
| )) { | | | |
| SetWrapperClassId(class_id); | | | |
| } | | | |
| | | | |
| /** | | /** | |
| * Returns the class ID previously assigned to this handle or 0 if no cla
ss ID | | * Returns the class ID previously assigned to this handle or 0 if no cla
ss ID | |
| * was previously assigned. | | * was previously assigned. | |
| */ | | */ | |
| V8_INLINE uint16_t WrapperClassId() const; | | V8_INLINE uint16_t WrapperClassId() const; | |
| | | | |
|
| V8_DEPRECATED(V8_INLINE uint16_t WrapperClassId(Isolate* isolate) const) | | | |
| { | | | |
| return WrapperClassId(); | | | |
| } | | | |
| | | | |
| // TODO(dcarney): remove | | // TODO(dcarney): remove | |
| V8_INLINE T* ClearAndLeak(); | | V8_INLINE T* ClearAndLeak(); | |
| | | | |
| // TODO(dcarney): remove | | // TODO(dcarney): remove | |
| V8_INLINE void Clear() { val_ = 0; } | | V8_INLINE void Clear() { val_ = 0; } | |
| | | | |
| // TODO(dcarney): remove | | // TODO(dcarney): remove | |
| #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | | #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | |
| | | | |
| private: | | private: | |
| | | | |
| skipping to change at line 1549 | | skipping to change at line 1517 | |
| */ | | */ | |
| int Length() const; | | int Length() const; | |
| | | | |
| /** | | /** | |
| * Returns the number of bytes in the UTF-8 encoded | | * Returns the number of bytes in the UTF-8 encoded | |
| * representation of this string. | | * representation of this string. | |
| */ | | */ | |
| int Utf8Length() const; | | int Utf8Length() const; | |
| | | | |
| /** | | /** | |
|
| * This function is no longer useful. | | | |
| */ | | | |
| V8_DEPRECATED(V8_INLINE bool MayContainNonAscii() const) { return true; } | | | |
| | | | |
| /** | | | |
| * Returns whether this string is known to contain only one byte data. | | * Returns whether this string is known to contain only one byte data. | |
| * Does not read the string. | | * Does not read the string. | |
| * False negatives are possible. | | * False negatives are possible. | |
| */ | | */ | |
| bool IsOneByte() const; | | bool IsOneByte() const; | |
| | | | |
| /** | | /** | |
| * Returns whether this string contain only one byte data. | | * Returns whether this string contain only one byte data. | |
| * Will read the entire string in some cases. | | * Will read the entire string in some cases. | |
| */ | | */ | |
| | | | |
| skipping to change at line 1603 | | skipping to change at line 1566 | |
| HINT_MANY_WRITES_EXPECTED = 1, | | HINT_MANY_WRITES_EXPECTED = 1, | |
| NO_NULL_TERMINATION = 2, | | NO_NULL_TERMINATION = 2, | |
| PRESERVE_ASCII_NULL = 4 | | PRESERVE_ASCII_NULL = 4 | |
| }; | | }; | |
| | | | |
| // 16-bit character codes. | | // 16-bit character codes. | |
| int Write(uint16_t* buffer, | | int Write(uint16_t* buffer, | |
| int start = 0, | | int start = 0, | |
| int length = -1, | | int length = -1, | |
| int options = NO_OPTIONS) const; | | int options = NO_OPTIONS) const; | |
|
| // ASCII characters. | | | |
| V8_DEPRECATED(int WriteAscii(char* buffer, | | | |
| int start = 0, | | | |
| int length = -1, | | | |
| int options = NO_OPTIONS) const); | | | |
| // One byte characters. | | // One byte characters. | |
| int WriteOneByte(uint8_t* buffer, | | int WriteOneByte(uint8_t* buffer, | |
| int start = 0, | | int start = 0, | |
| int length = -1, | | int length = -1, | |
| int options = NO_OPTIONS) const; | | int options = NO_OPTIONS) const; | |
| // UTF-8 encoded characters. | | // UTF-8 encoded characters. | |
| int WriteUtf8(char* buffer, | | int WriteUtf8(char* buffer, | |
| int length = -1, | | int length = -1, | |
| int* nchars_ref = NULL, | | int* nchars_ref = NULL, | |
| int options = NO_OPTIONS) const; | | int options = NO_OPTIONS) const; | |
| | | | |
| skipping to change at line 1738 | | skipping to change at line 1696 | |
| V8_INLINE ExternalStringResource* GetExternalStringResource() const; | | V8_INLINE ExternalStringResource* GetExternalStringResource() const; | |
| | | | |
| /** | | /** | |
| * Get the ExternalAsciiStringResource for an external ASCII string. | | * Get the ExternalAsciiStringResource for an external ASCII string. | |
| * Returns NULL if IsExternalAscii() doesn't return true. | | * Returns NULL if IsExternalAscii() doesn't return true. | |
| */ | | */ | |
| const ExternalAsciiStringResource* GetExternalAsciiStringResource() const
; | | const ExternalAsciiStringResource* GetExternalAsciiStringResource() const
; | |
| | | | |
| V8_INLINE static String* Cast(v8::Value* obj); | | V8_INLINE static String* Cast(v8::Value* obj); | |
| | | | |
|
| // TODO(dcarney): deprecate | | | |
| /** | | /** | |
| * Allocates a new string from either UTF-8 encoded or ASCII data. | | * Allocates a new string from either UTF-8 encoded or ASCII data. | |
| * The second parameter 'length' gives the buffer length. If omitted, | | * The second parameter 'length' gives the buffer length. If omitted, | |
| * the function calls 'strlen' to determine the buffer length. | | * the function calls 'strlen' to determine the buffer length. | |
| */ | | */ | |
|
| V8_INLINE static Local<String> New(const char* data, int length = -1); | | V8_DEPRECATED( | |
| | | "Use NewFromOneByte instead", | |
| | | V8_INLINE static Local<String> New(const char* data, int length = -1) | |
| | | ); | |
| | | | |
|
| // TODO(dcarney): deprecate | | | |
| /** Allocates a new string from 16-bit character codes.*/ | | /** Allocates a new string from 16-bit character codes.*/ | |
|
| V8_INLINE static Local<String> New(const uint16_t* data, int length = -1) | | V8_DEPRECATED( | |
| ; | | "Use NewFromTwoByte instead", | |
| | | V8_INLINE static Local<String> New( | |
| | | const uint16_t* data, int length = -1)); | |
| | | | |
|
| // TODO(dcarney): deprecate | | | |
| /** | | /** | |
| * Creates an internalized string (historically called a "symbol", | | * Creates an internalized string (historically called a "symbol", | |
| * not to be confused with ES6 symbols). Returns one if it exists already
. | | * not to be confused with ES6 symbols). Returns one if it exists already
. | |
| */ | | */ | |
|
| V8_INLINE static Local<String> NewSymbol(const char* data, int length = - | | V8_DEPRECATED( | |
| 1); | | "Use NewFromUtf8 instead", | |
| | | V8_INLINE static Local<String> NewSymbol( | |
| | | const char* data, int length = -1)); | |
| | | | |
| enum NewStringType { | | enum NewStringType { | |
| kNormalString, kInternalizedString, kUndetectableString | | kNormalString, kInternalizedString, kUndetectableString | |
| }; | | }; | |
| | | | |
| /** Allocates a new string from UTF-8 data.*/ | | /** Allocates a new string from UTF-8 data.*/ | |
| static Local<String> NewFromUtf8(Isolate* isolate, | | static Local<String> NewFromUtf8(Isolate* isolate, | |
| const char* data, | | const char* data, | |
| NewStringType type = kNormalString, | | NewStringType type = kNormalString, | |
| int length = -1); | | int length = -1); | |
| | | | |
| skipping to change at line 2289 | | skipping to change at line 2252 | |
| * Checks whether a callback is set by the | | * Checks whether a callback is set by the | |
| * ObjectTemplate::SetCallAsFunctionHandler method. | | * ObjectTemplate::SetCallAsFunctionHandler method. | |
| * When an Object is callable this method returns true. | | * When an Object is callable this method returns true. | |
| */ | | */ | |
| bool IsCallable(); | | bool IsCallable(); | |
| | | | |
| /** | | /** | |
| * Call an Object as a function if a callback is set by the | | * Call an Object as a function if a callback is set by the | |
| * ObjectTemplate::SetCallAsFunctionHandler method. | | * ObjectTemplate::SetCallAsFunctionHandler method. | |
| */ | | */ | |
|
| Local<Value> CallAsFunction(Handle<Object> recv, | | Local<Value> CallAsFunction(Handle<Value> recv, | |
| int argc, | | int argc, | |
| Handle<Value> argv[]); | | Handle<Value> argv[]); | |
| | | | |
| /** | | /** | |
| * Call an Object as a constructor if a callback is set by the | | * Call an Object as a constructor if a callback is set by the | |
| * ObjectTemplate::SetCallAsFunctionHandler method. | | * ObjectTemplate::SetCallAsFunctionHandler method. | |
| * Note: This method behaves like the Function::NewInstance method. | | * Note: This method behaves like the Function::NewInstance method. | |
| */ | | */ | |
| Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); | | Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); | |
| | | | |
| | | | |
| skipping to change at line 2456 | | skipping to change at line 2419 | |
| * Create a function in the current execution context | | * Create a function in the current execution context | |
| * for a given FunctionCallback. | | * for a given FunctionCallback. | |
| */ | | */ | |
| static Local<Function> New(Isolate* isolate, | | static Local<Function> New(Isolate* isolate, | |
| FunctionCallback callback, | | FunctionCallback callback, | |
| Local<Value> data = Local<Value>(), | | Local<Value> data = Local<Value>(), | |
| int length = 0); | | int length = 0); | |
| | | | |
| Local<Object> NewInstance() const; | | Local<Object> NewInstance() const; | |
| Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; | | Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; | |
|
| Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]); | | Local<Value> Call(Handle<Value> recv, int argc, Handle<Value> argv[]); | |
| void SetName(Handle<String> name); | | void SetName(Handle<String> name); | |
| Handle<Value> GetName() const; | | Handle<Value> GetName() const; | |
| | | | |
| /** | | /** | |
| * Name inferred from variable or property assignment of this function. | | * Name inferred from variable or property assignment of this function. | |
| * Used to facilitate debugging and profiling of JavaScript code written | | * Used to facilitate debugging and profiling of JavaScript code written | |
| * in an OO style, where many functions are anonymous but are assigned | | * in an OO style, where many functions are anonymous but are assigned | |
| * to object properties. | | * to object properties. | |
| */ | | */ | |
| Handle<Value> GetInferredName() const; | | Handle<Value> GetInferredName() const; | |
| | | | |
| skipping to change at line 2643 | | skipping to change at line 2606 | |
| */ | | */ | |
| Local<ArrayBuffer> Buffer(); | | Local<ArrayBuffer> Buffer(); | |
| /** | | /** | |
| * Byte offset in |Buffer|. | | * Byte offset in |Buffer|. | |
| */ | | */ | |
| size_t ByteOffset(); | | size_t ByteOffset(); | |
| /** | | /** | |
| * Size of a view in bytes. | | * Size of a view in bytes. | |
| */ | | */ | |
| size_t ByteLength(); | | size_t ByteLength(); | |
|
| /** | | | |
| * Base address of a view. | | | |
| */ | | | |
| void* BaseAddress(); | | | |
| | | | |
| V8_INLINE static ArrayBufferView* Cast(Value* obj); | | V8_INLINE static ArrayBufferView* Cast(Value* obj); | |
| | | | |
| static const int kInternalFieldCount = | | static const int kInternalFieldCount = | |
| V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT; | | V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT; | |
| | | | |
| private: | | private: | |
| ArrayBufferView(); | | ArrayBufferView(); | |
| static void CheckCast(Value* obj); | | static void CheckCast(Value* obj); | |
| }; | | }; | |
| | | | |
| skipping to change at line 4482 | | skipping to change at line 4441 | |
| static void SetEntropySource(EntropySource source); | | static void SetEntropySource(EntropySource source); | |
| | | | |
| /** | | /** | |
| * Allows the host application to provide a callback that allows v8 to | | * Allows the host application to provide a callback that allows v8 to | |
| * cooperate with a profiler that rewrites return addresses on stack. | | * cooperate with a profiler that rewrites return addresses on stack. | |
| */ | | */ | |
| static void SetReturnAddressLocationResolver( | | static void SetReturnAddressLocationResolver( | |
| ReturnAddressLocationResolver return_address_resolver); | | ReturnAddressLocationResolver return_address_resolver); | |
| | | | |
| /** | | /** | |
|
| * Deprecated, use the variant with the Isolate parameter below instead. | | | |
| */ | | | |
| V8_DEPRECATED(static bool SetFunctionEntryHook(FunctionEntryHook entry_ho | | | |
| ok)); | | | |
| | | | |
| /** | | | |
| * Allows the host application to provide the address of a function that'
s | | * Allows the host application to provide the address of a function that'
s | |
| * invoked on entry to every V8-generated function. | | * invoked on entry to every V8-generated function. | |
| * Note that \p entry_hook is invoked at the very start of each | | * Note that \p entry_hook is invoked at the very start of each | |
| * generated function. | | * generated function. | |
| * | | * | |
| * \param isolate the isolate to operate on. | | * \param isolate the isolate to operate on. | |
| * \param entry_hook a function that will be invoked on entry to every | | * \param entry_hook a function that will be invoked on entry to every | |
| * V8-generated function. | | * V8-generated function. | |
| * \returns true on success on supported platforms, false on failure. | | * \returns true on success on supported platforms, false on failure. | |
| * \note Setting an entry hook can only be done very early in an isolates | | * \note Setting an entry hook can only be done very early in an isolates | |
| | | | |
| skipping to change at line 4583 | | skipping to change at line 4537 | |
| * Releases any resources used by v8 and stops any utility threads | | * Releases any resources used by v8 and stops any utility threads | |
| * that may be running. Note that disposing v8 is permanent, it | | * that may be running. Note that disposing v8 is permanent, it | |
| * cannot be reinitialized. | | * cannot be reinitialized. | |
| * | | * | |
| * It should generally not be necessary to dispose v8 before exiting | | * It should generally not be necessary to dispose v8 before exiting | |
| * a process, this should happen automatically. It is only necessary | | * a process, this should happen automatically. It is only necessary | |
| * to use if the process needs the resources taken up by v8. | | * to use if the process needs the resources taken up by v8. | |
| */ | | */ | |
| static bool Dispose(); | | static bool Dispose(); | |
| | | | |
|
| /** Deprecated. Use Isolate::GetHeapStatistics instead. */ | | | |
| V8_DEPRECATED(static void GetHeapStatistics(HeapStatistics* heap_statisti | | | |
| cs)); | | | |
| | | | |
| /** | | /** | |
| * Iterates through all external resources referenced from current isolat
e | | * Iterates through all external resources referenced from current isolat
e | |
| * heap. GC is not invoked prior to iterating, therefore there is no | | * heap. GC is not invoked prior to iterating, therefore there is no | |
| * guarantee that visited objects are still alive. | | * guarantee that visited objects are still alive. | |
| */ | | */ | |
| static void VisitExternalResources(ExternalResourceVisitor* visitor); | | static void VisitExternalResources(ExternalResourceVisitor* visitor); | |
| | | | |
| /** | | /** | |
| * Iterates through all the persistent handles in the current isolate's h
eap | | * Iterates through all the persistent handles in the current isolate's h
eap | |
| * that have class_ids. | | * that have class_ids. | |
| | | | |
| skipping to change at line 4879 | | skipping to change at line 4830 | |
| * created by a previous call to Context::New with the same global | | * created by a previous call to Context::New with the same global | |
| * template. The state of the global object will be completely reset | | * template. The state of the global object will be completely reset | |
| * and only object identify will remain. | | * and only object identify will remain. | |
| */ | | */ | |
| static Local<Context> New( | | static Local<Context> New( | |
| Isolate* isolate, | | Isolate* isolate, | |
| ExtensionConfiguration* extensions = NULL, | | ExtensionConfiguration* extensions = NULL, | |
| Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), | | Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), | |
| Handle<Value> global_object = Handle<Value>()); | | Handle<Value> global_object = Handle<Value>()); | |
| | | | |
|
| // TODO(dcarney): Remove this function. | | V8_DEPRECATED("Use Isolate::GetEnteredContext instead", | |
| /** Deprecated. Use Isolate::GetEnteredContext */ | | static Local<Context> GetEntered()); | |
| static Local<Context> GetEntered(); | | | |
| | | | |
|
| // TODO(dcarney) Remove this function. | | V8_DEPRECATED("Use Isolate::GetCurrentContext instead", | |
| /** Deprecated. Use Isolate::GetCurrentContext instead. */ | | static Local<Context> GetCurrent()); | |
| static Local<Context> GetCurrent(); | | | |
| | | | |
|
| // TODO(dcarney) Remove this function. | | V8_DEPRECATED("Use Isolate::GetCallingContext instead", | |
| /** Deprecated. Use Isolate::GetCallingContext instead. */ | | static Local<Context> GetCalling()); | |
| static Local<Context> GetCalling(); | | | |
| | | | |
| /** | | /** | |
| * Sets the security token for the context. To access an object in | | * Sets the security token for the context. To access an object in | |
| * another context, the security tokens must match. | | * another context, the security tokens must match. | |
| */ | | */ | |
| void SetSecurityToken(Handle<Value> token); | | void SetSecurityToken(Handle<Value> token); | |
| | | | |
| /** Restores the security token to the default value. */ | | /** Restores the security token to the default value. */ | |
| void UseDefaultSecurityToken(); | | void UseDefaultSecurityToken(); | |
| | | | |
| | | | |
| skipping to change at line 5097 | | skipping to change at line 5045 | |
| * // V8 Now no longer locked. | | * // V8 Now no longer locked. | |
| * \endcode | | * \endcode | |
| */ | | */ | |
| class V8_EXPORT Unlocker { | | class V8_EXPORT Unlocker { | |
| public: | | public: | |
| /** | | /** | |
| * Initialize Unlocker for a given Isolate. | | * Initialize Unlocker for a given Isolate. | |
| */ | | */ | |
| V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); } | | V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); } | |
| | | | |
|
| /** Deprecated. Use Isolate version instead. */ | | | |
| V8_DEPRECATED(Unlocker()); | | | |
| | | | |
| ~Unlocker(); | | ~Unlocker(); | |
| private: | | private: | |
| void Initialize(Isolate* isolate); | | void Initialize(Isolate* isolate); | |
| | | | |
| internal::Isolate* isolate_; | | internal::Isolate* isolate_; | |
| }; | | }; | |
| | | | |
| class V8_EXPORT Locker { | | class V8_EXPORT Locker { | |
| public: | | public: | |
| /** | | /** | |
| * Initialize Locker for a given Isolate. | | * Initialize Locker for a given Isolate. | |
| */ | | */ | |
| V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); } | | V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); } | |
| | | | |
|
| /** Deprecated. Use Isolate version instead. */ | | | |
| V8_DEPRECATED(Locker()); | | | |
| | | | |
| ~Locker(); | | ~Locker(); | |
| | | | |
| /** | | /** | |
| * Start preemption. | | * Start preemption. | |
| * | | * | |
| * When preemption is started, a timer is fired every n milliseconds | | * When preemption is started, a timer is fired every n milliseconds | |
| * that will switch between multiple threads that are in contention | | * that will switch between multiple threads that are in contention | |
| * for the V8 lock. | | * for the V8 lock. | |
| */ | | */ | |
|
| static void StartPreemption(int every_n_ms); | | static void StartPreemption(Isolate* isolate, int every_n_ms); | |
| | | | |
| /** | | /** | |
| * Stop preemption. | | * Stop preemption. | |
| */ | | */ | |
|
| static void StopPreemption(); | | static void StopPreemption(Isolate* isolate); | |
| | | | |
| /** | | /** | |
| * Returns whether or not the locker for a given isolate, is locked by th
e | | * Returns whether or not the locker for a given isolate, is locked by th
e | |
| * current thread. | | * current thread. | |
| */ | | */ | |
| static bool IsLocked(Isolate* isolate); | | static bool IsLocked(Isolate* isolate); | |
| | | | |
| /** | | /** | |
| * Returns whether v8::Locker is being used by this V8 instance. | | * Returns whether v8::Locker is being used by this V8 instance. | |
| */ | | */ | |
| | | | |
End of changes. 29 change blocks. |
| 86 lines changed or deleted | | 22 lines changed or added | |
|
| v8config.h | | v8config.h | |
| | | | |
| skipping to change at line 242 | | skipping to change at line 242 | |
| # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) | | # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) | |
| | | | |
| # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) | | # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) | |
| | | | |
| # define V8_HAS_ATTRIBUTE_ALIGNED (V8_GNUC_PREREQ(2, 95, 0)) | | # define V8_HAS_ATTRIBUTE_ALIGNED (V8_GNUC_PREREQ(2, 95, 0)) | |
| // always_inline is available in gcc 4.0 but not very reliable until 4.4. | | // always_inline is available in gcc 4.0 but not very reliable until 4.4. | |
| // Works around "sorry, unimplemented: inlining failed" build errors with | | // Works around "sorry, unimplemented: inlining failed" build errors with | |
| // older compilers. | | // older compilers. | |
| # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (V8_GNUC_PREREQ(4, 4, 0)) | | # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (V8_GNUC_PREREQ(4, 4, 0)) | |
| # define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0)) | | # define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0)) | |
|
| | | # define V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE (V8_GNUC_PREREQ(4, 5, 0)) | |
| # define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0)) | | # define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0)) | |
| # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) | | # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) | |
| # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | | # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | |
| (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) | | (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) | |
| | | | |
| # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) | | # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) | |
| | | | |
| // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality | | // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality | |
| // without warnings (functionality used by the macros below). These modes | | // without warnings (functionality used by the macros below). These modes | |
| // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined
or, | | // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined
or, | |
| | | | |
| skipping to change at line 314 | | skipping to change at line 315 | |
| // V8_NOINLINE int GetMinusOne() { return -1; } | | // V8_NOINLINE int GetMinusOne() { return -1; } | |
| #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE | | #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE | |
| # define V8_NOINLINE __attribute__((noinline)) | | # define V8_NOINLINE __attribute__((noinline)) | |
| #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE | | #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE | |
| # define V8_NOINLINE __declspec(noinline) | | # define V8_NOINLINE __declspec(noinline) | |
| #else | | #else | |
| # define V8_NOINLINE /* NOT SUPPORTED */ | | # define V8_NOINLINE /* NOT SUPPORTED */ | |
| #endif | | #endif | |
| | | | |
| // A macro to mark classes or functions as deprecated. | | // A macro to mark classes or functions as deprecated. | |
|
| #if !V8_DISABLE_DEPRECATIONS && V8_HAS_ATTRIBUTE_DEPRECATED | | #if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE | |
| # define V8_DEPRECATED(declarator) declarator __attribute__((deprecated)) | | # define V8_DEPRECATED(message, declarator) \ | |
| #elif !V8_DISABLE_DEPRECATIONS && V8_HAS_DECLSPEC_DEPRECATED | | declarator __attribute__((deprecated(message))) | |
| # define V8_DEPRECATED(declarator) __declspec(deprecated) declarator | | #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED | |
| | | # define V8_DEPRECATED(message, declarator) \ | |
| | | declarator __attribute__((deprecated)) | |
| | | #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED | |
| | | # define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarat | |
| | | or | |
| #else | | #else | |
|
| # define V8_DEPRECATED(declarator) declarator | | # define V8_DEPRECATED(message, declarator) declarator | |
| #endif | | #endif | |
| | | | |
| // Annotate a function indicating the caller must examine the return value. | | // Annotate a function indicating the caller must examine the return value. | |
| // Use like: | | // Use like: | |
| // int foo() V8_WARN_UNUSED_RESULT; | | // int foo() V8_WARN_UNUSED_RESULT; | |
| #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | | #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | |
| # define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | | # define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | |
| #else | | #else | |
| # define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | | # define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 5 lines changed or deleted | | 11 lines changed or added | |
|