v8-profiler.h | v8-profiler.h | |||
---|---|---|---|---|
skipping to change at line 184 | skipping to change at line 184 | |||
/** | /** | |||
* 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. */ | /** Deprecated. Use GetCpuProfile instead. */ | |||
V8_DEPRECATED(static const CpuProfile* GetProfile( | V8_DEPRECATED(static const CpuProfile* GetProfile( | |||
int index, | int index, | |||
Handle<Value> security_token = Handle<Value>())); | Handle<Value> security_token = Handle<Value>())); | |||
/** Returns a profile by index. */ | /** Deprecated. Use GetCpuProfile with single parameter. */ | |||
const CpuProfile* GetCpuProfile( | V8_DEPRECATED(const CpuProfile* GetCpuProfile( | |||
int index, | int index, | |||
Handle<Value> security_token = Handle<Value>()); | Handle<Value> security_token)); | |||
/** Returns a profile by index. */ | ||||
const CpuProfile* GetCpuProfile(int index); | ||||
/** Deprecated. Use FindProfile instead. */ | /** Deprecated. Use FindProfile instead. */ | |||
V8_DEPRECATED(static const CpuProfile* FindProfile( | V8_DEPRECATED(static const CpuProfile* FindProfile( | |||
unsigned uid, | unsigned uid, | |||
Handle<Value> security_token = Handle<Value>())); | Handle<Value> security_token = Handle<Value>())); | |||
/** Returns a profile by uid. */ | /** Returns a profile by uid. */ | |||
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. */ | /** Deprecated. Use StartCpuProfiling instead. */ | |||
V8_DEPRECATED(static void StartProfiling(Handle<String> title, | V8_DEPRECATED(static void StartProfiling(Handle<String> title, | |||
bool record_samples = false)); | 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 | |||
skipping to change at line 219 | skipping to change at line 221 | |||
* |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. */ | /** Deprecated. Use StopCpuProfiling instead. */ | |||
V8_DEPRECATED(static const CpuProfile* StopProfiling( | V8_DEPRECATED(static const CpuProfile* StopProfiling( | |||
Handle<String> title, | Handle<String> title, | |||
Handle<Value> security_token = Handle<Value>())); | Handle<Value> security_token = Handle<Value>())); | |||
/** | /** | |||
* Deprecated. Use StopCpuProfiling with one parameter instead. | ||||
*/ | ||||
V8_DEPRECATED(const CpuProfile* StopCpuProfiling( | ||||
Handle<String> title, | ||||
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( | const CpuProfile* StopCpuProfiling(Handle<String> title); | |||
Handle<String> title, | ||||
Handle<Value> security_token = Handle<Value>()); | ||||
/** Deprecated. Use DeleteAllCpuProfiles instead. */ | /** Deprecated. Use DeleteAllCpuProfiles instead. */ | |||
V8_DEPRECATED(static void DeleteAllProfiles()); | 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(); | |||
skipping to change at line 433 | skipping to change at line 439 | |||
int GetSnapshotCount(); | int GetSnapshotCount(); | |||
/** Deprecated. Use GetHeapSnapshot instead. */ | /** Deprecated. Use GetHeapSnapshot instead. */ | |||
V8_DEPRECATED(static const HeapSnapshot* GetSnapshot(int index)); | 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. */ | /** Deprecated. Use FindHeapSnapshot instead. */ | |||
V8_DEPRECATED(static const HeapSnapshot* FindSnapshot(unsigned uid)); | V8_DEPRECATED(static const HeapSnapshot* FindSnapshot(unsigned uid)); | |||
/** Returns a profile by uid. */ | /** Returns a profile by uid. */ | |||
const HeapSnapshot* FindHeapSnapshot(unsigned uid); | V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid)); | |||
/** Deprecated. Use GetObjectId instead. */ | /** Deprecated. Use GetObjectId instead. */ | |||
V8_DEPRECATED(static SnapshotObjectId GetSnapshotObjectId( | V8_DEPRECATED(static SnapshotObjectId GetSnapshotObjectId( | |||
Handle<Value> value)); | 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); | |||
End of changes. 7 change blocks. | ||||
9 lines changed or deleted | 15 lines changed or added | |||
v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 560 | skipping to change at line 560 | |||
/** | /** | |||
* "Casts" a plain handle which is known to be a persistent handle | * "Casts" a plain handle which is known to be a persistent handle | |||
* to a persistent handle. | * to a persistent handle. | |||
*/ | */ | |||
template <class S> explicit V8_INLINE(Persistent(Handle<S> that)) | template <class S> explicit V8_INLINE(Persistent(Handle<S> that)) | |||
: Handle<T>(*that) { } | : Handle<T>(*that) { } | |||
#endif | #endif | |||
#ifdef V8_USE_UNSAFE_HANDLES | ||||
template <class S> V8_INLINE(static Persistent<T> Cast(Persistent<S> that )) { | template <class S> V8_INLINE(static Persistent<T> Cast(Persistent<S> that )) { | |||
#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()) return Persistent<T>(); | if (that.IsEmpty()) return Persistent<T>(); | |||
#endif | #endif | |||
return Persistent<T>(T::Cast(*that)); | return Persistent<T>(T::Cast(*that)); | |||
} | } | |||
template <class S> V8_INLINE(Persistent<S> As()) { | template <class S> V8_INLINE(Persistent<S> As()) { | |||
return Persistent<S>::Cast(*this); | return Persistent<S>::Cast(*this); | |||
} | } | |||
#else | ||||
template <class S> | ||||
V8_INLINE(static Persistent<T>& Cast(Persistent<S>& that)) { // NOLINT | ||||
#ifdef V8_ENABLE_CHECKS | ||||
// 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. | ||||
if (!that.IsEmpty()) T::Cast(*that); | ||||
#endif | ||||
return reinterpret_cast<Persistent<T>&>(that); | ||||
} | ||||
template <class S> V8_INLINE(Persistent<S>& As()) { // NOLINT | ||||
return Persistent<S>::Cast(*this); | ||||
} | ||||
#endif | ||||
V8_DEPRECATED(static Persistent<T> New(Handle<T> that)); | V8_DEPRECATED(static Persistent<T> New(Handle<T> that)); | |||
/** | /** | |||
* Creates a new persistent handle for an existing local or persistent ha ndle. | * Creates a new persistent handle for an existing local or persistent ha ndle. | |||
*/ | */ | |||
// TODO(dcarney): remove before cutover | // TODO(dcarney): remove before cutover | |||
V8_INLINE(static Persistent<T> New(Isolate* isolate, Handle<T> that)); | V8_INLINE(static Persistent<T> New(Isolate* isolate, Handle<T> that)); | |||
#ifndef V8_USE_UNSAFE_HANDLES | #ifndef V8_USE_UNSAFE_HANDLES | |||
// TODO(dcarney): remove before cutover | // TODO(dcarney): remove before cutover | |||
V8_INLINE(static Persistent<T> New(Isolate* isolate, Persistent<T> that)) ; | V8_INLINE(static Persistent<T> New(Isolate* isolate, Persistent<T> that)) ; | |||
skipping to change at line 2730 | skipping to change at line 2747 | |||
friend class ObjectTemplate; | friend class ObjectTemplate; | |||
friend class FunctionTemplate; | friend class FunctionTemplate; | |||
}; | }; | |||
template<typename T> | template<typename T> | |||
class ReturnValue { | class ReturnValue { | |||
public: | public: | |||
V8_INLINE(explicit ReturnValue(internal::Object** slot)); | V8_INLINE(explicit ReturnValue(internal::Object** slot)); | |||
// Handle setters | // Handle setters | |||
V8_INLINE(void Set(const Persistent<T>& handle)); | template <typename S> V8_INLINE(void Set(const Persistent<S>& handle)); | |||
V8_INLINE(void Set(const Handle<T> handle)); | template <typename S> V8_INLINE(void Set(const Handle<S> handle)); | |||
// Fast primitive setters | // Fast primitive setters | |||
V8_INLINE(void Set(bool value)); | V8_INLINE(void Set(bool value)); | |||
V8_INLINE(void Set(double i)); | V8_INLINE(void Set(double i)); | |||
V8_INLINE(void Set(int32_t i)); | V8_INLINE(void Set(int32_t i)); | |||
V8_INLINE(void Set(uint32_t i)); | V8_INLINE(void Set(uint32_t i)); | |||
// Fast JS primitive setters | // Fast JS primitive setters | |||
V8_INLINE(void SetNull()); | V8_INLINE(void SetNull()); | |||
V8_INLINE(void SetUndefined()); | V8_INLINE(void SetUndefined()); | |||
// Convenience getter for Isolate | // Convenience getter for Isolate | |||
V8_INLINE(Isolate* GetIsolate()); | V8_INLINE(Isolate* GetIsolate()); | |||
skipping to change at line 4826 | skipping to change at line 4843 | |||
/** | /** | |||
* Stack-allocated class which sets the execution context for all | * Stack-allocated class which sets the execution context for all | |||
* operations executed within a local scope. | * operations executed within a local scope. | |||
*/ | */ | |||
class Scope { | class Scope { | |||
public: | public: | |||
explicit V8_INLINE(Scope(Handle<Context> context)) : context_(context) { | explicit V8_INLINE(Scope(Handle<Context> context)) : context_(context) { | |||
context_->Enter(); | context_->Enter(); | |||
} | } | |||
// TODO(dcarney): deprecate | ||||
V8_INLINE(Scope(Isolate* isolate, Persistent<Context>& context)) // NOL INT | V8_INLINE(Scope(Isolate* isolate, Persistent<Context>& context)) // NOL INT | |||
#ifndef V8_USE_UNSAFE_HANDLES | #ifndef V8_USE_UNSAFE_HANDLES | |||
: context_(Handle<Context>::New(isolate, context)) { | : context_(Handle<Context>::New(isolate, context)) { | |||
#else | #else | |||
: context_(Local<Context>::New(isolate, context)) { | : context_(Local<Context>::New(isolate, context)) { | |||
#endif | #endif | |||
context_->Enter(); | context_->Enter(); | |||
} | } | |||
V8_INLINE(~Scope()) { context_->Exit(); } | V8_INLINE(~Scope()) { context_->Exit(); } | |||
skipping to change at line 5553 | skipping to change at line 5571 | |||
if (!I::IsInitialized(isolate)) return 0; | if (!I::IsInitialized(isolate)) return 0; | |||
internal::Object** obj = reinterpret_cast<internal::Object**>(this->val_) ; | internal::Object** obj = reinterpret_cast<internal::Object**>(this->val_) ; | |||
uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset; | uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset; | |||
return *reinterpret_cast<uint16_t*>(addr); | return *reinterpret_cast<uint16_t*>(addr); | |||
} | } | |||
template<typename T> | template<typename T> | |||
ReturnValue<T>::ReturnValue(internal::Object** slot) : value_(slot) {} | ReturnValue<T>::ReturnValue(internal::Object** slot) : value_(slot) {} | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(const Persistent<T>& handle) { | template<typename S> | |||
void ReturnValue<T>::Set(const Persistent<S>& handle) { | ||||
TYPE_CHECK(T, S); | ||||
*value_ = *reinterpret_cast<internal::Object**>(*handle); | *value_ = *reinterpret_cast<internal::Object**>(*handle); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(const Handle<T> handle) { | template<typename S> | |||
void ReturnValue<T>::Set(const Handle<S> handle) { | ||||
TYPE_CHECK(T, S); | ||||
*value_ = *reinterpret_cast<internal::Object**>(*handle); | *value_ = *reinterpret_cast<internal::Object**>(*handle); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(double i) { | void ReturnValue<T>::Set(double i) { | |||
Set(Number::New(GetIsolate(), i)); | Set(Number::New(GetIsolate(), i)); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(int32_t i) { | void ReturnValue<T>::Set(int32_t i) { | |||
End of changes. 6 change blocks. | ||||
4 lines changed or deleted | 26 lines changed or added | |||