Index: src/objects.h |
=================================================================== |
--- src/objects.h (revision 11658) |
+++ src/objects.h (working copy) |
@@ -1583,6 +1583,8 @@ |
MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(String* name, |
DeleteMode mode); |
+ MUST_USE_RESULT MaybeObject* OptimizeAsPrototype(); |
+ |
// Retrieve interceptors. |
InterceptorInfo* GetNamedInterceptor(); |
InterceptorInfo* GetIndexedInterceptor(); |
@@ -2053,7 +2055,7 @@ |
// Maximal number of fast properties for the JSObject. Used to |
// restrict the number of map transitions to avoid an explosion in |
// the number of maps for objects used as dictionaries. |
- inline int MaxFastProperties(); |
+ inline bool TooManyFastProperties(int properties); |
// Maximal number of elements (numbered 0 .. kMaxElementCount - 1). |
// Also maximal value of JSArray's length property. |
@@ -2075,7 +2077,8 @@ |
static const int kMaxUncheckedOldFastElementsLength = 500; |
static const int kInitialMaxFastElementArray = 100000; |
- static const int kMaxFastProperties = 12; |
+ static const int kFastPropertiesSoftLimit = 12; |
+ static const int kMaxFastProperties = 32; |
static const int kMaxInstanceSize = 255 * kPointerSize; |
// When extending the backing storage for property values, we increase |
// its size by more than the 1 entry necessary, so sequentially adding fields |
@@ -4663,9 +4666,16 @@ |
// behavior. If true, the map should never be modified, instead a clone |
// should be created and modified. |
inline void set_is_shared(bool value); |
- |
inline bool is_shared(); |
+ // Tells whether the map is used for an object that is a prototype for another |
+ // object or is the prototype on a function. Such maps are made faster by |
+ // tweaking the heuristics that distinguish between regular object-oriented |
+ // objects and the objects that are being used as hash maps. This flag is |
+ // for optimization, not correctness. |
+ inline void set_used_for_prototype(bool value); |
+ inline bool used_for_prototype(); |
+ |
// Tells whether the instance needs security checks when accessing its |
// properties. |
inline void set_is_access_check_needed(bool access_check_needed); |
@@ -4856,7 +4866,7 @@ |
static const int kMaxCachedPrototypeTransitions = 256; |
- Object* GetPrototypeTransition(Object* prototype); |
+ Map* GetPrototypeTransition(Object* prototype); |
Michael Starzinger
2012/05/30 14:08:03
I know this is not part of this CL, but can we add
Erik Corry
2012/05/30 15:24:13
Done.
|
MUST_USE_RESULT MaybeObject* PutPrototypeTransition(Object* prototype, |
Map* map); |
@@ -4949,6 +4959,7 @@ |
// Bit positions for bit field 3 |
static const int kIsShared = 0; |
static const int kFunctionWithPrototype = 1; |
+ static const int kUsedForPrototype = 2; |
// Layout of the default cache. It holds alternating name and code objects. |
static const int kCodeCacheEntrySize = 2; |