Commit b60d340e authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Deuglify V8_INLINE and V8_NOINLINE.

R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/23494047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16641 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b60b8c3b
...@@ -211,7 +211,7 @@ template <class T> class Handle { ...@@ -211,7 +211,7 @@ template <class T> class Handle {
/** /**
* Creates an empty handle. * Creates an empty handle.
*/ */
V8_INLINE(Handle()) : val_(0) {} V8_INLINE Handle() : val_(0) {}
/** /**
* Creates a handle for the contents of the specified handle. This * Creates a handle for the contents of the specified handle. This
...@@ -223,7 +223,7 @@ template <class T> class Handle { ...@@ -223,7 +223,7 @@ template <class T> class Handle {
* Handle<String> to a variable declared as Handle<Value>, is legal * Handle<String> to a variable declared as Handle<Value>, is legal
* because String is a subclass of Value. * because String is a subclass of Value.
*/ */
template <class S> V8_INLINE(Handle(Handle<S> that)) template <class S> V8_INLINE Handle(Handle<S> that)
: val_(reinterpret_cast<T*>(*that)) { : val_(reinterpret_cast<T*>(*that)) {
/** /**
* This check fails when trying to convert between incompatible * This check fails when trying to convert between incompatible
...@@ -236,16 +236,16 @@ template <class T> class Handle { ...@@ -236,16 +236,16 @@ template <class T> class Handle {
/** /**
* Returns true if the handle is empty. * Returns true if the handle is empty.
*/ */
V8_INLINE(bool IsEmpty() const) { return val_ == 0; } V8_INLINE bool IsEmpty() const { return val_ == 0; }
/** /**
* Sets the handle to be empty. IsEmpty() will then return true. * Sets the handle to be empty. IsEmpty() will then return true.
*/ */
V8_INLINE(void Clear()) { val_ = 0; } V8_INLINE void Clear() { val_ = 0; }
V8_INLINE(T* operator->() const) { return val_; } V8_INLINE T* operator->() const { return val_; }
V8_INLINE(T* operator*() const) { return val_; } V8_INLINE T* operator*() const { return val_; }
/** /**
* Checks whether two handles are the same. * Checks whether two handles are the same.
...@@ -253,7 +253,7 @@ template <class T> class Handle { ...@@ -253,7 +253,7 @@ template <class T> class Handle {
* to which they refer are identical. * to which they refer are identical.
* The handles' references are not checked. * The handles' references are not checked.
*/ */
template <class S> V8_INLINE(bool operator==(const Handle<S>& that) const) { template <class S> V8_INLINE bool operator==(const Handle<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(**this); internal::Object** a = reinterpret_cast<internal::Object**>(**this);
internal::Object** b = reinterpret_cast<internal::Object**>(*that); internal::Object** b = reinterpret_cast<internal::Object**>(*that);
if (a == 0) return b == 0; if (a == 0) return b == 0;
...@@ -261,8 +261,8 @@ template <class T> class Handle { ...@@ -261,8 +261,8 @@ template <class T> class Handle {
return *a == *b; return *a == *b;
} }
template <class S> V8_INLINE( template <class S> V8_INLINE bool operator==(
bool operator==(const Persistent<S>& that) const) { const Persistent<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(**this); internal::Object** a = reinterpret_cast<internal::Object**>(**this);
internal::Object** b = reinterpret_cast<internal::Object**>(*that); internal::Object** b = reinterpret_cast<internal::Object**>(*that);
if (a == 0) return b == 0; if (a == 0) return b == 0;
...@@ -276,16 +276,16 @@ template <class T> class Handle { ...@@ -276,16 +276,16 @@ template <class T> class Handle {
* the objects to which they refer are different. * the objects to which they refer are different.
* The handles' references are not checked. * The handles' references are not checked.
*/ */
template <class S> V8_INLINE(bool operator!=(const Handle<S>& that) const) { template <class S> V8_INLINE bool operator!=(const Handle<S>& that) const {
return !operator==(that); return !operator==(that);
} }
template <class S> V8_INLINE( template <class S> V8_INLINE bool operator!=(
bool operator!=(const Persistent<S>& that) const) { const Persistent<S>& that) const {
return !operator==(that); return !operator==(that);
} }
template <class S> V8_INLINE(static Handle<T> Cast(Handle<S> that)) { template <class S> V8_INLINE static Handle<T> Cast(Handle<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.
...@@ -294,14 +294,14 @@ template <class T> class Handle { ...@@ -294,14 +294,14 @@ template <class T> class Handle {
return Handle<T>(T::Cast(*that)); return Handle<T>(T::Cast(*that));
} }
template <class S> V8_INLINE(Handle<S> As()) { template <class S> V8_INLINE Handle<S> As() {
return Handle<S>::Cast(*this); return Handle<S>::Cast(*this);
} }
V8_INLINE(static Handle<T> New(Isolate* isolate, Handle<T> that)) { V8_INLINE static Handle<T> New(Isolate* isolate, Handle<T> that) {
return New(isolate, that.val_); return New(isolate, that.val_);
} }
V8_INLINE(static Handle<T> New(Isolate* isolate, const Persistent<T>& that)) { V8_INLINE static Handle<T> New(Isolate* isolate, const Persistent<T>& that) {
return New(isolate, that.val_); return New(isolate, that.val_);
} }
...@@ -312,7 +312,7 @@ template <class T> class Handle { ...@@ -312,7 +312,7 @@ template <class T> class Handle {
/** /**
* Creates a new handle for the specified value. * Creates a new handle for the specified value.
*/ */
V8_INLINE(explicit Handle(T* val)) : val_(val) {} V8_INLINE explicit Handle(T* val) : val_(val) {}
private: private:
friend class Utils; friend class Utils;
...@@ -328,7 +328,7 @@ template <class T> class Handle { ...@@ -328,7 +328,7 @@ template <class T> class Handle {
friend class Context; friend class Context;
friend class HandleScope; friend class HandleScope;
V8_INLINE(static Handle<T> New(Isolate* isolate, T* that)); V8_INLINE static Handle<T> New(Isolate* isolate, T* that);
T* val_; T* val_;
}; };
...@@ -343,8 +343,8 @@ template <class T> class Handle { ...@@ -343,8 +343,8 @@ template <class T> class Handle {
*/ */
template <class T> class Local : public Handle<T> { template <class T> class Local : public Handle<T> {
public: public:
V8_INLINE(Local()); V8_INLINE Local();
template <class S> V8_INLINE(Local(Local<S> that)) template <class S> V8_INLINE Local(Local<S> that)
: Handle<T>(reinterpret_cast<T*>(*that)) { : Handle<T>(reinterpret_cast<T*>(*that)) {
/** /**
* This check fails when trying to convert between incompatible * This check fails when trying to convert between incompatible
...@@ -355,7 +355,7 @@ template <class T> class Local : public Handle<T> { ...@@ -355,7 +355,7 @@ template <class T> class Local : public Handle<T> {
} }
template <class S> V8_INLINE(static Local<T> Cast(Local<S> that)) { template <class S> V8_INLINE static Local<T> Cast(Local<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.
...@@ -363,12 +363,12 @@ template <class T> class Local : public Handle<T> { ...@@ -363,12 +363,12 @@ template <class T> class Local : public Handle<T> {
#endif #endif
return Local<T>(T::Cast(*that)); return Local<T>(T::Cast(*that));
} }
template <class S> V8_INLINE(Local(Handle<S> that)) template <class S> V8_INLINE Local(Handle<S> that)
: Handle<T>(reinterpret_cast<T*>(*that)) { : Handle<T>(reinterpret_cast<T*>(*that)) {
TYPE_CHECK(T, S); TYPE_CHECK(T, S);
} }
template <class S> V8_INLINE(Local<S> As()) { template <class S> V8_INLINE Local<S> As() {
return Local<S>::Cast(*this); return Local<S>::Cast(*this);
} }
...@@ -377,17 +377,17 @@ template <class T> class Local : public Handle<T> { ...@@ -377,17 +377,17 @@ template <class T> class Local : public Handle<T> {
* The referee is kept alive by the local handle even when * The referee is kept alive by the local handle even when
* the original handle is destroyed/disposed. * the original handle is destroyed/disposed.
*/ */
V8_INLINE(static Local<T> New(Handle<T> that)); V8_INLINE static Local<T> New(Handle<T> that);
V8_INLINE(static Local<T> New(Isolate* isolate, Handle<T> that)); V8_INLINE static Local<T> New(Isolate* isolate, Handle<T> that);
template<class M> template<class M>
V8_INLINE(static Local<T> New(Isolate* isolate, V8_INLINE static Local<T> New(Isolate* isolate,
const Persistent<T, M>& that)); const Persistent<T, M>& that);
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
private: private:
#endif #endif
template <class S> V8_INLINE(Local(S* that) : Handle<T>(that)) { } template <class S> V8_INLINE Local(S* that) : Handle<T>(that) { }
private: private:
friend class Utils; friend class Utils;
...@@ -402,24 +402,22 @@ template <class T> class Local : public Handle<T> { ...@@ -402,24 +402,22 @@ template <class T> class Local : public Handle<T> {
template<class F> friend class internal::CustomArguments; template<class F> friend class internal::CustomArguments;
friend class HandleScope; friend class HandleScope;
V8_INLINE(static Local<T> New(Isolate* isolate, T* that)); V8_INLINE static Local<T> New(Isolate* isolate, T* that);
}; };
// Eternal handles are set-once handles that live for the life of the isolate. // Eternal handles are set-once handles that live for the life of the isolate.
template <class T> class Eternal { template <class T> class Eternal {
public: public:
V8_INLINE(Eternal()) : index_(kInitialValue) { } V8_INLINE Eternal() : index_(kInitialValue) { }
template<class S> template<class S>
V8_INLINE(Eternal(Isolate* isolate, Local<S> handle)) V8_INLINE Eternal(Isolate* isolate, Local<S> handle) : index_(kInitialValue) {
: index_(kInitialValue) {
Set(isolate, handle); Set(isolate, handle);
} }
// Can only be safely called if already set. // Can only be safely called if already set.
V8_INLINE(Local<T> Get(Isolate* isolate)); V8_INLINE Local<T> Get(Isolate* isolate);
V8_INLINE(bool IsEmpty()) { return index_ == kInitialValue; } V8_INLINE bool IsEmpty() { return index_ == kInitialValue; }
template<class S> template<class S> V8_INLINE void Set(Isolate* isolate, Local<S> handle);
V8_INLINE(void Set(Isolate* isolate, Local<S> handle));
private: private:
static const int kInitialValue = -1; static const int kInitialValue = -1;
...@@ -432,9 +430,9 @@ class WeakCallbackData { ...@@ -432,9 +430,9 @@ class WeakCallbackData {
public: public:
typedef void (*Callback)(const WeakCallbackData<T, P>& data); typedef void (*Callback)(const WeakCallbackData<T, P>& data);
V8_INLINE(Isolate* GetIsolate()) const { return isolate_; } V8_INLINE Isolate* GetIsolate() const { return isolate_; }
V8_INLINE(Local<T> GetValue()) const { return handle_; } V8_INLINE Local<T> GetValue() const { return handle_; }
V8_INLINE(P* GetParameter()) const { return parameter_; } V8_INLINE P* GetParameter() const { return parameter_; }
private: private:
friend class internal::GlobalHandles; friend class internal::GlobalHandles;
...@@ -470,13 +468,12 @@ class NonCopyablePersistentTraits { ...@@ -470,13 +468,12 @@ class NonCopyablePersistentTraits {
typedef Persistent<T, NonCopyablePersistentTraits<T> > NonCopyablePersistent; typedef Persistent<T, NonCopyablePersistentTraits<T> > NonCopyablePersistent;
static const bool kResetInDestructor = false; static const bool kResetInDestructor = false;
template<class S, class M> template<class S, class M>
V8_INLINE(static void Copy(const Persistent<S, M>& source, V8_INLINE static void Copy(const Persistent<S, M>& source,
NonCopyablePersistent* dest)) { NonCopyablePersistent* dest) {
Uncompilable<Object>(); Uncompilable<Object>();
} }
// TODO(dcarney): come up with a good compile error here. // TODO(dcarney): come up with a good compile error here.
template<class O> template<class O> V8_INLINE static void Uncompilable() {
V8_INLINE(static void Uncompilable()) {
TYPE_CHECK(O, Primitive); TYPE_CHECK(O, Primitive);
} }
}; };
...@@ -502,13 +499,13 @@ template <class T, class M> class Persistent { ...@@ -502,13 +499,13 @@ template <class T, class M> class Persistent {
/** /**
* A Persistent with no storage cell. * A Persistent with no storage cell.
*/ */
V8_INLINE(Persistent()) : val_(0) { } V8_INLINE Persistent() : val_(0) { }
/** /**
* Construct a Persistent from a Handle. * Construct a Persistent from a Handle.
* When the Handle is non-empty, a new storage cell is created * When the Handle is non-empty, a new storage cell is created
* pointing to the same object, and no flags are set. * pointing to the same object, and no flags are set.
*/ */
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)) {
TYPE_CHECK(T, S); TYPE_CHECK(T, S);
} }
...@@ -518,7 +515,7 @@ template <class T, class M> class Persistent { ...@@ -518,7 +515,7 @@ template <class T, class M> class Persistent {
* pointing to the same object, and no flags are set. * pointing to the same object, and no flags are set.
*/ */
template <class S, class M2> template <class S, class M2>
V8_INLINE(Persistent(Isolate* isolate, const Persistent<S, M2>& that)) V8_INLINE Persistent(Isolate* isolate, const Persistent<S, M2>& that)
: val_(New(isolate, *that)) { : val_(New(isolate, *that)) {
TYPE_CHECK(T, S); TYPE_CHECK(T, S);
} }
...@@ -528,19 +525,19 @@ template <class T, class M> class Persistent { ...@@ -528,19 +525,19 @@ template <class T, class M> class Persistent {
* traits class is called, allowing the setting of flags based on the * traits class is called, allowing the setting of flags based on the
* copied Persistent. * copied Persistent.
*/ */
V8_INLINE(Persistent(const Persistent& that)) : val_(0) { V8_INLINE Persistent(const Persistent& that) : val_(0) {
Copy(that); Copy(that);
} }
template <class S, class M2> template <class S, class M2>
V8_INLINE(Persistent(const Persistent<S, M2>& that)) : val_(0) { V8_INLINE Persistent(const Persistent<S, M2>& that) : val_(0) {
Copy(that); Copy(that);
} }
V8_INLINE(Persistent& operator=(const Persistent& that)) { // NOLINT V8_INLINE Persistent& operator=(const Persistent& that) { // NOLINT
Copy(that); Copy(that);
return *this; return *this;
} }
template <class S, class M2> template <class S, class M2>
V8_INLINE(Persistent& operator=(const Persistent<S, M2>& that)) { // NOLINT V8_INLINE Persistent& operator=(const Persistent<S, M2>& that) { // NOLINT
Copy(that); Copy(that);
return *this; return *this;
} }
...@@ -549,7 +546,7 @@ template <class T, class M> class Persistent { ...@@ -549,7 +546,7 @@ template <class T, class M> class Persistent {
* kResetInDestructor flags in the traits class. Since not calling dispose * kResetInDestructor flags in the traits class. Since not calling dispose
* can result in a memory leak, it is recommended to always set this flag. * can result in a memory leak, it is recommended to always set this flag.
*/ */
V8_INLINE(~Persistent()) { V8_INLINE ~Persistent() {
if (M::kResetInDestructor) Reset(); if (M::kResetInDestructor) Reset();
} }
...@@ -557,28 +554,28 @@ template <class T, class M> class Persistent { ...@@ -557,28 +554,28 @@ template <class T, class M> class Persistent {
* If non-empty, destroy the underlying storage cell * If non-empty, destroy the underlying storage cell
* IsEmpty() will return true after this call. * IsEmpty() will return true after this call.
*/ */
V8_INLINE(void Reset()); V8_INLINE void Reset();
template <class S>
/** /**
* If non-empty, destroy the underlying storage cell * If non-empty, destroy the underlying storage cell
* and create a new one with the contents of other if other is non empty * and create a new one with the contents of other if other is non empty
*/ */
V8_INLINE(void Reset(Isolate* isolate, const Handle<S>& other)); template <class S>
V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other);
/** /**
* If non-empty, destroy the underlying storage cell * If non-empty, destroy the underlying storage cell
* and create a new one with the contents of other if other is non empty * and create a new one with the contents of other if other is non empty
*/ */
template <class S, class M2> template <class S, class M2>
V8_INLINE(void Reset(Isolate* isolate, const Persistent<S, M2>& other)); V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
V8_INLINE(void Dispose()) { Reset(); } V8_INLINE void Dispose() { Reset(); }
V8_DEPRECATED(V8_INLINE(void Dispose(Isolate* isolate))) { Reset(); } V8_DEPRECATED(V8_INLINE void Dispose(Isolate* isolate)) { Reset(); }
V8_INLINE(bool IsEmpty() const) { return val_ == 0; } V8_INLINE bool IsEmpty() const { return val_ == 0; }
// TODO(dcarney): this is pretty useless, fix or remove // TODO(dcarney): this is pretty useless, fix or remove
template <class S> template <class S>
V8_INLINE(static Persistent<T>& Cast(Persistent<S>& that)) { // NOLINT V8_INLINE static Persistent<T>& Cast(Persistent<S>& that) { // NOLINT
#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.
...@@ -588,12 +585,12 @@ template <class T, class M> class Persistent { ...@@ -588,12 +585,12 @@ template <class T, class M> class Persistent {
} }
// TODO(dcarney): this is pretty useless, fix or remove // TODO(dcarney): this is pretty useless, fix or remove
template <class S> V8_INLINE(Persistent<S>& As()) { // NOLINT template <class S> V8_INLINE Persistent<S>& As() { // NOLINT
return Persistent<S>::Cast(*this); return Persistent<S>::Cast(*this);
} }
template <class S, class M2> V8_INLINE( template <class S, class M2>
bool operator==(const Persistent<S, M2>& that) const) { V8_INLINE bool operator==(const Persistent<S, M2>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(**this); internal::Object** a = reinterpret_cast<internal::Object**>(**this);
internal::Object** b = reinterpret_cast<internal::Object**>(*that); internal::Object** b = reinterpret_cast<internal::Object**>(*that);
if (a == 0) return b == 0; if (a == 0) return b == 0;
...@@ -601,7 +598,7 @@ template <class T, class M> class Persistent { ...@@ -601,7 +598,7 @@ template <class T, class M> class Persistent {
return *a == *b; return *a == *b;
} }
template <class S> V8_INLINE(bool operator==(const Handle<S>& that) const) { template <class S> V8_INLINE bool operator==(const Handle<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(**this); internal::Object** a = reinterpret_cast<internal::Object**>(**this);
internal::Object** b = reinterpret_cast<internal::Object**>(*that); internal::Object** b = reinterpret_cast<internal::Object**>(*that);
if (a == 0) return b == 0; if (a == 0) return b == 0;
...@@ -609,40 +606,40 @@ template <class T, class M> class Persistent { ...@@ -609,40 +606,40 @@ template <class T, class M> class Persistent {
return *a == *b; return *a == *b;
} }
template <class S, class M2> V8_INLINE( template <class S, class M2>
bool operator!=(const Persistent<S, M2>& that) const) { V8_INLINE bool operator!=(const Persistent<S, M2>& that) const {
return !operator==(that); return !operator==(that);
} }
template <class S> V8_INLINE(bool operator!=(const Handle<S>& that) const) { template <class S> V8_INLINE bool operator!=(const Handle<S>& that) const {
return !operator==(that); return !operator==(that);
} }
template<typename P> template<typename P>
V8_INLINE(void SetWeak( V8_INLINE void SetWeak(
P* parameter, P* parameter,
typename WeakCallbackData<T, P>::Callback callback)); typename WeakCallbackData<T, P>::Callback callback);
template<typename S, typename P> template<typename S, typename P>
V8_INLINE(void SetWeak( V8_INLINE void SetWeak(
P* parameter, P* parameter,
typename WeakCallbackData<S, P>::Callback callback)); typename WeakCallbackData<S, P>::Callback callback);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
template<typename S, typename P> template<typename S, typename P>
V8_INLINE(void MakeWeak( V8_INLINE void MakeWeak(
P* parameter, P* parameter,
typename WeakReferenceCallbacks<S, P>::Revivable callback)); typename WeakReferenceCallbacks<S, P>::Revivable callback);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
template<typename P> template<typename P>
V8_INLINE(void MakeWeak( V8_INLINE void MakeWeak(
P* parameter, P* parameter,
typename WeakReferenceCallbacks<T, P>::Revivable callback)); typename WeakReferenceCallbacks<T, P>::Revivable callback);
V8_INLINE(void ClearWeak()); V8_INLINE void ClearWeak();
V8_DEPRECATED(V8_INLINE(void ClearWeak(Isolate* isolate))) { ClearWeak(); } V8_DEPRECATED(V8_INLINE void ClearWeak(Isolate* isolate)) { ClearWeak(); }
/** /**
* Marks the reference to this object independent. Garbage collector is free * Marks the reference to this object independent. Garbage collector is free
...@@ -650,9 +647,9 @@ template <class T, class M> class Persistent { ...@@ -650,9 +647,9 @@ template <class T, class M> class Persistent {
* independent handle should not assume that it will be preceded by a global * independent handle should not assume that it will be preceded by a global
* GC prologue callback or followed by a global GC epilogue callback. * GC prologue callback or followed by a global GC epilogue callback.
*/ */
V8_INLINE(void MarkIndependent()); V8_INLINE void MarkIndependent();
V8_DEPRECATED(V8_INLINE(void MarkIndependent(Isolate* isolate))) { V8_DEPRECATED(V8_INLINE void MarkIndependent(Isolate* isolate)) {
MarkIndependent(); MarkIndependent();
} }
...@@ -664,29 +661,29 @@ template <class T, class M> class Persistent { ...@@ -664,29 +661,29 @@ template <class T, class M> class Persistent {
* external dependencies. This mark is automatically cleared after each * external dependencies. This mark is automatically cleared after each
* garbage collection. * garbage collection.
*/ */
V8_INLINE(void MarkPartiallyDependent()); V8_INLINE void MarkPartiallyDependent();
V8_DEPRECATED(V8_INLINE(void MarkPartiallyDependent(Isolate* isolate))) { V8_DEPRECATED(V8_INLINE void MarkPartiallyDependent(Isolate* isolate)) {
MarkPartiallyDependent(); MarkPartiallyDependent();
} }
V8_INLINE(bool IsIndependent() const); V8_INLINE bool IsIndependent() const;
V8_DEPRECATED(V8_INLINE(bool IsIndependent(Isolate* isolate)) const) { V8_DEPRECATED(V8_INLINE bool IsIndependent(Isolate* isolate) const) {
return IsIndependent(); return IsIndependent();
} }
/** Checks if the handle holds the only reference to an object. */ /** Checks if the handle holds the only reference to an object. */
V8_INLINE(bool IsNearDeath() const); V8_INLINE bool IsNearDeath() const;
V8_DEPRECATED(V8_INLINE(bool IsNearDeath(Isolate* isolate)) const) { V8_DEPRECATED(V8_INLINE bool IsNearDeath(Isolate* isolate) const) {
return IsNearDeath(); return IsNearDeath();
} }
/** Returns true if the handle's reference is weak. */ /** Returns true if the handle's reference is weak. */
V8_INLINE(bool IsWeak() const); V8_INLINE bool IsWeak() const;
V8_DEPRECATED(V8_INLINE(bool IsWeak(Isolate* isolate)) const) { V8_DEPRECATED(V8_INLINE bool IsWeak(Isolate* isolate) const) {
return IsWeak(); return IsWeak();
} }
...@@ -694,10 +691,10 @@ template <class T, class M> class Persistent { ...@@ -694,10 +691,10 @@ template <class T, class M> class Persistent {
* Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface * Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface
* description in v8-profiler.h for details. * description in v8-profiler.h for details.
*/ */
V8_INLINE(void SetWrapperClassId(uint16_t class_id)); V8_INLINE void SetWrapperClassId(uint16_t class_id);
V8_DEPRECATED( V8_DEPRECATED(
V8_INLINE(void SetWrapperClassId(Isolate * isolate, uint16_t class_id))) { V8_INLINE void SetWrapperClassId(Isolate * isolate, uint16_t class_id)) {
SetWrapperClassId(class_id); SetWrapperClassId(class_id);
} }
...@@ -705,26 +702,26 @@ template <class T, class M> class Persistent { ...@@ -705,26 +702,26 @@ template <class T, class M> class Persistent {
* Returns the class ID previously assigned to this handle or 0 if no class ID * Returns the class ID previously assigned to this handle or 0 if no class ID
* was previously assigned. * was previously assigned.
*/ */
V8_INLINE(uint16_t WrapperClassId() const); V8_INLINE uint16_t WrapperClassId() const;
V8_DEPRECATED(V8_INLINE(uint16_t WrapperClassId(Isolate* isolate)) const) { V8_DEPRECATED(V8_INLINE uint16_t WrapperClassId(Isolate* isolate) const) {
return WrapperClassId(); return WrapperClassId();
} }
// TODO(dcarney): remove // TODO(dcarney): remove
V8_INLINE(T* ClearAndLeak()); V8_INLINE T* ClearAndLeak();
// TODO(dcarney): remove // TODO(dcarney): remove
V8_INLINE(void Clear()) { val_ = 0; } V8_INLINE void Clear() { val_ = 0; }
// TODO(dcarney): remove // TODO(dcarney): remove
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
private: private:
#endif #endif
template <class S> V8_INLINE(Persistent(S* that)) : val_(that) { } template <class S> V8_INLINE Persistent(S* that) : val_(that) { }
V8_INLINE(T* operator*() const) { return val_; } V8_INLINE T* operator*() const { return val_; }
private: private:
friend class Utils; friend class Utils;
...@@ -733,9 +730,9 @@ template <class T, class M> class Persistent { ...@@ -733,9 +730,9 @@ template <class T, class M> class Persistent {
template<class F1, class F2> friend class Persistent; template<class F1, class F2> friend class Persistent;
template<class F> friend class ReturnValue; template<class F> friend class ReturnValue;
V8_INLINE(static T* New(Isolate* isolate, T* that)); V8_INLINE static T* New(Isolate* isolate, T* that);
template<class S, class M2> template<class S, class M2>
V8_INLINE(void Copy(const Persistent<S, M2>& that)); V8_INLINE void Copy(const Persistent<S, M2>& that);
T* val_; T* val_;
}; };
...@@ -795,7 +792,7 @@ class V8_EXPORT HandleScope { ...@@ -795,7 +792,7 @@ class V8_EXPORT HandleScope {
internal::Object** next; internal::Object** next;
internal::Object** limit; internal::Object** limit;
int level; int level;
V8_INLINE(void Initialize()) { V8_INLINE void Initialize() {
next = limit = NULL; next = limit = NULL;
level = 0; level = 0;
} }
...@@ -904,19 +901,19 @@ class V8_EXPORT ScriptData { // NOLINT ...@@ -904,19 +901,19 @@ class V8_EXPORT ScriptData { // NOLINT
*/ */
class ScriptOrigin { class ScriptOrigin {
public: public:
V8_INLINE(ScriptOrigin( V8_INLINE ScriptOrigin(
Handle<Value> resource_name, Handle<Value> resource_name,
Handle<Integer> resource_line_offset = Handle<Integer>(), Handle<Integer> resource_line_offset = Handle<Integer>(),
Handle<Integer> resource_column_offset = Handle<Integer>(), Handle<Integer> resource_column_offset = Handle<Integer>(),
Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>())) Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>())
: resource_name_(resource_name), : resource_name_(resource_name),
resource_line_offset_(resource_line_offset), resource_line_offset_(resource_line_offset),
resource_column_offset_(resource_column_offset), resource_column_offset_(resource_column_offset),
resource_is_shared_cross_origin_(resource_is_shared_cross_origin) { } resource_is_shared_cross_origin_(resource_is_shared_cross_origin) { }
V8_INLINE(Handle<Value> ResourceName() const); V8_INLINE Handle<Value> ResourceName() const;
V8_INLINE(Handle<Integer> ResourceLineOffset() const); V8_INLINE Handle<Integer> ResourceLineOffset() const;
V8_INLINE(Handle<Integer> ResourceColumnOffset() const); V8_INLINE Handle<Integer> ResourceColumnOffset() const;
V8_INLINE(Handle<Boolean> ResourceIsSharedCrossOrigin() const); V8_INLINE Handle<Boolean> ResourceIsSharedCrossOrigin() const;
private: private:
Handle<Value> resource_name_; Handle<Value> resource_name_;
Handle<Integer> resource_line_offset_; Handle<Integer> resource_line_offset_;
...@@ -1257,13 +1254,13 @@ class V8_EXPORT Value : public Data { ...@@ -1257,13 +1254,13 @@ class V8_EXPORT Value : public Data {
* 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.
*/ */
V8_INLINE(bool IsUndefined() const); V8_INLINE bool IsUndefined() const;
/** /**
* Returns true if this value is the null value. See ECMA-262 * Returns true if this value is the null value. See ECMA-262
* 4.3.11. * 4.3.11.
*/ */
V8_INLINE(bool IsNull() const); V8_INLINE bool IsNull() const;
/** /**
* Returns true if this value is true. * Returns true if this value is true.
...@@ -1279,7 +1276,7 @@ class V8_EXPORT Value : public Data { ...@@ -1279,7 +1276,7 @@ class V8_EXPORT Value : public Data {
* Returns true if this value is an instance of the String type. * Returns true if this value is an instance of the String type.
* See ECMA-262 8.4. * See ECMA-262 8.4.
*/ */
V8_INLINE(bool IsString() const); V8_INLINE bool IsString() const;
/** /**
* Returns true if this value is a symbol. * Returns true if this value is a symbol.
...@@ -1467,12 +1464,12 @@ class V8_EXPORT Value : public Data { ...@@ -1467,12 +1464,12 @@ class V8_EXPORT Value : public Data {
bool Equals(Handle<Value> that) const; bool Equals(Handle<Value> that) const;
bool StrictEquals(Handle<Value> that) const; bool StrictEquals(Handle<Value> that) const;
template <class T> V8_INLINE(static Value* Cast(T* value)); template <class T> V8_INLINE static Value* Cast(T* value);
private: private:
V8_INLINE(bool QuickIsUndefined() const); V8_INLINE bool QuickIsUndefined() const;
V8_INLINE(bool QuickIsNull() const); V8_INLINE bool QuickIsNull() const;
V8_INLINE(bool QuickIsString() const); V8_INLINE bool QuickIsString() const;
bool FullIsUndefined() const; bool FullIsUndefined() const;
bool FullIsNull() const; bool FullIsNull() const;
bool FullIsString() const; bool FullIsString() const;
...@@ -1492,7 +1489,7 @@ class V8_EXPORT Primitive : public Value { }; ...@@ -1492,7 +1489,7 @@ class V8_EXPORT Primitive : public Value { };
class V8_EXPORT Boolean : public Primitive { class V8_EXPORT Boolean : public Primitive {
public: public:
bool Value() const; bool Value() const;
V8_INLINE(static Handle<Boolean> New(bool value)); V8_INLINE static Handle<Boolean> New(bool value);
}; };
...@@ -1521,7 +1518,7 @@ class V8_EXPORT String : public Primitive { ...@@ -1521,7 +1518,7 @@ class V8_EXPORT String : public Primitive {
/** /**
* This function is no longer useful. * This function is no longer useful.
*/ */
V8_DEPRECATED(V8_INLINE(bool MayContainNonAscii()) const) { return true; } V8_DEPRECATED(V8_INLINE bool MayContainNonAscii() const) { return true; }
/** /**
* Returns whether this string is known to contain only one byte data. * Returns whether this string is known to contain only one byte data.
...@@ -1593,7 +1590,7 @@ class V8_EXPORT String : public Primitive { ...@@ -1593,7 +1590,7 @@ class V8_EXPORT String : public Primitive {
* A zero length string. * A zero length string.
*/ */
static v8::Local<v8::String> Empty(); static v8::Local<v8::String> Empty();
V8_INLINE(static v8::Local<v8::String> Empty(Isolate* isolate)); V8_INLINE static v8::Local<v8::String> Empty(Isolate* isolate);
/** /**
* Returns true if the string is external * Returns true if the string is external
...@@ -1691,14 +1688,14 @@ class V8_EXPORT String : public Primitive { ...@@ -1691,14 +1688,14 @@ class V8_EXPORT String : public Primitive {
* regardless of the encoding, otherwise return NULL. The encoding of the * regardless of the encoding, otherwise return NULL. The encoding of the
* string is returned in encoding_out. * string is returned in encoding_out.
*/ */
V8_INLINE(ExternalStringResourceBase* GetExternalStringResourceBase( V8_INLINE ExternalStringResourceBase* GetExternalStringResourceBase(
Encoding* encoding_out) const); Encoding* encoding_out) const;
/** /**
* Get the ExternalStringResource for an external string. Returns * Get the ExternalStringResource for an external string. Returns
* NULL if IsExternal() doesn't return true. * NULL if IsExternal() doesn't return true.
*/ */
V8_INLINE(ExternalStringResource* GetExternalStringResource() const); V8_INLINE ExternalStringResource* GetExternalStringResource() const;
/** /**
* Get the ExternalAsciiStringResource for an external ASCII string. * Get the ExternalAsciiStringResource for an external ASCII string.
...@@ -1706,7 +1703,7 @@ class V8_EXPORT String : public Primitive { ...@@ -1706,7 +1703,7 @@ class V8_EXPORT String : public Primitive {
*/ */
const ExternalAsciiStringResource* GetExternalAsciiStringResource() const; const ExternalAsciiStringResource* GetExternalAsciiStringResource() const;
V8_INLINE(static String* Cast(v8::Value* obj)); V8_INLINE static String* Cast(v8::Value* obj);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
/** /**
...@@ -1714,18 +1711,18 @@ class V8_EXPORT String : public Primitive { ...@@ -1714,18 +1711,18 @@ class V8_EXPORT String : public Primitive {
* The second parameter 'length' gives the buffer length. If omitted, * The second parameter 'length' gives the buffer length. If omitted,
* the function calls 'strlen' to determine the buffer length. * the function calls 'strlen' to determine the buffer length.
*/ */
V8_INLINE(static Local<String> New(const char* data, int length = -1)); V8_INLINE static Local<String> New(const char* data, int length = -1);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
/** Allocates a new string from 16-bit character codes.*/ /** Allocates a new string from 16-bit character codes.*/
V8_INLINE(static Local<String> New(const uint16_t* data, int length = -1)); V8_INLINE static Local<String> New(const uint16_t* data, int length = -1);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
/** /**
* Creates an internalized string (historically called a "symbol", * Creates an internalized string (historically called a "symbol",
* not to be confused with ES6 symbols). Returns one if it exists already. * not to be confused with ES6 symbols). Returns one if it exists already.
*/ */
V8_INLINE(static Local<String> NewSymbol(const char* data, int length = -1)); V8_INLINE static Local<String> NewSymbol(const char* data, int length = -1);
enum NewStringType { enum NewStringType {
kNormalString, kInternalizedString, kUndetectableString kNormalString, kInternalizedString, kUndetectableString
...@@ -1806,13 +1803,13 @@ class V8_EXPORT String : public Primitive { ...@@ -1806,13 +1803,13 @@ class V8_EXPORT String : public Primitive {
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/ /** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/
V8_INLINE( V8_INLINE static Local<String> NewUndetectable(const char* data,
static Local<String> NewUndetectable(const char* data, int length = -1)); int length = -1);
// TODO(dcarney): deprecate // TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied 16-bit character codes.*/ /** Creates an undetectable string from the supplied 16-bit character codes.*/
V8_INLINE(static Local<String> NewUndetectable( V8_INLINE static Local<String> NewUndetectable(const uint16_t* data,
const uint16_t* data, int length = -1)); int length = -1);
/** /**
* Converts an object to a UTF-8-encoded character array. Useful if * Converts an object to a UTF-8-encoded character array. Useful if
...@@ -1907,7 +1904,7 @@ class V8_EXPORT Symbol : public Primitive { ...@@ -1907,7 +1904,7 @@ class V8_EXPORT Symbol : public Primitive {
// Create a symbol with a print name. // Create a symbol with a print name.
static Local<Symbol> New(Isolate *isolate, const char* data, int length = -1); static Local<Symbol> New(Isolate *isolate, const char* data, int length = -1);
V8_INLINE(static Symbol* Cast(v8::Value* obj)); V8_INLINE static Symbol* Cast(v8::Value* obj);
private: private:
Symbol(); Symbol();
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -1922,7 +1919,7 @@ class V8_EXPORT Number : public Primitive { ...@@ -1922,7 +1919,7 @@ class V8_EXPORT Number : public Primitive {
double Value() const; double Value() const;
static Local<Number> New(double value); static Local<Number> New(double value);
static Local<Number> New(Isolate* isolate, double value); static Local<Number> New(Isolate* isolate, double value);
V8_INLINE(static Number* Cast(v8::Value* obj)); V8_INLINE static Number* Cast(v8::Value* obj);
private: private:
Number(); Number();
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -1939,7 +1936,7 @@ class V8_EXPORT Integer : public Number { ...@@ -1939,7 +1936,7 @@ class V8_EXPORT Integer : public Number {
static Local<Integer> New(int32_t value, Isolate*); static Local<Integer> New(int32_t value, Isolate*);
static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*); static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*);
int64_t Value() const; int64_t Value() const;
V8_INLINE(static Integer* Cast(v8::Value* obj)); V8_INLINE static Integer* Cast(v8::Value* obj);
private: private:
Integer(); Integer();
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -2140,7 +2137,7 @@ class V8_EXPORT Object : public Value { ...@@ -2140,7 +2137,7 @@ class V8_EXPORT Object : public Value {
int InternalFieldCount(); int InternalFieldCount();
/** Gets the value from an internal field. */ /** Gets the value from an internal field. */
V8_INLINE(Local<Value> GetInternalField(int index)); V8_INLINE Local<Value> GetInternalField(int index);
/** Sets the value in an internal field. */ /** Sets the value in an internal field. */
void SetInternalField(int index, Handle<Value> value); void SetInternalField(int index, Handle<Value> value);
...@@ -2150,7 +2147,7 @@ class V8_EXPORT Object : public Value { ...@@ -2150,7 +2147,7 @@ class V8_EXPORT Object : public Value {
* must have been set by SetAlignedPointerInInternalField, everything else * must have been set by SetAlignedPointerInInternalField, everything else
* leads to undefined behavior. * leads to undefined behavior.
*/ */
V8_INLINE(void* GetAlignedPointerFromInternalField(int index)); V8_INLINE void* GetAlignedPointerFromInternalField(int index);
/** /**
* Sets a 2-byte-aligned native pointer in an internal field. To retrieve such * Sets a 2-byte-aligned native pointer in an internal field. To retrieve such
...@@ -2280,7 +2277,7 @@ class V8_EXPORT Object : public Value { ...@@ -2280,7 +2277,7 @@ class V8_EXPORT Object : public Value {
Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]);
static Local<Object> New(); static Local<Object> New();
V8_INLINE(static Object* Cast(Value* obj)); V8_INLINE static Object* Cast(Value* obj);
private: private:
Object(); Object();
...@@ -2309,7 +2306,7 @@ class V8_EXPORT Array : public Object { ...@@ -2309,7 +2306,7 @@ class V8_EXPORT Array : public Object {
*/ */
static Local<Array> New(int length = 0); static Local<Array> New(int length = 0);
V8_INLINE(static Array* Cast(Value* obj)); V8_INLINE static Array* Cast(Value* obj);
private: private:
Array(); Array();
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
...@@ -2319,31 +2316,31 @@ class V8_EXPORT Array : public Object { ...@@ -2319,31 +2316,31 @@ class V8_EXPORT Array : public Object {
template<typename T> template<typename T>
class ReturnValue { class ReturnValue {
public: public:
template <class S> V8_INLINE(ReturnValue(const ReturnValue<S>& that)) template <class S> V8_INLINE ReturnValue(const ReturnValue<S>& that)
: value_(that.value_) { : value_(that.value_) {
TYPE_CHECK(T, S); TYPE_CHECK(T, S);
} }
// Handle setters // Handle setters
template <typename S> V8_INLINE(void Set(const Persistent<S>& handle)); template <typename S> V8_INLINE void Set(const Persistent<S>& handle);
template <typename S> V8_INLINE(void Set(const Handle<S> 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();
V8_INLINE(void SetEmptyString()); V8_INLINE void SetEmptyString();
// Convenience getter for Isolate // Convenience getter for Isolate
V8_INLINE(Isolate* GetIsolate()); V8_INLINE Isolate* GetIsolate();
private: private:
template<class F> friend class ReturnValue; template<class F> friend class ReturnValue;
template<class F> friend class FunctionCallbackInfo; template<class F> friend class FunctionCallbackInfo;
template<class F> friend class PropertyCallbackInfo; template<class F> friend class PropertyCallbackInfo;
V8_INLINE(internal::Object* GetDefaultValue()); V8_INLINE internal::Object* GetDefaultValue();
V8_INLINE(explicit ReturnValue(internal::Object** slot)); V8_INLINE explicit ReturnValue(internal::Object** slot);
internal::Object** value_; internal::Object** value_;
}; };
...@@ -2357,15 +2354,15 @@ class ReturnValue { ...@@ -2357,15 +2354,15 @@ class ReturnValue {
template<typename T> template<typename T>
class FunctionCallbackInfo { class FunctionCallbackInfo {
public: public:
V8_INLINE(int Length() const); V8_INLINE int Length() const;
V8_INLINE(Local<Value> operator[](int i) const); V8_INLINE Local<Value> operator[](int i) const;
V8_INLINE(Local<Function> Callee() const); V8_INLINE Local<Function> Callee() const;
V8_INLINE(Local<Object> This() const); V8_INLINE Local<Object> This() const;
V8_INLINE(Local<Object> Holder() const); V8_INLINE Local<Object> Holder() const;
V8_INLINE(bool IsConstructCall() const); V8_INLINE bool IsConstructCall() const;
V8_INLINE(Local<Value> Data() const); V8_INLINE Local<Value> Data() const;
V8_INLINE(Isolate* GetIsolate() const); V8_INLINE Isolate* GetIsolate() const;
V8_INLINE(ReturnValue<T> GetReturnValue() const); V8_INLINE ReturnValue<T> GetReturnValue() const;
// This shouldn't be public, but the arm compiler needs it. // This shouldn't be public, but the arm compiler needs it.
static const int kArgsLength = 6; static const int kArgsLength = 6;
...@@ -2379,10 +2376,10 @@ class FunctionCallbackInfo { ...@@ -2379,10 +2376,10 @@ class FunctionCallbackInfo {
static const int kCalleeIndex = -4; static const int kCalleeIndex = -4;
static const int kHolderIndex = -5; static const int kHolderIndex = -5;
V8_INLINE(FunctionCallbackInfo(internal::Object** implicit_args, V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args,
internal::Object** values, internal::Object** values,
int length, int length,
bool is_construct_call)); bool is_construct_call);
internal::Object** implicit_args_; internal::Object** implicit_args_;
internal::Object** values_; internal::Object** values_;
int length_; int length_;
...@@ -2397,11 +2394,11 @@ class FunctionCallbackInfo { ...@@ -2397,11 +2394,11 @@ class FunctionCallbackInfo {
template<typename T> template<typename T>
class PropertyCallbackInfo { class PropertyCallbackInfo {
public: public:
V8_INLINE(Isolate* GetIsolate() const); V8_INLINE Isolate* GetIsolate() const;
V8_INLINE(Local<Value> Data() const); V8_INLINE Local<Value> Data() const;
V8_INLINE(Local<Object> This() const); V8_INLINE Local<Object> This() const;
V8_INLINE(Local<Object> Holder() const); V8_INLINE Local<Object> Holder() const;
V8_INLINE(ReturnValue<T> GetReturnValue() const); V8_INLINE ReturnValue<T> GetReturnValue() const;
// This shouldn't be public, but the arm compiler needs it. // This shouldn't be public, but the arm compiler needs it.
static const int kArgsLength = 6; static const int kArgsLength = 6;
...@@ -2416,8 +2413,7 @@ class PropertyCallbackInfo { ...@@ -2416,8 +2413,7 @@ class PropertyCallbackInfo {
static const int kReturnValueDefaultValueIndex = -4; static const int kReturnValueDefaultValueIndex = -4;
static const int kIsolateIndex = -5; static const int kIsolateIndex = -5;
V8_INLINE(PropertyCallbackInfo(internal::Object** args)) V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {}
: args_(args) { }
internal::Object** args_; internal::Object** args_;
}; };
...@@ -2476,7 +2472,7 @@ class V8_EXPORT Function : public Object { ...@@ -2476,7 +2472,7 @@ class V8_EXPORT Function : public Object {
int ScriptId() const; 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:
...@@ -2610,7 +2606,7 @@ class V8_EXPORT ArrayBuffer : public Object { ...@@ -2610,7 +2606,7 @@ class V8_EXPORT ArrayBuffer : public Object {
*/ */
Contents Externalize(); Contents Externalize();
V8_INLINE(static ArrayBuffer* Cast(Value* obj)); V8_INLINE static ArrayBuffer* Cast(Value* obj);
static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
...@@ -2651,7 +2647,7 @@ class V8_EXPORT ArrayBufferView : public Object { ...@@ -2651,7 +2647,7 @@ class V8_EXPORT ArrayBufferView : public Object {
*/ */
void* BaseAddress(); void* BaseAddress();
V8_INLINE(static ArrayBufferView* Cast(Value* obj)); V8_INLINE static ArrayBufferView* Cast(Value* obj);
static const int kInternalFieldCount = static const int kInternalFieldCount =
V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT; V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
...@@ -2675,7 +2671,7 @@ class V8_EXPORT TypedArray : public ArrayBufferView { ...@@ -2675,7 +2671,7 @@ class V8_EXPORT TypedArray : public ArrayBufferView {
*/ */
size_t Length(); size_t Length();
V8_INLINE(static TypedArray* Cast(Value* obj)); V8_INLINE static TypedArray* Cast(Value* obj);
private: private:
TypedArray(); TypedArray();
...@@ -2691,7 +2687,7 @@ class V8_EXPORT Uint8Array : public TypedArray { ...@@ -2691,7 +2687,7 @@ class V8_EXPORT Uint8Array : public TypedArray {
public: public:
static Local<Uint8Array> New(Handle<ArrayBuffer> array_buffer, static Local<Uint8Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Uint8Array* Cast(Value* obj)); V8_INLINE static Uint8Array* Cast(Value* obj);
private: private:
Uint8Array(); Uint8Array();
...@@ -2707,7 +2703,7 @@ class V8_EXPORT Uint8ClampedArray : public TypedArray { ...@@ -2707,7 +2703,7 @@ class V8_EXPORT Uint8ClampedArray : public TypedArray {
public: public:
static Local<Uint8ClampedArray> New(Handle<ArrayBuffer> array_buffer, static Local<Uint8ClampedArray> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Uint8ClampedArray* Cast(Value* obj)); V8_INLINE static Uint8ClampedArray* Cast(Value* obj);
private: private:
Uint8ClampedArray(); Uint8ClampedArray();
...@@ -2722,7 +2718,7 @@ class V8_EXPORT Int8Array : public TypedArray { ...@@ -2722,7 +2718,7 @@ class V8_EXPORT Int8Array : public TypedArray {
public: public:
static Local<Int8Array> New(Handle<ArrayBuffer> array_buffer, static Local<Int8Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Int8Array* Cast(Value* obj)); V8_INLINE static Int8Array* Cast(Value* obj);
private: private:
Int8Array(); Int8Array();
...@@ -2738,7 +2734,7 @@ class V8_EXPORT Uint16Array : public TypedArray { ...@@ -2738,7 +2734,7 @@ class V8_EXPORT Uint16Array : public TypedArray {
public: public:
static Local<Uint16Array> New(Handle<ArrayBuffer> array_buffer, static Local<Uint16Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Uint16Array* Cast(Value* obj)); V8_INLINE static Uint16Array* Cast(Value* obj);
private: private:
Uint16Array(); Uint16Array();
...@@ -2754,7 +2750,7 @@ class V8_EXPORT Int16Array : public TypedArray { ...@@ -2754,7 +2750,7 @@ class V8_EXPORT Int16Array : public TypedArray {
public: public:
static Local<Int16Array> New(Handle<ArrayBuffer> array_buffer, static Local<Int16Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Int16Array* Cast(Value* obj)); V8_INLINE static Int16Array* Cast(Value* obj);
private: private:
Int16Array(); Int16Array();
...@@ -2770,7 +2766,7 @@ class V8_EXPORT Uint32Array : public TypedArray { ...@@ -2770,7 +2766,7 @@ class V8_EXPORT Uint32Array : public TypedArray {
public: public:
static Local<Uint32Array> New(Handle<ArrayBuffer> array_buffer, static Local<Uint32Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Uint32Array* Cast(Value* obj)); V8_INLINE static Uint32Array* Cast(Value* obj);
private: private:
Uint32Array(); Uint32Array();
...@@ -2786,7 +2782,7 @@ class V8_EXPORT Int32Array : public TypedArray { ...@@ -2786,7 +2782,7 @@ class V8_EXPORT Int32Array : public TypedArray {
public: public:
static Local<Int32Array> New(Handle<ArrayBuffer> array_buffer, static Local<Int32Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Int32Array* Cast(Value* obj)); V8_INLINE static Int32Array* Cast(Value* obj);
private: private:
Int32Array(); Int32Array();
...@@ -2802,7 +2798,7 @@ class V8_EXPORT Float32Array : public TypedArray { ...@@ -2802,7 +2798,7 @@ class V8_EXPORT Float32Array : public TypedArray {
public: public:
static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer, static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static Float32Array* Cast(Value* obj)); V8_INLINE static Float32Array* Cast(Value* obj);
private: private:
Float32Array(); Float32Array();
...@@ -2818,7 +2814,7 @@ class V8_EXPORT Float64Array : public TypedArray { ...@@ -2818,7 +2814,7 @@ class V8_EXPORT Float64Array : public TypedArray {
public: public:
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();
...@@ -2834,7 +2830,7 @@ class V8_EXPORT DataView : public ArrayBufferView { ...@@ -2834,7 +2830,7 @@ class V8_EXPORT DataView : public ArrayBufferView {
public: public:
static Local<DataView> New(Handle<ArrayBuffer> array_buffer, static Local<DataView> New(Handle<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length); size_t byte_offset, size_t length);
V8_INLINE(static DataView* Cast(Value* obj)); V8_INLINE static DataView* Cast(Value* obj);
private: private:
DataView(); DataView();
...@@ -2859,7 +2855,7 @@ class V8_EXPORT Date : public Object { ...@@ -2859,7 +2855,7 @@ class V8_EXPORT Date : public Object {
*/ */
double ValueOf() const; double ValueOf() const;
V8_INLINE(static Date* Cast(v8::Value* obj)); V8_INLINE static Date* Cast(v8::Value* obj);
/** /**
* Notification that the embedder has changed the time zone, * Notification that the embedder has changed the time zone,
...@@ -2896,7 +2892,7 @@ class V8_EXPORT NumberObject : public Object { ...@@ -2896,7 +2892,7 @@ class V8_EXPORT NumberObject : public Object {
*/ */
double ValueOf() const; double ValueOf() const;
V8_INLINE(static NumberObject* Cast(v8::Value* obj)); V8_INLINE static NumberObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -2919,7 +2915,7 @@ class V8_EXPORT BooleanObject : public Object { ...@@ -2919,7 +2915,7 @@ class V8_EXPORT BooleanObject : public Object {
*/ */
bool ValueOf() const; bool ValueOf() const;
V8_INLINE(static BooleanObject* Cast(v8::Value* obj)); V8_INLINE static BooleanObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -2942,7 +2938,7 @@ class V8_EXPORT StringObject : public Object { ...@@ -2942,7 +2938,7 @@ class V8_EXPORT StringObject : public Object {
*/ */
Local<String> ValueOf() const; Local<String> ValueOf() const;
V8_INLINE(static StringObject* Cast(v8::Value* obj)); V8_INLINE static StringObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -2967,7 +2963,7 @@ class V8_EXPORT SymbolObject : public Object { ...@@ -2967,7 +2963,7 @@ class V8_EXPORT SymbolObject : public Object {
*/ */
Local<Symbol> ValueOf() const; Local<Symbol> ValueOf() const;
V8_INLINE(static SymbolObject* Cast(v8::Value* obj)); V8_INLINE static SymbolObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -3013,7 +3009,7 @@ class V8_EXPORT RegExp : public Object { ...@@ -3013,7 +3009,7 @@ class V8_EXPORT RegExp : public Object {
*/ */
Flags GetFlags() const; Flags GetFlags() const;
V8_INLINE(static RegExp* Cast(v8::Value* obj)); V8_INLINE static RegExp* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -3027,7 +3023,7 @@ class V8_EXPORT RegExp : public Object { ...@@ -3027,7 +3023,7 @@ class V8_EXPORT RegExp : public Object {
class V8_EXPORT External : public Value { class V8_EXPORT External : public Value {
public: public:
static Local<External> New(void* value); static Local<External> New(void* value);
V8_INLINE(static External* Cast(Value* obj)); V8_INLINE static External* Cast(Value* obj);
void* Value() const; void* Value() const;
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
...@@ -3045,7 +3041,7 @@ class V8_EXPORT Template : public Data { ...@@ -3045,7 +3041,7 @@ class V8_EXPORT Template : public Data {
/** Adds a property to each instance created by this template.*/ /** Adds a property to each instance created by this template.*/
void Set(Handle<String> name, Handle<Data> value, void Set(Handle<String> name, Handle<Data> value,
PropertyAttribute attributes = None); PropertyAttribute attributes = None);
V8_INLINE(void Set(const char* name, Handle<Data> value)); V8_INLINE void Set(const char* name, Handle<Data> value);
void SetAccessorProperty( void SetAccessorProperty(
Local<String> name, Local<String> name,
...@@ -3722,7 +3718,7 @@ void V8_EXPORT RegisterExtension(Extension* extension); ...@@ -3722,7 +3718,7 @@ void V8_EXPORT RegisterExtension(Extension* extension);
*/ */
class V8_EXPORT DeclareExtension { class V8_EXPORT DeclareExtension {
public: public:
V8_INLINE(DeclareExtension(Extension* extension)) { V8_INLINE DeclareExtension(Extension* extension) {
RegisterExtension(extension); RegisterExtension(extension);
} }
}; };
...@@ -3736,10 +3732,10 @@ Handle<Primitive> V8_EXPORT Null(); ...@@ -3736,10 +3732,10 @@ Handle<Primitive> V8_EXPORT Null();
Handle<Boolean> V8_EXPORT True(); Handle<Boolean> V8_EXPORT True();
Handle<Boolean> V8_EXPORT False(); Handle<Boolean> V8_EXPORT False();
V8_INLINE(Handle<Primitive> Undefined(Isolate* isolate)); V8_INLINE Handle<Primitive> Undefined(Isolate* isolate);
V8_INLINE(Handle<Primitive> Null(Isolate* isolate)); V8_INLINE Handle<Primitive> Null(Isolate* isolate);
V8_INLINE(Handle<Boolean> True(Isolate* isolate)); V8_INLINE Handle<Boolean> True(Isolate* isolate);
V8_INLINE(Handle<Boolean> False(Isolate* isolate)); V8_INLINE Handle<Boolean> False(Isolate* isolate);
/** /**
...@@ -3997,13 +3993,13 @@ class V8_EXPORT Isolate { ...@@ -3997,13 +3993,13 @@ class V8_EXPORT Isolate {
/** /**
* Associate embedder-specific data with the isolate * Associate embedder-specific data with the isolate
*/ */
V8_INLINE(void SetData(void* data)); V8_INLINE void SetData(void* data);
/** /**
* Retrieve embedder-specific data from the isolate. * Retrieve embedder-specific data from the isolate.
* Returns NULL if SetData has never been called. * Returns NULL if SetData has never been called.
*/ */
V8_INLINE(void* GetData()); V8_INLINE void* GetData();
/** /**
* Get statistics about the heap memory usage. * Get statistics about the heap memory usage.
...@@ -4275,7 +4271,7 @@ class V8_EXPORT PersistentHandleVisitor { // NOLINT ...@@ -4275,7 +4271,7 @@ class V8_EXPORT PersistentHandleVisitor { // NOLINT
class V8_EXPORT AssertNoGCScope { class V8_EXPORT AssertNoGCScope {
#ifndef DEBUG #ifndef DEBUG
// TODO(yangguo): remove isolate argument. // TODO(yangguo): remove isolate argument.
V8_INLINE(AssertNoGCScope(Isolate* isolate)) { } V8_INLINE AssertNoGCScope(Isolate* isolate) {}
#else #else
AssertNoGCScope(Isolate* isolate); AssertNoGCScope(Isolate* isolate);
~AssertNoGCScope(); ~AssertNoGCScope();
...@@ -4978,7 +4974,7 @@ class V8_EXPORT Context { ...@@ -4978,7 +4974,7 @@ class V8_EXPORT Context {
* previous call to SetEmbedderData with the same index. Note that index 0 * previous call to SetEmbedderData with the same index. Note that index 0
* currently has a special meaning for Chrome's debugger. * currently has a special meaning for Chrome's debugger.
*/ */
V8_INLINE(Local<Value> GetEmbedderData(int index)); V8_INLINE Local<Value> GetEmbedderData(int index);
/** /**
* Sets the embedder data with the given index, growing the data as * Sets the embedder data with the given index, growing the data as
...@@ -4993,7 +4989,7 @@ class V8_EXPORT Context { ...@@ -4993,7 +4989,7 @@ class V8_EXPORT Context {
* SetAlignedPointerInEmbedderData with the same index. Note that index 0 * SetAlignedPointerInEmbedderData with the same index. Note that index 0
* currently has a special meaning for Chrome's debugger. * currently has a special meaning for Chrome's debugger.
*/ */
V8_INLINE(void* GetAlignedPointerFromEmbedderData(int index)); V8_INLINE void* GetAlignedPointerFromEmbedderData(int index);
/** /**
* Sets a 2-byte-aligned native pointer in the embedder data with the given * Sets a 2-byte-aligned native pointer in the embedder data with the given
...@@ -5036,15 +5032,15 @@ class V8_EXPORT Context { ...@@ -5036,15 +5032,15 @@ class V8_EXPORT Context {
*/ */
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 // TODO(dcarney): deprecate
V8_INLINE(Scope(Isolate* isolate, Persistent<Context>& context)) // NOLINT V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context) // NOLINT
: context_(Handle<Context>::New(isolate, context)) { : context_(Handle<Context>::New(isolate, context)) {
context_->Enter(); context_->Enter();
} }
V8_INLINE(~Scope()) { context_->Exit(); } V8_INLINE ~Scope() { context_->Exit(); }
private: private:
Handle<Context> context_; Handle<Context> context_;
...@@ -5142,7 +5138,7 @@ class V8_EXPORT Unlocker { ...@@ -5142,7 +5138,7 @@ class V8_EXPORT Unlocker {
/** /**
* Initialize Unlocker for a given Isolate. * Initialize Unlocker for a given Isolate.
*/ */
V8_INLINE(explicit Unlocker(Isolate* isolate)) { Initialize(isolate); } V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); }
/** Deprecated. Use Isolate version instead. */ /** Deprecated. Use Isolate version instead. */
V8_DEPRECATED(Unlocker()); V8_DEPRECATED(Unlocker());
...@@ -5160,7 +5156,7 @@ class V8_EXPORT Locker { ...@@ -5160,7 +5156,7 @@ class V8_EXPORT Locker {
/** /**
* Initialize Locker for a given Isolate. * Initialize Locker for a given Isolate.
*/ */
V8_INLINE(explicit Locker(Isolate* isolate)) { Initialize(isolate); } V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); }
/** Deprecated. Use Isolate version instead. */ /** Deprecated. Use Isolate version instead. */
V8_DEPRECATED(Locker()); V8_DEPRECATED(Locker());
...@@ -5289,7 +5285,7 @@ const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; ...@@ -5289,7 +5285,7 @@ const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1;
template <size_t ptr_size> struct SmiTagging; template <size_t ptr_size> struct SmiTagging;
template<int kSmiShiftSize> template<int kSmiShiftSize>
V8_INLINE(internal::Object* IntToSmi(int value)) { V8_INLINE internal::Object* IntToSmi(int value) {
int smi_shift_bits = kSmiTagSize + kSmiShiftSize; int smi_shift_bits = kSmiTagSize + kSmiShiftSize;
intptr_t tagged_value = intptr_t tagged_value =
(static_cast<intptr_t>(value) << smi_shift_bits) | kSmiTag; (static_cast<intptr_t>(value) << smi_shift_bits) | kSmiTag;
...@@ -5300,15 +5296,15 @@ V8_INLINE(internal::Object* IntToSmi(int value)) { ...@@ -5300,15 +5296,15 @@ V8_INLINE(internal::Object* IntToSmi(int value)) {
template <> struct SmiTagging<4> { template <> struct SmiTagging<4> {
static const int kSmiShiftSize = 0; static const int kSmiShiftSize = 0;
static const int kSmiValueSize = 31; static const int kSmiValueSize = 31;
V8_INLINE(static int SmiToInt(internal::Object* value)) { V8_INLINE static int SmiToInt(internal::Object* value) {
int shift_bits = kSmiTagSize + kSmiShiftSize; int shift_bits = kSmiTagSize + kSmiShiftSize;
// Throw away top 32 bits and shift down (requires >> to be sign extending). // Throw away top 32 bits and shift down (requires >> to be sign extending).
return static_cast<int>(reinterpret_cast<intptr_t>(value)) >> shift_bits; return static_cast<int>(reinterpret_cast<intptr_t>(value)) >> shift_bits;
} }
V8_INLINE(static internal::Object* IntToSmi(int value)) { V8_INLINE static internal::Object* IntToSmi(int value) {
return internal::IntToSmi<kSmiShiftSize>(value); return internal::IntToSmi<kSmiShiftSize>(value);
} }
V8_INLINE(static bool IsValidSmi(intptr_t value)) { V8_INLINE static bool IsValidSmi(intptr_t value) {
// To be representable as an tagged small integer, the two // To be representable as an tagged small integer, the two
// most-significant bits of 'value' must be either 00 or 11 due to // most-significant bits of 'value' must be either 00 or 11 due to
// sign-extension. To check this we add 01 to the two // sign-extension. To check this we add 01 to the two
...@@ -5328,15 +5324,15 @@ template <> struct SmiTagging<4> { ...@@ -5328,15 +5324,15 @@ template <> struct SmiTagging<4> {
template <> struct SmiTagging<8> { template <> struct SmiTagging<8> {
static const int kSmiShiftSize = 31; static const int kSmiShiftSize = 31;
static const int kSmiValueSize = 32; static const int kSmiValueSize = 32;
V8_INLINE(static int SmiToInt(internal::Object* value)) { V8_INLINE static int SmiToInt(internal::Object* value) {
int shift_bits = kSmiTagSize + kSmiShiftSize; int shift_bits = kSmiTagSize + kSmiShiftSize;
// Shift down and throw away top 32 bits. // Shift down and throw away top 32 bits.
return static_cast<int>(reinterpret_cast<intptr_t>(value) >> shift_bits); return static_cast<int>(reinterpret_cast<intptr_t>(value) >> shift_bits);
} }
V8_INLINE(static internal::Object* IntToSmi(int value)) { V8_INLINE static internal::Object* IntToSmi(int value) {
return internal::IntToSmi<kSmiShiftSize>(value); return internal::IntToSmi<kSmiShiftSize>(value);
} }
V8_INLINE(static bool IsValidSmi(intptr_t value)) { V8_INLINE static bool IsValidSmi(intptr_t value) {
// To be representable as a long smi, the value must be a 32-bit integer. // To be representable as a long smi, the value must be a 32-bit integer.
return (value == static_cast<int32_t>(value)); return (value == static_cast<int32_t>(value));
} }
...@@ -5345,8 +5341,8 @@ template <> struct SmiTagging<8> { ...@@ -5345,8 +5341,8 @@ template <> struct SmiTagging<8> {
typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; typedef SmiTagging<kApiPointerSize> PlatformSmiTagging;
const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize;
const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize;
V8_INLINE(static bool SmiValuesAre31Bits()) { return kSmiValueSize == 31; } V8_INLINE static bool SmiValuesAre31Bits() { return kSmiValueSize == 31; }
V8_INLINE(static bool SmiValuesAre32Bits()) { return kSmiValueSize == 32; } V8_INLINE static bool SmiValuesAre32Bits() { return kSmiValueSize == 32; }
/** /**
* This class exports constants and functionality from within v8 that * This class exports constants and functionality from within v8 that
...@@ -5398,94 +5394,93 @@ class Internals { ...@@ -5398,94 +5394,93 @@ class Internals {
static const int kNullOddballKind = 3; static const int kNullOddballKind = 3;
static void CheckInitializedImpl(v8::Isolate* isolate); static void CheckInitializedImpl(v8::Isolate* isolate);
V8_INLINE(static void CheckInitialized(v8::Isolate* isolate)) { V8_INLINE static void CheckInitialized(v8::Isolate* isolate) {
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckInitializedImpl(isolate); CheckInitializedImpl(isolate);
#endif #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) {
return PlatformSmiTagging::IntToSmi(value); return PlatformSmiTagging::IntToSmi(value);
} }
V8_INLINE(static bool IsValidSmi(intptr_t value)) { V8_INLINE static bool IsValidSmi(intptr_t value) {
return PlatformSmiTagging::IsValidSmi(value); return PlatformSmiTagging::IsValidSmi(value);
} }
V8_INLINE(static int GetInstanceType(internal::Object* obj)) { V8_INLINE static int GetInstanceType(internal::Object* obj) {
typedef internal::Object O; typedef internal::Object O;
O* map = ReadField<O*>(obj, kHeapObjectMapOffset); O* map = ReadField<O*>(obj, kHeapObjectMapOffset);
return ReadField<uint8_t>(map, kMapInstanceTypeOffset); return ReadField<uint8_t>(map, kMapInstanceTypeOffset);
} }
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 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 & static_cast<uint8_t>(1U << shift); return *addr & static_cast<uint8_t>(1U << 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 = static_cast<uint8_t>(1 << shift); uint8_t mask = static_cast<uint8_t>(1 << shift);
*addr = static_cast<uint8_t>((*addr & ~mask) | (value << shift)); *addr = static_cast<uint8_t>((*addr & ~mask) | (value << shift));
} }
V8_INLINE(static uint8_t GetNodeState(internal::Object** obj)) { V8_INLINE static uint8_t GetNodeState(internal::Object** obj) {
uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset; uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
return *addr & kNodeStateMask; return *addr & kNodeStateMask;
} }
V8_INLINE(static void UpdateNodeState(internal::Object** obj, V8_INLINE static void UpdateNodeState(internal::Object** obj,
uint8_t value)) { uint8_t value) {
uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset; uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
*addr = static_cast<uint8_t>((*addr & ~kNodeStateMask) | value); *addr = static_cast<uint8_t>((*addr & ~kNodeStateMask) | value);
} }
V8_INLINE(static void SetEmbedderData(v8::Isolate* isolate, void* data)) { V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, void* data) {
uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) +
kIsolateEmbedderDataOffset; kIsolateEmbedderDataOffset;
*reinterpret_cast<void**>(addr) = data; *reinterpret_cast<void**>(addr) = data;
} }
V8_INLINE(static void* GetEmbedderData(v8::Isolate* isolate)) { V8_INLINE static void* GetEmbedderData(v8::Isolate* isolate) {
uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) +
kIsolateEmbedderDataOffset; kIsolateEmbedderDataOffset;
return *reinterpret_cast<void**>(addr); return *reinterpret_cast<void**>(addr);
} }
V8_INLINE(static internal::Object** GetRoot(v8::Isolate* isolate, V8_INLINE static internal::Object** GetRoot(v8::Isolate* isolate,
int index)) { int index) {
uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + kIsolateRootsOffset; uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + kIsolateRootsOffset;
return reinterpret_cast<internal::Object**>(addr + index * kApiPointerSize); return reinterpret_cast<internal::Object**>(addr + index * kApiPointerSize);
} }
template <typename T> template <typename T> V8_INLINE static T ReadField(Object* ptr, int offset) {
V8_INLINE(static T ReadField(Object* ptr, int offset)) {
uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag; uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag;
return *reinterpret_cast<T*>(addr); return *reinterpret_cast<T*>(addr);
} }
template <typename T> template <typename T>
V8_INLINE(static T ReadEmbedderData(Context* context, int index)) { V8_INLINE static T ReadEmbedderData(Context* context, int index) {
typedef internal::Object O; typedef internal::Object O;
typedef internal::Internals I; typedef internal::Internals I;
O* ctx = *reinterpret_cast<O**>(context); O* ctx = *reinterpret_cast<O**>(context);
...@@ -5497,13 +5492,13 @@ class Internals { ...@@ -5497,13 +5492,13 @@ class Internals {
return I::ReadField<T>(embedder_data, value_offset); return I::ReadField<T>(embedder_data, value_offset);
} }
V8_INLINE(static bool CanCastToHeapObject(void* o)) { return false; } V8_INLINE static bool CanCastToHeapObject(void* o) { return false; }
V8_INLINE(static bool CanCastToHeapObject(Context* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(Context* o) { return true; }
V8_INLINE(static bool CanCastToHeapObject(String* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(String* o) { return true; }
V8_INLINE(static bool CanCastToHeapObject(Object* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(Object* o) { return true; }
V8_INLINE(static bool CanCastToHeapObject(Message* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(Message* o) { return true; }
V8_INLINE(static bool CanCastToHeapObject(StackTrace* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(StackTrace* o) { return true; }
V8_INLINE(static bool CanCastToHeapObject(StackFrame* o)) { return true; } V8_INLINE static bool CanCastToHeapObject(StackFrame* o) { return true; }
}; };
} // namespace internal } // namespace internal
......
...@@ -298,23 +298,27 @@ ...@@ -298,23 +298,27 @@
// Helper macros // Helper macros
// A macro used to make better inlining. Don't bother for debug builds. // A macro used to make better inlining. Don't bother for debug builds.
// Use like:
// V8_INLINE int GetZero() { return 0; }
#if !defined(DEBUG) && V8_HAS_ATTRIBUTE_ALWAYS_INLINE #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_ALWAYS_INLINE
# define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator # define V8_INLINE inline __attribute__((always_inline))
#elif !defined(DEBUG) && V8_HAS___FORCEINLINE #elif !defined(DEBUG) && V8_HAS___FORCEINLINE
# define V8_INLINE(declarator) __forceinline declarator # define V8_INLINE __forceinline
#else #else
# define V8_INLINE(declarator) inline declarator # define V8_INLINE inline
#endif #endif
// A macro used to tell the compiler to never inline a particular function. // A macro used to tell the compiler to never inline a particular function.
// Don't bother for debug builds. // Don't bother for debug builds.
// Use like:
// V8_NOINLINE int GetMinusOne() { return -1; }
#if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE
# define V8_NOINLINE(declarator) __attribute__((noinline)) declarator # define V8_NOINLINE __attribute__((noinline))
#elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE
# define V8_NOINLINE(declarator) __declspec(noinline) declarator # define V8_NOINLINE __declspec(noinline)
#else #else
# define V8_NOINLINE(declarator) declarator # define V8_NOINLINE /* NOT SUPPORTED */
#endif #endif
......
...@@ -54,7 +54,7 @@ namespace internal { ...@@ -54,7 +54,7 @@ namespace internal {
// Define __cpuid() for non-MSVC compilers. // Define __cpuid() for non-MSVC compilers.
#if !V8_CC_MSVC #if !V8_CC_MSVC
static V8_INLINE(void __cpuid(int cpu_info[4], int info_type)) { static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
#if defined(__i386__) && defined(__pic__) #if defined(__i386__) && defined(__pic__)
// Make sure to preserve ebx, which contains the pointer // Make sure to preserve ebx, which contains the pointer
// to the GOT in case we're generating PIC. // to the GOT in case we're generating PIC.
......
...@@ -342,9 +342,9 @@ F FUNCTION_CAST(Address addr) { ...@@ -342,9 +342,9 @@ F FUNCTION_CAST(Address addr) {
DISALLOW_COPY_AND_ASSIGN(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)
// Newly written code should use V8_INLINE() and V8_NOINLINE() directly. // Newly written code should use V8_INLINE and V8_NOINLINE directly.
#define INLINE(declarator) V8_INLINE(declarator) #define INLINE(declarator) V8_INLINE declarator
#define NO_INLINE(declarator) V8_NOINLINE(declarator) #define NO_INLINE(declarator) V8_NOINLINE declarator
// Newly written code should use V8_WARN_UNUSED_RESULT. // Newly written code should use V8_WARN_UNUSED_RESULT.
......
...@@ -103,7 +103,7 @@ class ElapsedTimer V8_FINAL BASE_EMBEDDED { ...@@ -103,7 +103,7 @@ class ElapsedTimer V8_FINAL BASE_EMBEDDED {
} }
private: private:
V8_INLINE(static TimeTicks Now()) { static V8_INLINE TimeTicks Now() {
TimeTicks now = TimeTicks::HighResNow(); TimeTicks now = TimeTicks::HighResNow();
ASSERT(!now.IsNull()); ASSERT(!now.IsNull());
return now; return now;
......
...@@ -34,7 +34,7 @@ namespace internal { ...@@ -34,7 +34,7 @@ namespace internal {
#if V8_OS_POSIX #if V8_OS_POSIX
static V8_INLINE(void InitializeNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE void InitializeNativeHandle(pthread_mutex_t* mutex) {
int result; int result;
#if defined(DEBUG) #if defined(DEBUG)
// Use an error checking mutex in debug mode. // Use an error checking mutex in debug mode.
...@@ -55,7 +55,7 @@ static V8_INLINE(void InitializeNativeHandle(pthread_mutex_t* mutex)) { ...@@ -55,7 +55,7 @@ static V8_INLINE(void InitializeNativeHandle(pthread_mutex_t* mutex)) {
} }
static V8_INLINE(void InitializeRecursiveNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE void InitializeRecursiveNativeHandle(pthread_mutex_t* mutex) {
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
int result = pthread_mutexattr_init(&attr); int result = pthread_mutexattr_init(&attr);
ASSERT_EQ(0, result); ASSERT_EQ(0, result);
...@@ -69,28 +69,28 @@ static V8_INLINE(void InitializeRecursiveNativeHandle(pthread_mutex_t* mutex)) { ...@@ -69,28 +69,28 @@ static V8_INLINE(void InitializeRecursiveNativeHandle(pthread_mutex_t* mutex)) {
} }
static V8_INLINE(void DestroyNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE void DestroyNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_destroy(mutex); int result = pthread_mutex_destroy(mutex);
ASSERT_EQ(0, result); ASSERT_EQ(0, result);
USE(result); USE(result);
} }
static V8_INLINE(void LockNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE void LockNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_lock(mutex); int result = pthread_mutex_lock(mutex);
ASSERT_EQ(0, result); ASSERT_EQ(0, result);
USE(result); USE(result);
} }
static V8_INLINE(void UnlockNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE void UnlockNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_unlock(mutex); int result = pthread_mutex_unlock(mutex);
ASSERT_EQ(0, result); ASSERT_EQ(0, result);
USE(result); USE(result);
} }
static V8_INLINE(bool TryLockNativeHandle(pthread_mutex_t* mutex)) { static V8_INLINE bool TryLockNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_trylock(mutex); int result = pthread_mutex_trylock(mutex);
if (result == EBUSY) { if (result == EBUSY) {
return false; return false;
...@@ -101,32 +101,32 @@ static V8_INLINE(bool TryLockNativeHandle(pthread_mutex_t* mutex)) { ...@@ -101,32 +101,32 @@ static V8_INLINE(bool TryLockNativeHandle(pthread_mutex_t* mutex)) {
#elif V8_OS_WIN #elif V8_OS_WIN
static V8_INLINE(void InitializeNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE void InitializeNativeHandle(PCRITICAL_SECTION cs) {
InitializeCriticalSection(cs); InitializeCriticalSection(cs);
} }
static V8_INLINE(void InitializeRecursiveNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE void InitializeRecursiveNativeHandle(PCRITICAL_SECTION cs) {
InitializeCriticalSection(cs); InitializeCriticalSection(cs);
} }
static V8_INLINE(void DestroyNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE void DestroyNativeHandle(PCRITICAL_SECTION cs) {
DeleteCriticalSection(cs); DeleteCriticalSection(cs);
} }
static V8_INLINE(void LockNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE void LockNativeHandle(PCRITICAL_SECTION cs) {
EnterCriticalSection(cs); EnterCriticalSection(cs);
} }
static V8_INLINE(void UnlockNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE void UnlockNativeHandle(PCRITICAL_SECTION cs) {
LeaveCriticalSection(cs); LeaveCriticalSection(cs);
} }
static V8_INLINE(bool TryLockNativeHandle(PCRITICAL_SECTION cs)) { static V8_INLINE bool TryLockNativeHandle(PCRITICAL_SECTION cs) {
return TryEnterCriticalSection(cs); return TryEnterCriticalSection(cs);
} }
......
...@@ -94,14 +94,14 @@ class Mutex V8_FINAL { ...@@ -94,14 +94,14 @@ class Mutex V8_FINAL {
int level_; int level_;
#endif #endif
V8_INLINE(void AssertHeldAndUnmark()) { V8_INLINE void AssertHeldAndUnmark() {
#ifdef DEBUG #ifdef DEBUG
ASSERT_EQ(1, level_); ASSERT_EQ(1, level_);
level_--; level_--;
#endif #endif
} }
V8_INLINE(void AssertUnheldAndMark()) { V8_INLINE void AssertUnheldAndMark() {
#ifdef DEBUG #ifdef DEBUG
ASSERT_EQ(0, level_); ASSERT_EQ(0, level_);
level_++; level_++;
......
...@@ -66,7 +66,7 @@ class Socket V8_FINAL { ...@@ -66,7 +66,7 @@ class Socket V8_FINAL {
// Set the value of the SO_REUSEADDR socket option. // Set the value of the SO_REUSEADDR socket option.
bool SetReuseAddress(bool reuse_address); bool SetReuseAddress(bool reuse_address);
V8_INLINE(bool IsValid()) const { V8_INLINE bool IsValid() const {
return native_handle_ != kInvalidNativeHandle; return native_handle_ != kInvalidNativeHandle;
} }
......
...@@ -54,7 +54,7 @@ namespace internal { ...@@ -54,7 +54,7 @@ namespace internal {
class RandomAddressGenerator V8_FINAL { class RandomAddressGenerator V8_FINAL {
public: public:
V8_INLINE(uintptr_t NextAddress()) { V8_INLINE uintptr_t NextAddress() {
LockGuard<Mutex> lock_guard(&mutex_); LockGuard<Mutex> lock_guard(&mutex_);
uintptr_t address = rng_.NextInt(); uintptr_t address = rng_.NextInt();
#if V8_HOST_ARCH_64_BIT #if V8_HOST_ARCH_64_BIT
...@@ -75,7 +75,7 @@ typedef LazyInstance<RandomAddressGenerator, ...@@ -75,7 +75,7 @@ typedef LazyInstance<RandomAddressGenerator,
#define LAZY_RANDOM_ADDRESS_GENERATOR_INITIALIZER LAZY_INSTANCE_INITIALIZER #define LAZY_RANDOM_ADDRESS_GENERATOR_INITIALIZER LAZY_INSTANCE_INITIALIZER
static V8_INLINE(void* GenerateRandomAddress()) { static V8_INLINE void* GenerateRandomAddress() {
#if V8_OS_NACL #if V8_OS_NACL
// TODO(bradchen): Restore randomization once Native Client gets smarter // TODO(bradchen): Restore randomization once Native Client gets smarter
// about using mmap address hints. // about using mmap address hints.
......
...@@ -193,7 +193,7 @@ class VirtualMemory V8_FINAL { ...@@ -193,7 +193,7 @@ class VirtualMemory V8_FINAL {
// Returns true if OS performs lazy commits, i.e. the memory allocation call // Returns true if OS performs lazy commits, i.e. the memory allocation call
// defers actual physical memory allocation till the first memory access. // defers actual physical memory allocation till the first memory access.
// Otherwise returns false. // Otherwise returns false.
static V8_INLINE(bool HasLazyCommits()) { static V8_INLINE bool HasLazyCommits() {
#if V8_OS_LINUX #if V8_OS_LINUX
return true; return true;
#else #else
......
...@@ -1092,7 +1092,7 @@ class MemoryAllocator { ...@@ -1092,7 +1092,7 @@ class MemoryAllocator {
// Returns an indication of whether a pointer is in a space that has // Returns an indication of whether a pointer is in a space that has
// been allocated by this MemoryAllocator. // been allocated by this MemoryAllocator.
V8_INLINE(bool IsOutsideAllocatedSpace(const void* address)) const { V8_INLINE bool IsOutsideAllocatedSpace(const void* address) const {
return address < lowest_ever_allocated_ || return address < lowest_ever_allocated_ ||
address >= highest_ever_allocated_; address >= highest_ever_allocated_;
} }
......
...@@ -59,7 +59,7 @@ class RandomNumberGenerator V8_FINAL { ...@@ -59,7 +59,7 @@ class RandomNumberGenerator V8_FINAL {
// that one int value is pseudorandomly generated and returned. // that one int value is pseudorandomly generated and returned.
// All 2^32 possible integer values are produced with (approximately) equal // All 2^32 possible integer values are produced with (approximately) equal
// probability. // probability.
V8_INLINE(int NextInt()) V8_WARN_UNUSED_RESULT { V8_INLINE int NextInt() V8_WARN_UNUSED_RESULT {
return Next(32); return Next(32);
} }
...@@ -76,7 +76,7 @@ class RandomNumberGenerator V8_FINAL { ...@@ -76,7 +76,7 @@ class RandomNumberGenerator V8_FINAL {
// |NextBoolean()| is that one boolean value is pseudorandomly generated and // |NextBoolean()| is that one boolean value is pseudorandomly generated and
// returned. The values true and false are produced with (approximately) equal // returned. The values true and false are produced with (approximately) equal
// probability. // probability.
V8_INLINE(bool NextBool()) V8_WARN_UNUSED_RESULT { V8_INLINE bool NextBool() V8_WARN_UNUSED_RESULT {
return Next(1) != 0; return Next(1) != 0;
} }
......
...@@ -12670,8 +12670,8 @@ struct CopyablePersistentTraits { ...@@ -12670,8 +12670,8 @@ struct CopyablePersistentTraits {
typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent; typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
static const bool kResetInDestructor = true; static const bool kResetInDestructor = true;
template<class S, class M> template<class S, class M>
V8_INLINE(static void Copy(const Persistent<S, M>& source, static V8_INLINE void Copy(const Persistent<S, M>& source,
CopyablePersistent* dest)) { CopyablePersistent* dest) {
// do nothing, just allow copy // do nothing, just allow copy
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment