Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: src/objects.h

Issue 351573002: Make Object::IsFoo const. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index df57f6eaa1db925aaf3565181835de01ea3c24ab..a88beed93b02e19cdee5423486950a964bfe09b7 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1352,48 +1352,49 @@ const char* GetBailoutReason(BailoutReason reason);
class Object {
public:
// Type testing.
- bool IsObject() { return true; }
+ bool IsObject() const { return true; }
-#define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_();
+#define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const);
OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
#undef IS_TYPE_FUNCTION_DECL
- inline bool IsFixedArrayBase();
- inline bool IsExternal();
- inline bool IsAccessorInfo();
+ INLINE(bool IsFixedArrayBase() const);
+ INLINE(bool IsExternal() const);
+ INLINE(bool IsAccessorInfo() const);
- inline bool IsStruct();
-#define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name();
+ INLINE(bool IsStruct() const);
+#define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \
+ INLINE(bool Is##Name() const);
STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
#undef DECLARE_STRUCT_PREDICATE
- INLINE(bool IsSpecObject());
- INLINE(bool IsSpecFunction());
- INLINE(bool IsTemplateInfo());
- INLINE(bool IsNameDictionary());
- INLINE(bool IsSeededNumberDictionary());
- INLINE(bool IsUnseededNumberDictionary());
- INLINE(bool IsOrderedHashSet());
- INLINE(bool IsOrderedHashMap());
- bool IsCallable();
+ INLINE(bool IsSpecObject()) const;
+ INLINE(bool IsSpecFunction()) const;
+ INLINE(bool IsTemplateInfo()) const;
+ INLINE(bool IsNameDictionary() const);
+ INLINE(bool IsSeededNumberDictionary() const);
+ INLINE(bool IsUnseededNumberDictionary() const);
+ INLINE(bool IsOrderedHashSet() const);
+ INLINE(bool IsOrderedHashMap() const);
+ bool IsCallable() const;
// Oddball testing.
- INLINE(bool IsUndefined());
- INLINE(bool IsNull());
- INLINE(bool IsTheHole());
- INLINE(bool IsException());
- INLINE(bool IsUninitialized());
- INLINE(bool IsTrue());
- INLINE(bool IsFalse());
- inline bool IsArgumentsMarker();
+ INLINE(bool IsUndefined() const);
+ INLINE(bool IsNull() const);
+ INLINE(bool IsTheHole() const);
+ INLINE(bool IsException() const);
+ INLINE(bool IsUninitialized() const);
+ INLINE(bool IsTrue() const);
+ INLINE(bool IsFalse() const);
+ INLINE(bool IsArgumentsMarker() const);
// Filler objects (fillers and free space objects).
- inline bool IsFiller();
+ INLINE(bool IsFiller() const);
// Extract the number.
inline double Number();
- inline bool IsNaN();
+ INLINE(bool IsNaN() const);
bool ToInt32(int32_t* value);
bool ToUint32(uint32_t* value);
@@ -1682,10 +1683,10 @@ class HeapObject: public Object {
inline void set_map_word(MapWord map_word);
// The Heap the object was allocated in. Used also to access Isolate.
- inline Heap* GetHeap() const;
+ INLINE(Heap* GetHeap() const);
Michael Starzinger 2014/06/23 20:10:27 Is there a particular system or reason behind whic
Sven Panne 2014/06/24 06:10:23 The system was simply: Change every signature wher
// Convenience method to get current isolate.
- inline Isolate* GetIsolate();
+ INLINE(Isolate* GetIsolate() const);
// Converts an address to a HeapObject pointer.
static inline HeapObject* FromAddress(Address address);
@@ -1815,7 +1816,7 @@ class FlexibleBodyDescriptor {
class HeapNumber: public HeapObject {
public:
// [value]: number value.
- inline double value();
+ INLINE(double value() const);
Michael Starzinger 2014/06/23 20:10:27 Especially this one looks pretty random at first g
Sven Panne 2014/06/24 06:10:23 Rationale: See above.
inline void set_value(double value);
DECLARE_CAST(HeapNumber)
@@ -1971,7 +1972,7 @@ class JSReceiver: public HeapObject {
uint32_t index);
// Return the object's prototype (might be Heap::null_value()).
- inline Object* GetPrototype();
+ INLINE(Object* GetPrototype() const);
// Return the constructor function (may be Heap::null_value()).
inline Object* GetConstructor();
@@ -4780,7 +4781,7 @@ class NormalizedMapCache: public FixedArray {
DECLARE_CAST(NormalizedMapCache)
- static inline bool IsNormalizedMapCache(Object* obj);
+ INLINE(static bool IsNormalizedMapCache(const Object* obj));
DECLARE_VERIFIER(NormalizedMapCache)
private:
@@ -7808,7 +7809,7 @@ class JSGlobalProxy : public JSObject {
DECLARE_CAST(JSGlobalProxy)
- inline bool IsDetachedFrom(GlobalObject* global);
+ INLINE(bool IsDetachedFrom(GlobalObject* global) const);
// Dispatched behavior.
DECLARE_PRINTER(JSGlobalProxy)
@@ -8804,7 +8805,7 @@ class StringHasher {
// concrete performance benefit at that particular point in the code.
class StringShape BASE_EMBEDDED {
public:
- inline explicit StringShape(String* s);
+ INLINE(explicit StringShape(const String* s));
inline explicit StringShape(Map* s);
inline explicit StringShape(InstanceType t);
inline bool IsSequential();
@@ -9063,8 +9064,8 @@ class String: public Name {
// be ASCII encoded. This might be the case even if the string is
// two-byte. Such strings may appear when the embedder prefers
// two-byte external representations even for ASCII data.
- inline bool IsOneByteRepresentation();
- inline bool IsTwoByteRepresentation();
+ INLINE(bool IsOneByteRepresentation() const);
+ INLINE(bool IsTwoByteRepresentation() const);
// Cons and slices have an encoding flag that may not represent the actual
// encoding of the underlying string. This is taken into account here.
@@ -9732,7 +9733,7 @@ class Oddball: public HeapObject {
// [to_number]: Cached to_number computed at startup.
DECL_ACCESSORS(to_number, Object)
- inline byte kind();
+ INLINE(byte kind() const);
inline void set_kind(byte kind);
DECLARE_CAST(Oddball)
« no previous file with comments | « src/api.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698