Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 inline AllocationSpace allocation_space() const; | 805 inline AllocationSpace allocation_space() const; |
| 806 | 806 |
| 807 // Returns the number of bytes requested (up to the representable maximum) | 807 // Returns the number of bytes requested (up to the representable maximum) |
| 808 // for RetryAfterGC failures. | 808 // for RetryAfterGC failures. |
| 809 inline int requested() const; | 809 inline int requested() const; |
| 810 | 810 |
| 811 inline bool IsInternalError() const; | 811 inline bool IsInternalError() const; |
| 812 inline bool IsOutOfMemoryException() const; | 812 inline bool IsOutOfMemoryException() const; |
| 813 | 813 |
| 814 static Failure* RetryAfterGC(int requested_bytes, AllocationSpace space); | 814 static Failure* RetryAfterGC(int requested_bytes, AllocationSpace space); |
| 815 static inline Failure* RetryAfterGC(int requested_bytes); // NEW_SPACE | |
|
Kasper Lund
2008/10/22 08:17:21
How about renaming this to avoid the overloading?
| |
| 815 static inline Failure* Exception(); | 816 static inline Failure* Exception(); |
| 816 static inline Failure* InternalError(); | 817 static inline Failure* InternalError(); |
| 817 static inline Failure* OutOfMemoryException(); | 818 static inline Failure* OutOfMemoryException(); |
| 818 // Casting. | 819 // Casting. |
| 819 static inline Failure* cast(Object* object); | 820 static inline Failure* cast(Object* object); |
| 820 | 821 |
| 821 // Dispatched behavior. | 822 // Dispatched behavior. |
| 822 void FailurePrint(); | 823 void FailurePrint(); |
| 823 void FailurePrint(StringStream* accumulator); | 824 void FailurePrint(StringStream* accumulator); |
| 824 #ifdef DEBUG | 825 #ifdef DEBUG |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 989 // Iterates over all pointers contained in the object except the | 990 // Iterates over all pointers contained in the object except the |
| 990 // first map pointer. The object type is given in the first | 991 // first map pointer. The object type is given in the first |
| 991 // parameter. This function does not access the map pointer in the | 992 // parameter. This function does not access the map pointer in the |
| 992 // object, and so is safe to call while the map pointer is modified. | 993 // object, and so is safe to call while the map pointer is modified. |
| 993 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); | 994 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); |
| 994 | 995 |
| 995 // This method only applies to struct objects. Iterates over all the fields | 996 // This method only applies to struct objects. Iterates over all the fields |
| 996 // of this struct. | 997 // of this struct. |
| 997 void IterateStructBody(int object_size, ObjectVisitor* v); | 998 void IterateStructBody(int object_size, ObjectVisitor* v); |
| 998 | 999 |
| 999 // Copy the body from the 'from' object to this. | |
| 1000 // Please note the two object must have the same map prior to the call. | |
| 1001 inline void CopyBody(JSObject* from); | |
| 1002 | |
| 1003 // Returns the heap object's size in bytes | 1000 // Returns the heap object's size in bytes |
| 1004 inline int Size(); | 1001 inline int Size(); |
| 1005 | 1002 |
| 1006 // Given a heap object's map pointer, returns the heap size in bytes | 1003 // Given a heap object's map pointer, returns the heap size in bytes |
| 1007 // Useful when the map pointer field is used for other purposes. | 1004 // Useful when the map pointer field is used for other purposes. |
| 1008 // GC internal. | 1005 // GC internal. |
| 1009 inline int SizeFromMap(Map* map); | 1006 inline int SizeFromMap(Map* map); |
| 1010 | 1007 |
| 1011 // Support for the marking heap objects during the marking phase of GC. | 1008 // Support for the marking heap objects during the marking phase of GC. |
| 1012 // True if the object is marked live. | 1009 // True if the object is marked live. |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1246 Object* SetElementsLength(Object* length); | 1243 Object* SetElementsLength(Object* length); |
| 1247 | 1244 |
| 1248 // Get the header size for a JSObject. Used to compute the index of | 1245 // Get the header size for a JSObject. Used to compute the index of |
| 1249 // internal fields as well as the number of internal fields. | 1246 // internal fields as well as the number of internal fields. |
| 1250 inline int GetHeaderSize(); | 1247 inline int GetHeaderSize(); |
| 1251 | 1248 |
| 1252 inline int GetInternalFieldCount(); | 1249 inline int GetInternalFieldCount(); |
| 1253 inline Object* GetInternalField(int index); | 1250 inline Object* GetInternalField(int index); |
| 1254 inline void SetInternalField(int index, Object* value); | 1251 inline void SetInternalField(int index, Object* value); |
| 1255 | 1252 |
| 1256 // Returns a deep copy of the JavaScript object. | |
| 1257 // Properties and elements are copied too. | |
| 1258 // Returns failure if allocation failed. | |
| 1259 Object* Copy(PretenureFlag pretenure = NOT_TENURED); | |
| 1260 | |
| 1261 // Lookup a property. If found, the result is valid and has | 1253 // Lookup a property. If found, the result is valid and has |
| 1262 // detailed information. | 1254 // detailed information. |
| 1263 void LocalLookup(String* name, LookupResult* result); | 1255 void LocalLookup(String* name, LookupResult* result); |
| 1264 void Lookup(String* name, LookupResult* result); | 1256 void Lookup(String* name, LookupResult* result); |
| 1265 | 1257 |
| 1266 // The following lookup functions skip interceptors. | 1258 // The following lookup functions skip interceptors. |
| 1267 void LocalLookupRealNamedProperty(String* name, LookupResult* result); | 1259 void LocalLookupRealNamedProperty(String* name, LookupResult* result); |
| 1268 void LookupRealNamedProperty(String* name, LookupResult* result); | 1260 void LookupRealNamedProperty(String* name, LookupResult* result); |
| 1269 void LookupRealNamedPropertyInPrototypes(String* name, LookupResult* result); | 1261 void LookupRealNamedPropertyInPrototypes(String* name, LookupResult* result); |
| 1270 void LookupCallbackSetterInPrototypes(String* name, LookupResult* result); | 1262 void LookupCallbackSetterInPrototypes(String* name, LookupResult* result); |
| (...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4056 } else { | 4048 } else { |
| 4057 value &= ~(1 << bit_position); | 4049 value &= ~(1 << bit_position); |
| 4058 } | 4050 } |
| 4059 return value; | 4051 return value; |
| 4060 } | 4052 } |
| 4061 }; | 4053 }; |
| 4062 | 4054 |
| 4063 } } // namespace v8::internal | 4055 } } // namespace v8::internal |
| 4064 | 4056 |
| 4065 #endif // V8_OBJECTS_H_ | 4057 #endif // V8_OBJECTS_H_ |
| OLD | NEW |