From 9fddd83cf9adf505bce2e2373881df0c4d41b261 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Sun, 23 Aug 2015 06:09:40 -0700 Subject: deps: upgrade V8 to 4.5.103.24 Upgrade to the latest branch-head for V8 4.5. For the full commit log see https://github.com/v8/v8-git-mirror/commits/4.5.103.24 PR-URL: https://github.com/nodejs/node/pull/2509 Reviewed-By: Ben Noordhuis --- deps/v8/include/v8.h | 1133 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 725 insertions(+), 408 deletions(-) (limited to 'deps/v8/include/v8.h') diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 910279b52e..6e1db3a581 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -94,6 +94,7 @@ class Primitive; class Promise; class RawOperationDescriptor; class Script; +class SharedArrayBuffer; class Signature; class StartupData; class StackFrame; @@ -102,7 +103,6 @@ class String; class StringObject; class Symbol; class SymbolObject; -class Private; class Uint32; class Utils; class Value; @@ -215,8 +215,8 @@ class Local { : val_(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible - * handles. For example, converting from a Handle to a - * Handle. + * handles. For example, converting from a Local to a + * Local. */ TYPE_CHECK(T, S); } @@ -311,7 +311,6 @@ class Local { friend class String; friend class Object; friend class Context; - friend class Private; template friend class internal::CustomArguments; friend Local Undefined(Isolate* isolate); friend Local Null(Isolate* isolate); @@ -331,9 +330,11 @@ class Local { }; -// Handle is an alias for Local for historical reasons. +#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) +// Local is an alias for Local for historical reasons. template using Handle = Local; +#endif /** @@ -418,11 +419,11 @@ class WeakCallbackInfo { V8_INLINE void* GetInternalField(int index) const; V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField1()) const { + void* GetInternalField1() const) { return internal_fields_[0]; } V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField2()) const { + void* GetInternalField2() const) { return internal_fields_[1]; } @@ -496,7 +497,7 @@ template class PersistentBase { * and create a new one with the contents of other if other is non empty */ template - V8_INLINE void Reset(Isolate* isolate, const Handle& other); + V8_INLINE void Reset(Isolate* isolate, const Local& other); /** * If non-empty, destroy the underlying storage cell @@ -517,7 +518,8 @@ template class PersistentBase { return *a == *b; } - template V8_INLINE bool operator==(const Handle& that) const { + template + V8_INLINE bool operator==(const Local& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); if (a == NULL) return b == NULL; @@ -530,7 +532,8 @@ template class PersistentBase { return !operator==(that); } - template V8_INLINE bool operator!=(const Handle& that) const { + template + V8_INLINE bool operator!=(const Local& that) const { return !operator==(that); } @@ -693,11 +696,12 @@ template class Persistent : public PersistentBase { */ V8_INLINE Persistent() : PersistentBase(0) { } /** - * Construct a Persistent from a Handle. - * When the Handle is non-empty, a new storage cell is created + * Construct a Persistent from a Local. + * When the Local is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ - template V8_INLINE Persistent(Isolate* isolate, Handle that) + template + V8_INLINE Persistent(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { TYPE_CHECK(T, S); } @@ -785,12 +789,12 @@ class Global : public PersistentBase { */ V8_INLINE Global() : PersistentBase(nullptr) {} /** - * Construct a Global from a Handle. - * When the Handle is non-empty, a new storage cell is created + * Construct a Global from a Local. + * When the Local is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ template - V8_INLINE Global(Isolate* isolate, Handle that) + V8_INLINE Global(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { TYPE_CHECK(T, S); } @@ -835,8 +839,11 @@ class Global : public PersistentBase { typedef void MoveOnlyTypeForCPP03; private: + template + friend class ReturnValue; Global(Global&) = delete; void operator=(Global&) = delete; + V8_INLINE T* operator*() const { return this->val_; } }; @@ -972,45 +979,69 @@ class V8_EXPORT Data { }; +/** + * The optional attributes of ScriptOrigin. + */ +class ScriptOriginOptions { + public: + V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, + bool is_shared_cross_origin = false, + bool is_opaque = false) + : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | + (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | + (is_opaque ? kIsOpaque : 0)) {} + V8_INLINE ScriptOriginOptions(int flags) + : flags_(flags & + (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} + bool IsEmbedderDebugScript() const { + return (flags_ & kIsEmbedderDebugScript) != 0; + } + bool IsSharedCrossOrigin() const { + return (flags_ & kIsSharedCrossOrigin) != 0; + } + bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } + int Flags() const { return flags_; } + + private: + enum { + kIsEmbedderDebugScript = 1, + kIsSharedCrossOrigin = 1 << 1, + kIsOpaque = 1 << 2 + }; + const int flags_; +}; + /** * The origin, within a file, of a script. */ class ScriptOrigin { public: V8_INLINE ScriptOrigin( - Handle resource_name, - Handle resource_line_offset = Handle(), - Handle resource_column_offset = Handle(), - Handle resource_is_shared_cross_origin = Handle(), - Handle script_id = Handle(), - Handle resource_is_embedder_debug_script = Handle(), - Handle source_map_url = Handle()) - : resource_name_(resource_name), - resource_line_offset_(resource_line_offset), - resource_column_offset_(resource_column_offset), - resource_is_embedder_debug_script_(resource_is_embedder_debug_script), - resource_is_shared_cross_origin_(resource_is_shared_cross_origin), - script_id_(script_id), - source_map_url_(source_map_url) {} - V8_INLINE Handle ResourceName() const; - V8_INLINE Handle ResourceLineOffset() const; - V8_INLINE Handle ResourceColumnOffset() const; + Local resource_name, + Local resource_line_offset = Local(), + Local resource_column_offset = Local(), + Local resource_is_shared_cross_origin = Local(), + Local script_id = Local(), + Local resource_is_embedder_debug_script = Local(), + Local source_map_url = Local(), + Local resource_is_opaque = Local()); + V8_INLINE Local ResourceName() const; + V8_INLINE Local ResourceLineOffset() const; + V8_INLINE Local ResourceColumnOffset() const; /** * Returns true for embedder's debugger scripts */ - V8_INLINE Handle ResourceIsEmbedderDebugScript() const; - V8_INLINE Handle ResourceIsSharedCrossOrigin() const; - V8_INLINE Handle ScriptID() const; - V8_INLINE Handle SourceMapUrl() const; + V8_INLINE Local ScriptID() const; + V8_INLINE Local SourceMapUrl() const; + V8_INLINE ScriptOriginOptions Options() const { return options_; } private: - Handle resource_name_; - Handle resource_line_offset_; - Handle resource_column_offset_; - Handle resource_is_embedder_debug_script_; - Handle resource_is_shared_cross_origin_; - Handle script_id_; - Handle source_map_url_; + Local resource_name_; + Local resource_line_offset_; + Local resource_column_offset_; + ScriptOriginOptions options_; + Local script_id_; + Local source_map_url_; }; @@ -1025,16 +1056,16 @@ class V8_EXPORT UnboundScript { Local