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

Side by Side Diff: src/objects.h

Issue 908213002: Use Cells to check prototype chain validity (disabled by default). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased onto dropped prototype_object Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 Handle<Object> value, 1824 Handle<Object> value,
1825 PropertyDetails details); 1825 PropertyDetails details);
1826 1826
1827 static void OptimizeAsPrototype(Handle<JSObject> object, 1827 static void OptimizeAsPrototype(Handle<JSObject> object,
1828 PrototypeOptimizationMode mode); 1828 PrototypeOptimizationMode mode);
1829 static void ReoptimizeIfPrototype(Handle<JSObject> object); 1829 static void ReoptimizeIfPrototype(Handle<JSObject> object);
1830 static void RegisterPrototypeUser(Handle<JSObject> prototype, 1830 static void RegisterPrototypeUser(Handle<JSObject> prototype,
1831 Handle<HeapObject> user); 1831 Handle<HeapObject> user);
1832 static void UnregisterPrototypeUser(Handle<JSObject> prototype, 1832 static void UnregisterPrototypeUser(Handle<JSObject> prototype,
1833 Handle<HeapObject> user); 1833 Handle<HeapObject> user);
1834 static void InvalidatePrototypeChains(Map* map);
1834 1835
1835 // Retrieve interceptors. 1836 // Retrieve interceptors.
1836 InterceptorInfo* GetNamedInterceptor(); 1837 InterceptorInfo* GetNamedInterceptor();
1837 InterceptorInfo* GetIndexedInterceptor(); 1838 InterceptorInfo* GetIndexedInterceptor();
1838 1839
1839 // Used from JSReceiver. 1840 // Used from JSReceiver.
1840 MUST_USE_RESULT static Maybe<PropertyAttributes> 1841 MUST_USE_RESULT static Maybe<PropertyAttributes>
1841 GetPropertyAttributesWithInterceptor(Handle<JSObject> holder, 1842 GetPropertyAttributesWithInterceptor(Handle<JSObject> holder,
1842 Handle<Object> receiver, 1843 Handle<Object> receiver,
1843 Handle<Name> name); 1844 Handle<Name> name);
(...skipping 4134 matching lines...) Expand 10 before | Expand all | Expand 10 after
5978 inline FixedArrayBase* GetInitialElements(); 5979 inline FixedArrayBase* GetInitialElements();
5979 5980
5980 // [raw_transitions]: Provides access to the transitions storage field. 5981 // [raw_transitions]: Provides access to the transitions storage field.
5981 // Don't call set_raw_transitions() directly to overwrite transitions, use 5982 // Don't call set_raw_transitions() directly to overwrite transitions, use
5982 // the TransitionArray::ReplaceTransitions() wrapper instead! 5983 // the TransitionArray::ReplaceTransitions() wrapper instead!
5983 DECL_ACCESSORS(raw_transitions, Object) 5984 DECL_ACCESSORS(raw_transitions, Object)
5984 // [prototype_info]: Per-prototype metadata. Aliased with transitions 5985 // [prototype_info]: Per-prototype metadata. Aliased with transitions
5985 // (which prototype maps don't have). 5986 // (which prototype maps don't have).
5986 DECL_ACCESSORS(prototype_info, Object) 5987 DECL_ACCESSORS(prototype_info, Object)
5987 5988
5989 // [prototype chain validity cell]: Associated with a prototype object,
5990 // stored in that object's map's PrototypeInfo, indicates that prototype
5991 // chains through this object are currently valid. The cell will be
5992 // invalidated and replaced when the prototype chain changes.
5993 static Handle<Cell> GetOrCreatePrototypeChainValidityCell(Handle<Map> map,
5994 Isolate* isolate);
5995 static const int kPrototypeChainValid = 0;
5996 static const int kPrototypeChainInvalid = 1;
5997
5988 Map* FindRootMap(); 5998 Map* FindRootMap();
5989 Map* FindFieldOwner(int descriptor); 5999 Map* FindFieldOwner(int descriptor);
5990 6000
5991 inline int GetInObjectPropertyOffset(int index); 6001 inline int GetInObjectPropertyOffset(int index);
5992 6002
5993 int NumberOfFields(); 6003 int NumberOfFields();
5994 6004
5995 // TODO(ishell): candidate with JSObject::MigrateToMap(). 6005 // TODO(ishell): candidate with JSObject::MigrateToMap().
5996 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, 6006 bool InstancesNeedRewriting(Map* target, int target_number_of_fields,
5997 int target_inobject, int target_unused, 6007 int target_inobject, int target_unused,
(...skipping 5041 matching lines...) Expand 10 before | Expand all | Expand 10 after
11039 } else { 11049 } else {
11040 value &= ~(1 << bit_position); 11050 value &= ~(1 << bit_position);
11041 } 11051 }
11042 return value; 11052 return value;
11043 } 11053 }
11044 }; 11054 };
11045 11055
11046 } } // namespace v8::internal 11056 } } // namespace v8::internal
11047 11057
11048 #endif // V8_OBJECTS_H_ 11058 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698