| v8.h | | v8.h | |
| | | | |
| skipping to change at line 1241 | | skipping to change at line 1241 | |
| */ | | */ | |
| bool IsEval() const; | | bool IsEval() const; | |
| | | | |
| /** | | /** | |
| * Returns whether or not the associated function is called as a | | * Returns whether or not the associated function is called as a | |
| * constructor via "new". | | * constructor via "new". | |
| */ | | */ | |
| bool IsConstructor() const; | | bool IsConstructor() const; | |
| }; | | }; | |
| | | | |
|
| | | /** | |
| | | * A JSON Parser. | |
| | | */ | |
| | | class V8EXPORT JSON { | |
| | | public: | |
| | | /** | |
| | | * Tries to parse the string |json_string| and returns it as object if | |
| | | * successful. | |
| | | * | |
| | | * \param json_string The string to parse. | |
| | | * \return The corresponding object if successfully parsed. | |
| | | */ | |
| | | static Local<Object> Parse(Local<String> json_string); | |
| | | }; | |
| | | | |
| // --- Value --- | | // --- Value --- | |
| | | | |
| /** | | /** | |
| * The superclass of all JavaScript values and objects. | | * The superclass of all JavaScript values and objects. | |
| */ | | */ | |
| class V8EXPORT Value : public Data { | | class V8EXPORT Value : public Data { | |
| public: | | public: | |
| /** | | /** | |
| * Returns true if this value is the undefined value. See ECMA-262 | | * Returns true if this value is the undefined value. See ECMA-262 | |
| * 4.3.10. | | * 4.3.10. | |
| | | | |
| skipping to change at line 2396 | | skipping to change at line 2411 | |
| * Allocate |length| bytes. Return NULL if allocation is not successful
. | | * Allocate |length| bytes. Return NULL if allocation is not successful
. | |
| * Memory does not have to be initialized. | | * Memory does not have to be initialized. | |
| */ | | */ | |
| virtual void* AllocateUninitialized(size_t length) { | | virtual void* AllocateUninitialized(size_t length) { | |
| // Override with call to |Allocate| for compatibility | | // Override with call to |Allocate| for compatibility | |
| // with legacy version. | | // with legacy version. | |
| return Allocate(length); | | return Allocate(length); | |
| } | | } | |
| | | | |
| /** | | /** | |
|
| * Free the memory pointed to |data|. That memory is guaranteed to be | | * Free the memory block of size |length|, pointed to by |data|. | |
| * previously allocated by |Allocate|. | | * That memory is guaranteed to be previously allocated by |Allocate|. | |
| */ | | */ | |
|
| virtual void Free(void* data) = 0; | | virtual void Free(void* data, size_t length) { | |
| | | // Override with call to |Free(void*)| for compatibility | |
| | | // with legacy version. | |
| | | Free(data); | |
| | | } | |
| | | | |
| | | /** | |
| | | * Deprecated. Never called directly by V8. | |
| | | * For compatibility with legacy version of this interface. | |
| | | */ | |
| | | virtual void Free(void* data); | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * The contents of an |ArrayBuffer|. Externalization of |ArrayBuffer| | | * The contents of an |ArrayBuffer|. Externalization of |ArrayBuffer| | |
| * returns an instance of this class, populated, with a pointer to data | | * returns an instance of this class, populated, with a pointer to data | |
| * and byte length. | | * and byte length. | |
| * | | * | |
| * The Data pointer of ArrayBuffer::Contents is always allocated with | | * The Data pointer of ArrayBuffer::Contents is always allocated with | |
| * Allocator::Allocate that is set with V8::SetArrayBufferAllocator. | | * Allocator::Allocate that is set with V8::SetArrayBufferAllocator. | |
| * | | * | |
| | | | |
| skipping to change at line 5328 | | skipping to change at line 5353 | |
| static const int kStringEncodingMask = 0x4; | | static const int kStringEncodingMask = 0x4; | |
| static const int kExternalTwoByteRepresentationTag = 0x02; | | static const int kExternalTwoByteRepresentationTag = 0x02; | |
| static const int kExternalAsciiRepresentationTag = 0x06; | | static const int kExternalAsciiRepresentationTag = 0x06; | |
| | | | |
| static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize; | | static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize; | |
| static const int kIsolateRootsOffset = 3 * kApiPointerSize; | | static const int kIsolateRootsOffset = 3 * kApiPointerSize; | |
| static const int kUndefinedValueRootIndex = 5; | | static const int kUndefinedValueRootIndex = 5; | |
| static const int kNullValueRootIndex = 7; | | static const int kNullValueRootIndex = 7; | |
| static const int kTrueValueRootIndex = 8; | | static const int kTrueValueRootIndex = 8; | |
| static const int kFalseValueRootIndex = 9; | | static const int kFalseValueRootIndex = 9; | |
|
| static const int kEmptyStringRootIndex = 135; | | static const int kEmptyStringRootIndex = 133; | |
| | | | |
| static const int kNodeClassIdOffset = 1 * kApiPointerSize; | | static const int kNodeClassIdOffset = 1 * kApiPointerSize; | |
| static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; | | static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; | |
| static const int kNodeStateMask = 0xf; | | static const int kNodeStateMask = 0xf; | |
| static const int kNodeStateIsWeakValue = 2; | | static const int kNodeStateIsWeakValue = 2; | |
|
| | | static const int kNodeStateIsPendingValue = 3; | |
| static const int kNodeStateIsNearDeathValue = 4; | | static const int kNodeStateIsNearDeathValue = 4; | |
| static const int kNodeIsIndependentShift = 4; | | static const int kNodeIsIndependentShift = 4; | |
| static const int kNodeIsPartiallyDependentShift = 5; | | static const int kNodeIsPartiallyDependentShift = 5; | |
| | | | |
| static const int kJSObjectType = 0xb1; | | static const int kJSObjectType = 0xb1; | |
| static const int kFirstNonstringType = 0x80; | | static const int kFirstNonstringType = 0x80; | |
| static const int kOddballType = 0x83; | | static const int kOddballType = 0x83; | |
| static const int kForeignType = 0x87; | | static const int kForeignType = 0x87; | |
| | | | |
| static const int kUndefinedOddballKind = 5; | | static const int kUndefinedOddballKind = 5; | |
| | | | |
| skipping to change at line 5540 | | skipping to change at line 5566 | |
| typedef internal::Internals I; | | typedef internal::Internals I; | |
| if (this->IsEmpty()) return false; | | if (this->IsEmpty()) return false; | |
| return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_), | | return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_), | |
| I::kNodeIsIndependentShift); | | I::kNodeIsIndependentShift); | |
| } | | } | |
| | | | |
| template <class T> | | template <class T> | |
| bool Persistent<T>::IsNearDeath() const { | | bool Persistent<T>::IsNearDeath() const { | |
| typedef internal::Internals I; | | typedef internal::Internals I; | |
| if (this->IsEmpty()) return false; | | if (this->IsEmpty()) return false; | |
|
| return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) | | uint8_t node_state = | |
| == | | I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)); | |
| I::kNodeStateIsNearDeathValue; | | return node_state == I::kNodeStateIsNearDeathValue || | |
| | | node_state == I::kNodeStateIsPendingValue; | |
| } | | } | |
| | | | |
| template <class T> | | template <class T> | |
| bool Persistent<T>::IsWeak() const { | | bool Persistent<T>::IsWeak() const { | |
| typedef internal::Internals I; | | typedef internal::Internals I; | |
| if (this->IsEmpty()) return false; | | if (this->IsEmpty()) return false; | |
| return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_))
== | | return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_))
== | |
| I::kNodeStateIsWeakValue; | | I::kNodeStateIsWeakValue; | |
| } | | } | |
| | | | |
| | | | |
End of changes. 6 change blocks. |
| 7 lines changed or deleted | | 34 lines changed or added | |
|