v8-profiler.h   v8-profiler.h 
skipping to change at line 172 skipping to change at line 172
public: public:
/** /**
* A note on security tokens usage. As scripts from different * A note on security tokens usage. As scripts from different
* origins can run inside a single V8 instance, it is possible to * origins can run inside a single V8 instance, it is possible to
* have functions from different security contexts intermixed in a * have functions from different security contexts intermixed in a
* single CPU profile. To avoid exposing function names belonging to * single CPU profile. To avoid exposing function names belonging to
* other contexts, filtering by security token is performed while * other contexts, filtering by security token is performed while
* obtaining profiling results. * obtaining profiling results.
*/ */
/** Deprecated. Use GetProfileCount instead. */
V8_DEPRECATED(static int GetProfilesCount());
/** /**
* Returns the number of profiles collected (doesn't include * Returns the number of profiles collected (doesn't include
* profiles that are being collected at the moment of call.) * profiles that are being collected at the moment of call.)
*/ */
int GetProfileCount(); int GetProfileCount();
/** Deprecated. Use GetCpuProfile instead. */
V8_DEPRECATED(static const CpuProfile* GetProfile(
int index,
Handle<Value> security_token = Handle<Value>()));
/** Deprecated. Use GetCpuProfile with single parameter. */ /** Deprecated. Use GetCpuProfile with single parameter. */
V8_DEPRECATED(const CpuProfile* GetCpuProfile( V8_DEPRECATED(const CpuProfile* GetCpuProfile(
int index, int index,
Handle<Value> security_token)); Handle<Value> security_token));
/** Returns a profile by index. */ /** Returns a profile by index. */
const CpuProfile* GetCpuProfile(int index); const CpuProfile* GetCpuProfile(int index);
/** Deprecated. Use FindProfile instead. */
V8_DEPRECATED(static const CpuProfile* FindProfile(
unsigned uid,
Handle<Value> security_token = Handle<Value>()));
/** Returns a profile by uid. */ /** Returns a profile by uid. */
V8_DEPRECATED(const CpuProfile* FindCpuProfile( V8_DEPRECATED(const CpuProfile* FindCpuProfile(
unsigned uid, unsigned uid,
Handle<Value> security_token = Handle<Value>())); Handle<Value> security_token = Handle<Value>()));
/** Deprecated. Use StartCpuProfiling instead. */
V8_DEPRECATED(static void StartProfiling(Handle<String> title,
bool record_samples = false));
/** /**
* Starts collecting CPU profile. Title may be an empty string. It * Starts collecting CPU profile. Title may be an empty string. It
* is allowed to have several profiles being collected at * is allowed to have several profiles being collected at
* once. Attempts to start collecting several profiles with the same * once. Attempts to start collecting several profiles with the same
* title are silently ignored. While collecting a profile, functions * title are silently ignored. While collecting a profile, functions
* from all security contexts are included in it. The token-based * from all security contexts are included in it. The token-based
* filtering is only performed when querying for a profile. * filtering is only performed when querying for a profile.
* *
* |record_samples| parameter controls whether individual samples should * |record_samples| parameter controls whether individual samples should
* be recorded in addition to the aggregated tree. * be recorded in addition to the aggregated tree.
*/ */
void StartCpuProfiling(Handle<String> title, bool record_samples = false) ; void StartCpuProfiling(Handle<String> title, bool record_samples = false) ;
/** Deprecated. Use StopCpuProfiling instead. */
V8_DEPRECATED(static const CpuProfile* StopProfiling(
Handle<String> title,
Handle<Value> security_token = Handle<Value>()));
/** /**
* Deprecated. Use StopCpuProfiling with one parameter instead. * Deprecated. Use StopCpuProfiling with one parameter instead.
*/ */
V8_DEPRECATED(const CpuProfile* StopCpuProfiling( V8_DEPRECATED(const CpuProfile* StopCpuProfiling(
Handle<String> title, Handle<String> title,
Handle<Value> security_token)); Handle<Value> security_token));
/** /**
* Stops collecting CPU profile with a given title and returns it. * Stops collecting CPU profile with a given title and returns it.
* If the title given is empty, finishes the last profile started. * If the title given is empty, finishes the last profile started.
*/ */
const CpuProfile* StopCpuProfiling(Handle<String> title); const CpuProfile* StopCpuProfiling(Handle<String> title);
/** Deprecated. Use DeleteAllCpuProfiles instead. */
V8_DEPRECATED(static void DeleteAllProfiles());
/** /**
* Deletes all existing profiles, also cancelling all profiling * Deletes all existing profiles, also cancelling all profiling
* activity. All previously returned pointers to profiles and their * activity. All previously returned pointers to profiles and their
* contents become invalid after this call. * contents become invalid after this call.
*/ */
void DeleteAllCpuProfiles(); void DeleteAllCpuProfiles();
private: private:
CpuProfiler(); CpuProfiler();
~CpuProfiler(); ~CpuProfiler();
skipping to change at line 342 skipping to change at line 323
* if the value is still reachable. * if the value is still reachable.
*/ */
Handle<Value> GetHeapValue() const; Handle<Value> GetHeapValue() const;
}; };
/** /**
* HeapSnapshots record the state of the JS heap at some moment. * HeapSnapshots record the state of the JS heap at some moment.
*/ */
class V8EXPORT HeapSnapshot { class V8EXPORT HeapSnapshot {
public: public:
enum Type {
kFull = 0 // Heap snapshot with all instances and references.
};
enum SerializationFormat { enum SerializationFormat {
kJSON = 0 // See format description near 'Serialize' method. kJSON = 0 // See format description near 'Serialize' method.
}; };
/** Deprecated. Returns kFull. */
V8_DEPRECATED(Type GetType() const);
/** Returns heap snapshot UID (assigned by the profiler.) */ /** Returns heap snapshot UID (assigned by the profiler.) */
unsigned GetUid() const; unsigned GetUid() const;
/** Returns heap snapshot title. */ /** Returns heap snapshot title. */
Handle<String> GetTitle() const; Handle<String> GetTitle() const;
/** Returns the root node of the heap graph. */ /** Returns the root node of the heap graph. */
const HeapGraphNode* GetRoot() const; const HeapGraphNode* GetRoot() const;
/** Returns a node by its id. */ /** Returns a node by its id. */
skipping to change at line 426 skipping to change at line 401
public: public:
/** /**
* Callback function invoked for obtaining RetainedObjectInfo for * Callback function invoked for obtaining RetainedObjectInfo for
* the given JavaScript wrapper object. It is prohibited to enter V8 * the given JavaScript wrapper object. It is prohibited to enter V8
* while the callback is running: only getters on the handle and * while the callback is running: only getters on the handle and
* GetPointerFromInternalField on the objects are allowed. * GetPointerFromInternalField on the objects are allowed.
*/ */
typedef RetainedObjectInfo* (*WrapperInfoCallback) typedef RetainedObjectInfo* (*WrapperInfoCallback)
(uint16_t class_id, Handle<Value> wrapper); (uint16_t class_id, Handle<Value> wrapper);
/** Deprecated. Use GetSnapshotCount instead. */
V8_DEPRECATED(static int GetSnapshotsCount());
/** Returns the number of snapshots taken. */ /** Returns the number of snapshots taken. */
int GetSnapshotCount(); int GetSnapshotCount();
/** Deprecated. Use GetHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* GetSnapshot(int index));
/** Returns a snapshot by index. */ /** Returns a snapshot by index. */
const HeapSnapshot* GetHeapSnapshot(int index); const HeapSnapshot* GetHeapSnapshot(int index);
/** Deprecated. Use FindHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* FindSnapshot(unsigned uid));
/** Returns a profile by uid. */ /** Returns a profile by uid. */
V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid)); V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid));
/** Deprecated. Use GetObjectId instead. */
V8_DEPRECATED(static SnapshotObjectId GetSnapshotObjectId(
Handle<Value> value));
/** /**
* Returns SnapshotObjectId for a heap object referenced by |value| if * Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise. * it has been seen by the heap profiler, kUnknownObjectId otherwise.
*/ */
SnapshotObjectId GetObjectId(Handle<Value> value); SnapshotObjectId GetObjectId(Handle<Value> value);
/** /**
* A constant for invalid SnapshotObjectId. GetSnapshotObjectId will retu rn * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will retu rn
* it in case heap profiler cannot find id for the object passed as * it in case heap profiler cannot find id for the object passed as
* parameter. HeapSnapshot::GetNodeById will always return NULL for such id. * parameter. HeapSnapshot::GetNodeById will always return NULL for such id.
skipping to change at line 471 skipping to change at line 437
public: public:
/** /**
* Returns name to be used in the heap snapshot for given node. Returne d * Returns name to be used in the heap snapshot for given node. Returne d
* string must stay alive until snapshot collection is completed. * string must stay alive until snapshot collection is completed.
*/ */
virtual const char* GetName(Handle<Object> object) = 0; virtual const char* GetName(Handle<Object> object) = 0;
protected: protected:
virtual ~ObjectNameResolver() {} virtual ~ObjectNameResolver() {}
}; };
/** Deprecated. Use TakeHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* TakeSnapshot(
Handle<String> title,
HeapSnapshot::Type type = HeapSnapshot::kFull,
ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = NULL));
/** /**
* Takes a heap snapshot and returns it. Title may be an empty string. * Takes a heap snapshot and returns it. Title may be an empty string.
*/ */
const HeapSnapshot* TakeHeapSnapshot( const HeapSnapshot* TakeHeapSnapshot(
Handle<String> title, Handle<String> title,
ActivityControl* control = NULL, ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = NULL); ObjectNameResolver* global_object_name_resolver = NULL);
/** Deprecated. Use StartTrackingHeapObjects instead. */
V8_DEPRECATED(static void StartHeapObjectsTracking());
/** /**
* Starts tracking of heap objects population statistics. After calling * Starts tracking of heap objects population statistics. After calling
* this method, all heap objects relocations done by the garbage collecto r * this method, all heap objects relocations done by the garbage collecto r
* are being registered. * are being registered.
*/ */
void StartTrackingHeapObjects(); void StartTrackingHeapObjects();
/** Deprecated. Use GetHeapStats instead. */
V8_DEPRECATED(static SnapshotObjectId PushHeapObjectsStats(
OutputStream* stream));
/** /**
* Adds a new time interval entry to the aggregated statistics array. The * Adds a new time interval entry to the aggregated statistics array. The
* time interval entry contains information on the current heap objects * time interval entry contains information on the current heap objects
* population size. The method also updates aggregated statistics and * population size. The method also updates aggregated statistics and
* reports updates for all previous time intervals via the OutputStream * reports updates for all previous time intervals via the OutputStream
* object. Updates on each time interval are provided as a stream of the * object. Updates on each time interval are provided as a stream of the
* HeapStatsUpdate structure instances. * HeapStatsUpdate structure instances.
* The return value of the function is the last seen heap object Id. * The return value of the function is the last seen heap object Id.
* *
* StartTrackingHeapObjects must be called before the first call to this * StartTrackingHeapObjects must be called before the first call to this
* method. * method.
*/ */
SnapshotObjectId GetHeapStats(OutputStream* stream); SnapshotObjectId GetHeapStats(OutputStream* stream);
/** Deprecated. Use StopTrackingHeapObjects instead. */
V8_DEPRECATED(static void StopHeapObjectsTracking());
/** /**
* Stops tracking of heap objects population statistics, cleans up all * Stops tracking of heap objects population statistics, cleans up all
* collected data. StartHeapObjectsTracking must be called again prior to * collected data. StartHeapObjectsTracking must be called again prior to
* calling PushHeapObjectsStats next time. * calling PushHeapObjectsStats next time.
*/ */
void StopTrackingHeapObjects(); void StopTrackingHeapObjects();
/** Deprecated. Use DeleteAllHeapSnapshots instead. */
V8_DEPRECATED(static void DeleteAllSnapshots());
/** /**
* Deletes all snapshots taken. All previously returned pointers to * Deletes all snapshots taken. All previously returned pointers to
* snapshots and their contents become invalid after this call. * snapshots and their contents become invalid after this call.
*/ */
void DeleteAllHeapSnapshots(); void DeleteAllHeapSnapshots();
/** Deprecated. Use SetWrapperClassInfoProvider instead. */
V8_DEPRECATED(static void DefineWrapperClass(
uint16_t class_id,
WrapperInfoCallback callback));
/** Binds a callback to embedder's class ID. */ /** Binds a callback to embedder's class ID. */
void SetWrapperClassInfoProvider( void SetWrapperClassInfoProvider(
uint16_t class_id, uint16_t class_id,
WrapperInfoCallback callback); WrapperInfoCallback callback);
/** /**
* Default value of persistent handle class ID. Must not be used to * Default value of persistent handle class ID. Must not be used to
* define a class. Can be used to reset a class of a persistent * define a class. Can be used to reset a class of a persistent
* handle. * handle.
*/ */
static const uint16_t kPersistentHandleNoClassId = 0; static const uint16_t kPersistentHandleNoClassId = 0;
/**
* Deprecated. Returns the number of currently existing persistent handle
s.
*/
V8_DEPRECATED(static int GetPersistentHandleCount());
/** Deprecated. Use GetHeapProfilerMemorySize instead. */
V8_DEPRECATED(static size_t GetMemorySizeUsedByProfiler());
/** Returns memory used for profiler internal data and snapshots. */ /** Returns memory used for profiler internal data and snapshots. */
size_t GetProfilerMemorySize(); size_t GetProfilerMemorySize();
/** /**
* Sets a RetainedObjectInfo for an object group (see V8::SetObjectGroupI d). * Sets a RetainedObjectInfo for an object group (see V8::SetObjectGroupI d).
*/ */
void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info);
private: private:
HeapProfiler(); HeapProfiler();
skipping to change at line 583 skipping to change at line 523
* prologue and epilogue callbacks. * prologue and epilogue callbacks.
* *
* 2. When a heap snapshot is collected, V8 additionally * 2. When a heap snapshot is collected, V8 additionally
* requests RetainedObjectInfos for persistent handles that * requests RetainedObjectInfos for persistent handles that
* were not previously reported via AddObjectGroup. * were not previously reported via AddObjectGroup.
* *
* Thus, if an embedder wants to provide information about native * Thus, if an embedder wants to provide information about native
* objects for heap snapshots, he can do it in a GC prologue * objects for heap snapshots, he can do it in a GC prologue
* handler, and / or by assigning wrapper class ids in the following way: * handler, and / or by assigning wrapper class ids in the following way:
* *
* 1. Bind a callback to class id by calling DefineWrapperClass. * 1. Bind a callback to class id by calling SetWrapperClassInfoProvider.
* 2. Call SetWrapperClassId on certain persistent handles. * 2. Call SetWrapperClassId on certain persistent handles.
* *
* V8 takes ownership of RetainedObjectInfo instances passed to it and * V8 takes ownership of RetainedObjectInfo instances passed to it and
* keeps them alive only during snapshot collection. Afterwards, they * keeps them alive only during snapshot collection. Afterwards, they
* are freed by calling the Dispose class function. * are freed by calling the Dispose class function.
*/ */
class V8EXPORT RetainedObjectInfo { // NOLINT class V8EXPORT RetainedObjectInfo { // NOLINT
public: public:
/** Called by V8 when it no longer needs an instance. */ /** Called by V8 when it no longer needs an instance. */
virtual void Dispose() = 0; virtual void Dispose() = 0;
 End of changes. 20 change blocks. 
62 lines changed or deleted 1 lines changed or added


 v8.h   v8.h 
skipping to change at line 157 skipping to change at line 157
class ObjectTemplate; class ObjectTemplate;
class Data; class Data;
class AccessorInfo; class AccessorInfo;
template<typename T> class PropertyCallbackInfo; template<typename T> class PropertyCallbackInfo;
class StackTrace; class StackTrace;
class StackFrame; class StackFrame;
class Isolate; class Isolate;
class DeclaredAccessorDescriptor; class DeclaredAccessorDescriptor;
class ObjectOperationDescriptor; class ObjectOperationDescriptor;
class RawOperationDescriptor; class RawOperationDescriptor;
class CallHandlerHelper;
namespace internal { namespace internal {
class Arguments; class Arguments;
class Heap; class Heap;
class HeapObject; class HeapObject;
class Isolate; class Isolate;
class Object; class Object;
template<typename T> class CustomArguments; template<typename T> class CustomArguments;
class PropertyCallbackArguments; class PropertyCallbackArguments;
class FunctionCallbackArguments; class FunctionCallbackArguments;
skipping to change at line 505 skipping to change at line 506
/** /**
* A constructor that creates a new global cell pointing to that. In cont rast * A constructor that creates a new global cell pointing to that. In cont rast
* to the copy constructor, this creates a new persistent handle which ne eds * to the copy constructor, this creates a new persistent handle which ne eds
* to be separately disposed. * to be separately disposed.
*/ */
template <class S> V8_INLINE(Persistent(Isolate* isolate, Handle<S> that) ) template <class S> V8_INLINE(Persistent(Isolate* isolate, Handle<S> that) )
: val_(New(isolate, *that)) { } : val_(New(isolate, *that)) { }
template <class S> V8_INLINE(Persistent(Isolate* isolate, template <class S> V8_INLINE(Persistent(Isolate* isolate,
Persistent<S>& that)) // NOLINT const Persistent<S>& that)) // NO LINT
: val_(New(isolate, *that)) { } : val_(New(isolate, *that)) { }
#else #else
/** /**
* Creates an empty persistent handle that doesn't point to any * Creates an empty persistent handle that doesn't point to any
* storage cell. * storage cell.
*/ */
V8_INLINE(Persistent()) : Handle<T>() { } V8_INLINE(Persistent()) : Handle<T>() { }
/** /**
skipping to change at line 1033 skipping to change at line 1034
* Runs the script returning the resulting value. If the script is * Runs the script returning the resulting value. If the script is
* context independent (created using ::New) it will be run in the * context independent (created using ::New) it will be run in the
* currently entered context. If it is context specific (created * currently entered context. If it is context specific (created
* using ::Compile) it will be run in the context in which it was * using ::Compile) it will be run in the context in which it was
* compiled. * compiled.
*/ */
Local<Value> Run(); Local<Value> Run();
/** /**
* Returns the script id value. * Returns the script id value.
* DEPRECATED: Please use GetId().
*/ */
Local<Value> Id(); Local<Value> Id();
/** /**
* Returns the script id.
*/
int GetId();
/**
* Associate an additional data object with the script. This is mainly us ed * Associate an additional data object with the script. This is mainly us ed
* with the debugger as this data object is only available through the * with the debugger as this data object is only available through the
* debugger API. * debugger API.
*/ */
void SetData(Handle<String> data); void SetData(Handle<String> data);
/** /**
* Returns the name value of one Script. * Returns the name value of one Script.
*/ */
Handle<Value> GetScriptName(); Handle<Value> GetScriptName();
/** /**
* Returns zero based line number of the code_pos location in the script. * Returns zero based line number of the code_pos location in the script.
* -1 will be returned if no information available. * -1 will be returned if no information available.
*/ */
int GetLineNumber(int code_pos); int GetLineNumber(int code_pos);
static const int kNoScriptId = 0;
}; };
/** /**
* An error message. * An error message.
*/ */
class V8EXPORT Message { class V8EXPORT Message {
public: public:
Local<String> Get() const; Local<String> Get() const;
Local<String> GetSourceLine() const; Local<String> GetSourceLine() const;
skipping to change at line 1346 skipping to change at line 1355
*/ */
bool IsRegExp() const; bool IsRegExp() const;
/** /**
* Returns true if this value is an ArrayBuffer. * Returns true if this value is an ArrayBuffer.
* This is an experimental feature. * This is an experimental feature.
*/ */
bool IsArrayBuffer() const; bool IsArrayBuffer() const;
/** /**
* Returns true if this value is an ArrayBufferView.
* This is an experimental feature.
*/
bool IsArrayBufferView() const;
/**
* Returns true if this value is one of TypedArrays. * Returns true if this value is one of TypedArrays.
* This is an experimental feature. * This is an experimental feature.
*/ */
bool IsTypedArray() const; bool IsTypedArray() const;
/** /**
* Returns true if this value is an Uint8Array. * Returns true if this value is an Uint8Array.
* This is an experimental feature. * This is an experimental feature.
*/ */
bool IsUint8Array() const; bool IsUint8Array() const;
skipping to change at line 1405 skipping to change at line 1420
* This is an experimental feature. * This is an experimental feature.
*/ */
bool IsFloat32Array() const; bool IsFloat32Array() const;
/** /**
* Returns true if this value is a Float64Array. * Returns true if this value is a Float64Array.
* This is an experimental feature. * This is an experimental feature.
*/ */
bool IsFloat64Array() const; bool IsFloat64Array() const;
/**
* Returns true if this value is a DataView.
* This is an experimental feature.
*/
bool IsDataView() const;
Local<Boolean> ToBoolean() const; Local<Boolean> ToBoolean() const;
Local<Number> ToNumber() const; Local<Number> ToNumber() const;
Local<String> ToString() const; Local<String> ToString() const;
Local<String> ToDetailString() const; Local<String> ToDetailString() const;
Local<Object> ToObject() const; Local<Object> ToObject() const;
Local<Integer> ToInteger() const; Local<Integer> ToInteger() const;
Local<Uint32> ToUint32() const; Local<Uint32> ToUint32() const;
Local<Int32> ToInt32() const; Local<Int32> ToInt32() const;
/** /**
skipping to change at line 2026 skipping to change at line 2047
bool Delete(Handle<Value> key); bool Delete(Handle<Value> key);
// Delete a property on this object bypassing interceptors and // Delete a property on this object bypassing interceptors and
// ignoring dont-delete attributes. // ignoring dont-delete attributes.
bool ForceDelete(Handle<Value> key); bool ForceDelete(Handle<Value> key);
bool Has(uint32_t index); bool Has(uint32_t index);
bool Delete(uint32_t index); bool Delete(uint32_t index);
// TODO(dcarney): deprecate V8_DEPRECATED(bool SetAccessor(Handle<String> name,
bool SetAccessor(Handle<String> name, AccessorGetter getter,
AccessorGetter getter, AccessorSetter setter = 0,
AccessorSetter setter = 0, Handle<Value> data = Handle<Value>(),
Handle<Value> data = Handle<Value>(), AccessControl settings = DEFAULT,
AccessControl settings = DEFAULT, PropertyAttribute attribute = None));
PropertyAttribute attribute = None);
bool SetAccessor(Handle<String> name, bool SetAccessor(Handle<String> name,
AccessorGetterCallback getter, AccessorGetterCallback getter,
AccessorSetterCallback setter = 0, AccessorSetterCallback setter = 0,
Handle<Value> data = Handle<Value>(), Handle<Value> data = Handle<Value>(),
AccessControl settings = DEFAULT, AccessControl settings = DEFAULT,
PropertyAttribute attribute = None); PropertyAttribute attribute = None);
// This function is not yet stable and should not be used at this time. // This function is not yet stable and should not be used at this time.
bool SetAccessor(Handle<String> name, bool SetAccessor(Handle<String> name,
Handle<DeclaredAccessorDescriptor> descriptor, Handle<DeclaredAccessorDescriptor> descriptor,
skipping to change at line 2306 skipping to change at line 2326
/** /**
* Returns zero based line number of function body and * Returns zero based line number of function body and
* kLineOffsetNotFound if no information available. * kLineOffsetNotFound if no information available.
*/ */
int GetScriptLineNumber() const; int GetScriptLineNumber() const;
/** /**
* Returns zero based column number of function body and * Returns zero based column number of function body and
* kLineOffsetNotFound if no information available. * kLineOffsetNotFound if no information available.
*/ */
int GetScriptColumnNumber() const; int GetScriptColumnNumber() const;
/**
* Returns scriptId object.
* DEPRECATED: use ScriptId() instead.
*/
Handle<Value> GetScriptId() const; Handle<Value> GetScriptId() const;
/**
* Returns scriptId.
*/
int ScriptId() const;
ScriptOrigin GetScriptOrigin() const; ScriptOrigin GetScriptOrigin() const;
V8_INLINE(static Function* Cast(Value* obj)); V8_INLINE(static Function* Cast(Value* obj));
static const int kLineOffsetNotFound; static const int kLineOffsetNotFound;
private: private:
Function(); Function();
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
}; };
#ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
skipping to change at line 2428 skipping to change at line 2459
V8_INLINE(static ArrayBuffer* Cast(Value* obj)); V8_INLINE(static ArrayBuffer* Cast(Value* obj));
static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COU NT; static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COU NT;
private: private:
ArrayBuffer(); ArrayBuffer();
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
}; };
/** /**
* A base class for an instance of TypedArray series of constructors * A base class for an instance of one of "views" over ArrayBuffer,
* (ES6 draft 15.13.6). * including TypedArrays and DataView (ES6 draft 15.13).
*
* This API is experimental and may change significantly. * This API is experimental and may change significantly.
*/ */
class V8EXPORT TypedArray : public Object { class V8EXPORT ArrayBufferView : public Object {
public: public:
/** /**
* Returns underlying ArrayBuffer. * Returns underlying ArrayBuffer.
*/ */
Local<ArrayBuffer> Buffer(); Local<ArrayBuffer> Buffer();
/** /**
* Byte offset in |Buffer| * Byte offset in |Buffer|.
*/ */
size_t ByteOffset(); size_t ByteOffset();
/** /**
* Numbe of elements in this typed array. * Size of a view in bytes.
*/
size_t Length();
/**
* Size of typed array in bytes (e.g. for Int16Array, 2*|Length|).
*/ */
size_t ByteLength(); size_t ByteLength();
/** /**
* Base address of typed array. * Base address of a view.
*/ */
void* BaseAddress(); void* BaseAddress();
V8_INLINE(static ArrayBufferView* Cast(Value* obj));
private:
ArrayBufferView();
static void CheckCast(Value* obj);
};
/**
* A base class for an instance of TypedArray series of constructors
* (ES6 draft 15.13.6).
* This API is experimental and may change significantly.
*/
class V8EXPORT TypedArray : public ArrayBufferView {
public:
/**
* Number of elements in this typed array
* (e.g. for Int16Array, |ByteLength|/2).
*/
size_t Length();
V8_INLINE(static TypedArray* Cast(Value* obj)); V8_INLINE(static TypedArray* Cast(Value* obj));
private: private:
TypedArray(); TypedArray();
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
}; };
/** /**
* An instance of Uint8Array constructor (ES6 draft 15.13.6). * An instance of Uint8Array constructor (ES6 draft 15.13.6).
* This API is experimental and may change significantly. * This API is experimental and may change significantly.
skipping to change at line 2598 skipping to change at line 2646
static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer, static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Float64Array* Cast(Value* obj)); V8_INLINE(static Float64Array* Cast(Value* obj));
private: private:
Float64Array(); Float64Array();
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
}; };
/** /**
* An instance of DataView constructor (ES6 draft 15.13.7).
* This API is experimental and may change significantly.
*/
class V8EXPORT DataView : public ArrayBufferView {
public:
static Local<DataView> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length);
V8_INLINE(static DataView* Cast(Value* obj));
private:
DataView();
static void CheckCast(Value* obj);
};
/**
* An instance of the built-in Date constructor (ECMA-262, 15.9). * An instance of the built-in Date constructor (ECMA-262, 15.9).
*/ */
class V8EXPORT Date : public Object { class V8EXPORT Date : public Object {
public: public:
static Local<Value> New(double time); static Local<Value> New(double time);
/** /**
* A specialization of Value::NumberValue that is more efficient * A specialization of Value::NumberValue that is more efficient
* because we know the structure of this object. * because we know the structure of this object.
*/ */
skipping to change at line 3129 skipping to change at line 3192
* *
* \code * \code
* child_func.prototype.__proto__ == function.prototype; * child_func.prototype.__proto__ == function.prototype;
* child_instance.instance_accessor calls 'InstanceAccessorCallback' * child_instance.instance_accessor calls 'InstanceAccessorCallback'
* child_instance.instance_property == 3; * child_instance.instance_property == 3;
* \endcode * \endcode
*/ */
class V8EXPORT FunctionTemplate : public Template { class V8EXPORT FunctionTemplate : public Template {
public: public:
/** Creates a function template.*/ /** Creates a function template.*/
// TODO(dcarney): deprecate V8_DEPRECATED(static Local<FunctionTemplate> New(
static Local<FunctionTemplate> New( InvocationCallback callback,
InvocationCallback callback = 0,
Handle<Value> data = Handle<Value>(), Handle<Value> data = Handle<Value>(),
Handle<Signature> signature = Handle<Signature>(), Handle<Signature> signature = Handle<Signature>(),
int length = 0); int length = 0));
static Local<FunctionTemplate> New( static Local<FunctionTemplate> New(
FunctionCallback callback, // TODO(dcarney): add back default param. FunctionCallback callback = 0,
Handle<Value> data = Handle<Value>(), Handle<Value> data = Handle<Value>(),
Handle<Signature> signature = Handle<Signature>(), Handle<Signature> signature = Handle<Signature>(),
int length = 0); int length = 0);
/** Returns the unique function instance in the current execution context .*/ /** Returns the unique function instance in the current execution context .*/
Local<Function> GetFunction(); Local<Function> GetFunction();
/** /**
* Set the call-handler callback for a FunctionTemplate. This * Set the call-handler callback for a FunctionTemplate. This
* callback is called whenever the function created from this * callback is called whenever the function created from this
* FunctionTemplate is called. * FunctionTemplate is called.
*/ */
// TODO(dcarney): deprecate V8_DEPRECATED(void SetCallHandler(InvocationCallback callback,
void SetCallHandler(InvocationCallback callback, Handle<Value> data = Handle<Value>()));
Handle<Value> data = Handle<Value>());
void SetCallHandler(FunctionCallback callback, void SetCallHandler(FunctionCallback callback,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>());
/** Set the predefined length property for the FunctionTemplate. */ /** Set the predefined length property for the FunctionTemplate. */
void SetLength(int length); void SetLength(int length);
/** Get the InstanceTemplate. */ /** Get the InstanceTemplate. */
Local<ObjectTemplate> InstanceTemplate(); Local<ObjectTemplate> InstanceTemplate();
/** Causes the function template to inherit from a parent function templa te.*/ /** Causes the function template to inherit from a parent function templa te.*/
skipping to change at line 3205 skipping to change at line 3266
void ReadOnlyPrototype(); void ReadOnlyPrototype();
/** /**
* Returns true if the given object is an instance of this function * Returns true if the given object is an instance of this function
* template. * template.
*/ */
bool HasInstance(Handle<Value> object); bool HasInstance(Handle<Value> object);
private: private:
FunctionTemplate(); FunctionTemplate();
// TODO(dcarney): Remove with SetCallHandler.
friend class v8::CallHandlerHelper;
void SetCallHandlerInternal(InvocationCallback callback, Handle<Value> da
ta);
friend class Context; friend class Context;
friend class ObjectTemplate; friend class ObjectTemplate;
}; };
/** /**
* An ObjectTemplate is used to create objects at runtime. * An ObjectTemplate is used to create objects at runtime.
* *
* Properties added to an ObjectTemplate are added to each object * Properties added to an ObjectTemplate are added to each object
* created from the ObjectTemplate. * created from the ObjectTemplate.
*/ */
skipping to change at line 3252 skipping to change at line 3316
* The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow al l * The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow al l
* cross-context access. * cross-context access.
* \param attribute The attributes of the property for which an accessor * \param attribute The attributes of the property for which an accessor
* is added. * is added.
* \param signature The signature describes valid receivers for the acces sor * \param signature The signature describes valid receivers for the acces sor
* and is used to perform implicit instance checks against them. If the * and is used to perform implicit instance checks against them. If the
* receiver is incompatible (i.e. is not an instance of the constructor as * receiver is incompatible (i.e. is not an instance of the constructor as
* defined by FunctionTemplate::HasInstance()), an implicit TypeError i s * defined by FunctionTemplate::HasInstance()), an implicit TypeError i s
* thrown and no callback is invoked. * thrown and no callback is invoked.
*/ */
// TODO(dcarney): deprecate V8_DEPRECATED(void SetAccessor(Handle<String> name,
void SetAccessor(Handle<String> name, AccessorGetter getter,
AccessorGetter getter, AccessorSetter setter = 0,
AccessorSetter setter = 0, Handle<Value> data = Handle<Value>(),
Handle<Value> data = Handle<Value>(), AccessControl settings = DEFAULT,
AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
PropertyAttribute attribute = None, Handle<AccessorSignature> signature =
Handle<AccessorSignature> signature = Handle<AccessorSignature>()));
Handle<AccessorSignature>());
void SetAccessor(Handle<String> name, void SetAccessor(Handle<String> name,
AccessorGetterCallback getter, AccessorGetterCallback getter,
AccessorSetterCallback setter = 0, AccessorSetterCallback setter = 0,
Handle<Value> data = Handle<Value>(), Handle<Value> data = Handle<Value>(),
AccessControl settings = DEFAULT, AccessControl settings = DEFAULT,
PropertyAttribute attribute = None, PropertyAttribute attribute = None,
Handle<AccessorSignature> signature = Handle<AccessorSignature> signature =
Handle<AccessorSignature>()); Handle<AccessorSignature>());
// This function is not yet stable and should not be used at this time. // This function is not yet stable and should not be used at this time.
skipping to change at line 3295 skipping to change at line 3358
* \param getter The callback to invoke when getting a property. * \param getter The callback to invoke when getting a property.
* \param setter The callback to invoke when setting a property. * \param setter The callback to invoke when setting a property.
* \param query The callback to invoke to check if a property is present, * \param query The callback to invoke to check if a property is present,
* and if present, get its attributes. * and if present, get its attributes.
* \param deleter The callback to invoke when deleting a property. * \param deleter The callback to invoke when deleting a property.
* \param enumerator The callback to invoke to enumerate all the named * \param enumerator The callback to invoke to enumerate all the named
* properties of an object. * properties of an object.
* \param data A piece of data that will be passed to the callbacks * \param data A piece of data that will be passed to the callbacks
* whenever they are invoked. * whenever they are invoked.
*/ */
// TODO(dcarney): deprecate V8_DEPRECATED(void SetNamedPropertyHandler(
void SetNamedPropertyHandler(NamedPropertyGetter getter, NamedPropertyGetter getter,
NamedPropertySetter setter = 0, NamedPropertySetter setter = 0,
NamedPropertyQuery query = 0, NamedPropertyQuery query = 0,
NamedPropertyDeleter deleter = 0, NamedPropertyDeleter deleter = 0,
NamedPropertyEnumerator enumerator = 0, NamedPropertyEnumerator enumerator = 0,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>()));
void SetNamedPropertyHandler( void SetNamedPropertyHandler(
NamedPropertyGetterCallback getter, NamedPropertyGetterCallback getter,
NamedPropertySetterCallback setter = 0, NamedPropertySetterCallback setter = 0,
NamedPropertyQueryCallback query = 0, NamedPropertyQueryCallback query = 0,
NamedPropertyDeleterCallback deleter = 0, NamedPropertyDeleterCallback deleter = 0,
NamedPropertyEnumeratorCallback enumerator = 0, NamedPropertyEnumeratorCallback enumerator = 0,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>());
/** /**
* Sets an indexed property handler on the object template. * Sets an indexed property handler on the object template.
skipping to change at line 3326 skipping to change at line 3389
* *
* \param getter The callback to invoke when getting a property. * \param getter The callback to invoke when getting a property.
* \param setter The callback to invoke when setting a property. * \param setter The callback to invoke when setting a property.
* \param query The callback to invoke to check if an object has a proper ty. * \param query The callback to invoke to check if an object has a proper ty.
* \param deleter The callback to invoke when deleting a property. * \param deleter The callback to invoke when deleting a property.
* \param enumerator The callback to invoke to enumerate all the indexed * \param enumerator The callback to invoke to enumerate all the indexed
* properties of an object. * properties of an object.
* \param data A piece of data that will be passed to the callbacks * \param data A piece of data that will be passed to the callbacks
* whenever they are invoked. * whenever they are invoked.
*/ */
// TODO(dcarney): deprecate V8_DEPRECATED(void SetIndexedPropertyHandler(
void SetIndexedPropertyHandler(IndexedPropertyGetter getter, IndexedPropertyGetter getter,
IndexedPropertySetter setter = 0, IndexedPropertySetter setter = 0,
IndexedPropertyQuery query = 0, IndexedPropertyQuery query = 0,
IndexedPropertyDeleter deleter = 0, IndexedPropertyDeleter deleter = 0,
IndexedPropertyEnumerator enumerator = 0, IndexedPropertyEnumerator enumerator = 0,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>()));
void SetIndexedPropertyHandler( void SetIndexedPropertyHandler(
IndexedPropertyGetterCallback getter, IndexedPropertyGetterCallback getter,
IndexedPropertySetterCallback setter = 0, IndexedPropertySetterCallback setter = 0,
IndexedPropertyQueryCallback query = 0, IndexedPropertyQueryCallback query = 0,
IndexedPropertyDeleterCallback deleter = 0, IndexedPropertyDeleterCallback deleter = 0,
IndexedPropertyEnumeratorCallback enumerator = 0, IndexedPropertyEnumeratorCallback enumerator = 0,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>());
/** /**
* Sets the callback to be used when calling instances created from * Sets the callback to be used when calling instances created from
* this template as a function. If no callback is set, instances * this template as a function. If no callback is set, instances
* behave like normal JavaScript objects that cannot be called as a * behave like normal JavaScript objects that cannot be called as a
* function. * function.
*/ */
// TODO(dcarney): deprecate V8_DEPRECATED(void SetCallAsFunctionHandler(
void SetCallAsFunctionHandler(InvocationCallback callback, InvocationCallback callback,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>()));
void SetCallAsFunctionHandler(FunctionCallback callback, void SetCallAsFunctionHandler(FunctionCallback callback,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>());
/** /**
* Mark object instances of the template as undetectable. * Mark object instances of the template as undetectable.
* *
* In many ways, undetectable objects behave as though they are not * In many ways, undetectable objects behave as though they are not
* there. They behave like 'undefined' in conditionals and when * there. They behave like 'undefined' in conditionals and when
* printed. However, properties can be accessed and called as on * printed. However, properties can be accessed and called as on
* normal objects. * normal objects.
skipping to change at line 4313 skipping to change at line 4376
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 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 a new entry hook function when one is already active wil * \note Setting an entry hook can only be done very early in an isolates
l * lifetime, and once set, the entry hook cannot be revoked.
* fail.
*/ */
static bool SetFunctionEntryHook(FunctionEntryHook entry_hook); static bool SetFunctionEntryHook(Isolate* isolate,
FunctionEntryHook entry_hook);
/** /**
* Allows the host application to provide the address of a function that is * Allows the host application to provide the address of a function that is
* notified each time code is added, moved or removed. * notified each time code is added, moved or removed.
* *
* \param options options for the JIT code event handler. * \param options options for the JIT code event handler.
* \param event_handler the JIT code event handler, which will be invoked * \param event_handler the JIT code event handler, which will be invoked
* each time code is added, moved or removed. * each time code is added, moved or removed.
* \note \p event_handler won't get notified of existent code. * \note \p event_handler won't get notified of existent code.
* \note since code removal notifications are not currently issued, the * \note since code removal notifications are not currently issued, the
skipping to change at line 5185 skipping to change at line 5255
// the implementation of v8. // the implementation of v8.
static const int kHeapObjectMapOffset = 0; static const int kHeapObjectMapOffset = 0;
static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze; static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze;
static const int kStringResourceOffset = 3 * kApiPointerSize; static const int kStringResourceOffset = 3 * kApiPointerSize;
static const int kOddballKindOffset = 3 * kApiPointerSize; static const int kOddballKindOffset = 3 * kApiPointerSize;
static const int kForeignAddressOffset = kApiPointerSize; static const int kForeignAddressOffset = kApiPointerSize;
static const int kJSObjectHeaderSize = 3 * kApiPointerSize; static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
static const int kContextHeaderSize = 2 * kApiPointerSize; static const int kContextHeaderSize = 2 * kApiPointerSize;
static const int kContextEmbedderDataIndex = 64; static const int kContextEmbedderDataIndex = 65;
static const int kFullStringRepresentationMask = 0x07; static const int kFullStringRepresentationMask = 0x07;
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 kIsolateStateOffset = 0;
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 = 131; static const int kEmptyStringRootIndex = 131;
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;
skipping to change at line 5216 skipping to change at line 5285
static const int kNodeIsPartiallyDependentShift = 5; static const int kNodeIsPartiallyDependentShift = 5;
static const int kJSObjectType = 0xb0; static const int kJSObjectType = 0xb0;
static const int kFirstNonstringType = 0x80; static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83; static const int kOddballType = 0x83;
static const int kForeignType = 0x88; static const int kForeignType = 0x88;
static const int kUndefinedOddballKind = 5; static const int kUndefinedOddballKind = 5;
static const int kNullOddballKind = 3; static const int kNullOddballKind = 3;
#ifdef V8_ENABLE_CHECKS
static void CheckInitialized(v8::Isolate* isolate);
#else
static void CheckInitialized(v8::Isolate* isolate) { }
#endif
V8_INLINE(static bool HasHeapObjectTag(internal::Object* value)) { V8_INLINE(static bool HasHeapObjectTag(internal::Object* value)) {
return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) ==
kHeapObjectTag); kHeapObjectTag);
} }
V8_INLINE(static int SmiValue(internal::Object* value)) { V8_INLINE(static int SmiValue(internal::Object* value)) {
return PlatformSmiTagging::SmiToInt(value); return PlatformSmiTagging::SmiToInt(value);
} }
V8_INLINE(static internal::Object* IntToSmi(int value)) { V8_INLINE(static internal::Object* IntToSmi(int value)) {
skipping to change at line 5249 skipping to change at line 5324
V8_INLINE(static int GetOddballKind(internal::Object* obj)) { V8_INLINE(static int GetOddballKind(internal::Object* obj)) {
typedef internal::Object O; typedef internal::Object O;
return SmiValue(ReadField<O*>(obj, kOddballKindOffset)); return SmiValue(ReadField<O*>(obj, kOddballKindOffset));
} }
V8_INLINE(static bool IsExternalTwoByteString(int instance_type)) { V8_INLINE(static bool IsExternalTwoByteString(int instance_type)) {
int representation = (instance_type & kFullStringRepresentationMask); int representation = (instance_type & kFullStringRepresentationMask);
return representation == kExternalTwoByteRepresentationTag; return representation == kExternalTwoByteRepresentationTag;
} }
V8_INLINE(static bool IsInitialized(v8::Isolate* isolate)) {
uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + kIsolateStateOffs
et;
return *reinterpret_cast<int*>(addr) == 1;
}
V8_INLINE(static uint8_t GetNodeFlag(internal::Object** obj, int shift)) { V8_INLINE(static uint8_t GetNodeFlag(internal::Object** obj, int shift)) {
uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset; uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
return *addr & (1 << shift); return *addr & (1 << shift);
} }
V8_INLINE(static void UpdateNodeFlag(internal::Object** obj, V8_INLINE(static void UpdateNodeFlag(internal::Object** obj,
bool value, int shift)) { bool value, int shift)) {
uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset; uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
uint8_t mask = 1 << shift; uint8_t mask = 1 << shift;
*addr = (*addr & ~mask) | (value << shift); *addr = (*addr & ~mask) | (value << shift);
skipping to change at line 5785 skipping to change at line 5855
String* String::Cast(v8::Value* value) { String* String::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
#endif #endif
return static_cast<String*>(value); return static_cast<String*>(value);
} }
Local<String> String::Empty(Isolate* isolate) { Local<String> String::Empty(Isolate* isolate) {
typedef internal::Object* S; typedef internal::Object* S;
typedef internal::Internals I; typedef internal::Internals I;
if (!I::IsInitialized(isolate)) return Empty(); I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex); S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex);
return Local<String>(reinterpret_cast<String*>(slot)); return Local<String>(reinterpret_cast<String*>(slot));
} }
Local<String> String::New(const char* data, int length) { Local<String> String::New(const char* data, int length) {
return NewFromUtf8(Isolate::GetCurrent(), data, kNormalString, length); return NewFromUtf8(Isolate::GetCurrent(), data, kNormalString, length);
} }
Local<String> String::New(const uint16_t* data, int length) { Local<String> String::New(const uint16_t* data, int length) {
return NewFromTwoByte(Isolate::GetCurrent(), data, kNormalString, length) ; return NewFromTwoByte(Isolate::GetCurrent(), data, kNormalString, length) ;
skipping to change at line 5985 skipping to change at line 6055
return static_cast<Array*>(value); return static_cast<Array*>(value);
} }
ArrayBuffer* ArrayBuffer::Cast(v8::Value* value) { ArrayBuffer* ArrayBuffer::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
#endif #endif
return static_cast<ArrayBuffer*>(value); return static_cast<ArrayBuffer*>(value);
} }
ArrayBufferView* ArrayBufferView::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
CheckCast(value);
#endif
return static_cast<ArrayBufferView*>(value);
}
TypedArray* TypedArray::Cast(v8::Value* value) { TypedArray* TypedArray::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
#endif #endif
return static_cast<TypedArray*>(value); return static_cast<TypedArray*>(value);
} }
Uint8Array* Uint8Array::Cast(v8::Value* value) { Uint8Array* Uint8Array::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
skipping to change at line 6055 skipping to change at line 6132
return static_cast<Float64Array*>(value); return static_cast<Float64Array*>(value);
} }
Uint8ClampedArray* Uint8ClampedArray::Cast(v8::Value* value) { Uint8ClampedArray* Uint8ClampedArray::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
#endif #endif
return static_cast<Uint8ClampedArray*>(value); return static_cast<Uint8ClampedArray*>(value);
} }
DataView* DataView::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
CheckCast(value);
#endif
return static_cast<DataView*>(value);
}
Function* Function::Cast(v8::Value* value) { Function* Function::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
#endif #endif
return static_cast<Function*>(value); return static_cast<Function*>(value);
} }
External* External::Cast(v8::Value* value) { External* External::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
skipping to change at line 6097 skipping to change at line 6181
} }
template<typename T> template<typename T>
ReturnValue<T> PropertyCallbackInfo<T>::GetReturnValue() const { ReturnValue<T> PropertyCallbackInfo<T>::GetReturnValue() const {
return ReturnValue<T>(&args_[kReturnValueIndex]); return ReturnValue<T>(&args_[kReturnValueIndex]);
} }
Handle<Primitive> Undefined(Isolate* isolate) { Handle<Primitive> Undefined(Isolate* isolate) {
typedef internal::Object* S; typedef internal::Object* S;
typedef internal::Internals I; typedef internal::Internals I;
if (!I::IsInitialized(isolate)) return Undefined(); I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex); S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
return Handle<Primitive>(reinterpret_cast<Primitive*>(slot)); return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
} }
Handle<Primitive> Null(Isolate* isolate) { Handle<Primitive> Null(Isolate* isolate) {
typedef internal::Object* S; typedef internal::Object* S;
typedef internal::Internals I; typedef internal::Internals I;
if (!I::IsInitialized(isolate)) return Null(); I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kNullValueRootIndex); S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
return Handle<Primitive>(reinterpret_cast<Primitive*>(slot)); return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
} }
Handle<Boolean> True(Isolate* isolate) { Handle<Boolean> True(Isolate* isolate) {
typedef internal::Object* S; typedef internal::Object* S;
typedef internal::Internals I; typedef internal::Internals I;
if (!I::IsInitialized(isolate)) return True(); I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex); S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
return Handle<Boolean>(reinterpret_cast<Boolean*>(slot)); return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
} }
Handle<Boolean> False(Isolate* isolate) { Handle<Boolean> False(Isolate* isolate) {
typedef internal::Object* S; typedef internal::Object* S;
typedef internal::Internals I; typedef internal::Internals I;
if (!I::IsInitialized(isolate)) return False(); I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex); S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
return Handle<Boolean>(reinterpret_cast<Boolean*>(slot)); return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
} }
void Isolate::SetData(void* data) { void Isolate::SetData(void* data) {
typedef internal::Internals I; typedef internal::Internals I;
I::SetEmbedderData(this, data); I::SetEmbedderData(this, data);
} }
void* Isolate::GetData() { void* Isolate::GetData() {
 End of changes. 41 change blocks. 
69 lines changed or deleted 153 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/