diff options
Diffstat (limited to 'src/3rdparty/v8/src/handles.h')
-rw-r--r-- | src/3rdparty/v8/src/handles.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/3rdparty/v8/src/handles.h b/src/3rdparty/v8/src/handles.h index 960696b..b80dbe5 100644 --- a/src/3rdparty/v8/src/handles.h +++ b/src/3rdparty/v8/src/handles.h @@ -95,6 +95,17 @@ class Handle { }; +// Convenience wrapper. +template<class T> +inline Handle<T> handle(T* t) { + return Handle<T>(t); +} + + +class DeferredHandles; +class HandleScopeImplementer; + + // A stack-allocated class that governs a number of local handles. // After a handle scope has been created, all local handles will be // allocated within that handle scope until either the handle scope is @@ -156,8 +167,37 @@ class HandleScope { // Zaps the handles in the half-open interval [start, end). static void ZapRange(internal::Object** start, internal::Object** end); + friend class v8::internal::DeferredHandles; friend class v8::HandleScope; + friend class v8::internal::HandleScopeImplementer; friend class v8::ImplementationUtilities; + friend class v8::internal::Isolate; +}; + + +class DeferredHandles; + + +class DeferredHandleScope { + public: + explicit DeferredHandleScope(Isolate* isolate); + // The DeferredHandles object returned stores the Handles created + // since the creation of this DeferredHandleScope. The Handles are + // alive as long as the DeferredHandles object is alive. + DeferredHandles* Detach(); + ~DeferredHandleScope(); + + private: + Object** prev_limit_; + Object** prev_next_; + HandleScopeImplementer* impl_; + +#ifdef DEBUG + bool handles_detached_; + int prev_level_; +#endif + + friend class HandleScopeImplementer; }; @@ -216,7 +256,7 @@ Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray>, // if none exists. Handle<JSValue> GetScriptWrapper(Handle<Script> script); -// Script line number computations. +// Script line number computations. Note that the line number is zero-based. void InitScriptLineEnds(Handle<Script> script); // For string calculates an array of line end positions. If the string // does not end with a new line character, this character may optionally be @@ -227,6 +267,7 @@ int GetScriptLineNumber(Handle<Script> script, int code_position); // The safe version does not make heap allocations but may work much slower. int GetScriptLineNumberSafe(Handle<Script> script, int code_position); int GetScriptColumnNumber(Handle<Script> script, int code_position); +Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script); // Computes the enumerable keys from interceptors. Used for debug mirrors and // by GetKeysInFixedArrayFor below. @@ -243,6 +284,7 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object, KeyCollectionType type, bool* threw); Handle<JSArray> GetKeysFor(Handle<JSReceiver> object, bool* threw); +Handle<FixedArray> ReduceFixedArrayTo(Handle<FixedArray> array, int length); Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, bool cache_result); @@ -294,6 +336,7 @@ class NoHandleAllocation BASE_EMBEDDED { inline ~NoHandleAllocation(); private: int level_; + bool active_; #endif }; |