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

Side by Side Diff: src/objects.h

Issue 11338048: Handle Object.observe notifications for setting Array.length (Closed) Base URL: git@github.com:rafaelw/v8@master
Patch Set: Merged with trunk Created 8 years, 1 month 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 // 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 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 static const int kElementsOffset = kPropertiesOffset + kPointerSize; 2201 static const int kElementsOffset = kPropertiesOffset + kPointerSize;
2202 static const int kHeaderSize = kElementsOffset + kPointerSize; 2202 static const int kHeaderSize = kElementsOffset + kPointerSize;
2203 2203
2204 STATIC_CHECK(kHeaderSize == Internals::kJSObjectHeaderSize); 2204 STATIC_CHECK(kHeaderSize == Internals::kJSObjectHeaderSize);
2205 2205
2206 class BodyDescriptor : public FlexibleBodyDescriptor<kPropertiesOffset> { 2206 class BodyDescriptor : public FlexibleBodyDescriptor<kPropertiesOffset> {
2207 public: 2207 public:
2208 static inline int SizeOf(Map* map, HeapObject* object); 2208 static inline int SizeOf(Map* map, HeapObject* object);
2209 }; 2209 };
2210 2210
2211 // Enqueue change record for Object.observe. May cause GC.
2212 static void EnqueueChangeRecord(Handle<JSObject> object,
2213 const char* type,
2214 Handle<String> name,
2215 Handle<Object> old_value);
2216
2211 private: 2217 private:
2212 friend class DictionaryElementsAccessor; 2218 friend class DictionaryElementsAccessor;
2213 2219
2214 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, 2220 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
2215 Object* structure, 2221 Object* structure,
2216 uint32_t index, 2222 uint32_t index,
2217 Object* holder); 2223 Object* holder);
2218 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( 2224 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor(
2219 JSReceiver* receiver, 2225 JSReceiver* receiver,
2220 uint32_t index, 2226 uint32_t index,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 // for hidden properties. If there is no backing store, allocate one. 2312 // for hidden properties. If there is no backing store, allocate one.
2307 // If create_if_absent is false, return the hash table backing store 2313 // If create_if_absent is false, return the hash table backing store
2308 // or the inline stored identity hash, whatever is found. 2314 // or the inline stored identity hash, whatever is found.
2309 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( 2315 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable(
2310 InitializeHiddenProperties init_option); 2316 InitializeHiddenProperties init_option);
2311 // Set the hidden property backing store to either a hash table or 2317 // Set the hidden property backing store to either a hash table or
2312 // the inline-stored identity hash. 2318 // the inline-stored identity hash.
2313 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( 2319 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable(
2314 Object* value); 2320 Object* value);
2315 2321
2316 // Enqueue change record for Object.observe. May cause GC.
2317 void EnqueueChangeRecord(const char* type,
2318 Handle<String> name,
2319 Handle<Object> old_value);
2320
2321 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); 2322 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject);
2322 }; 2323 };
2323 2324
2324 2325
2325 // Common superclass for FixedArrays that allow implementations to share 2326 // Common superclass for FixedArrays that allow implementations to share
2326 // common accessors and some code paths. 2327 // common accessors and some code paths.
2327 class FixedArrayBase: public HeapObject { 2328 class FixedArrayBase: public HeapObject {
2328 public: 2329 public:
2329 // [length]: length of the array. 2330 // [length]: length of the array.
2330 inline int length(); 2331 inline int length();
(...skipping 6705 matching lines...) Expand 10 before | Expand all | Expand 10 after
9036 } else { 9037 } else {
9037 value &= ~(1 << bit_position); 9038 value &= ~(1 << bit_position);
9038 } 9039 }
9039 return value; 9040 return value;
9040 } 9041 }
9041 }; 9042 };
9042 9043
9043 } } // namespace v8::internal 9044 } } // namespace v8::internal
9044 9045
9045 #endif // V8_OBJECTS_H_ 9046 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698