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

Side by Side Diff: src/objects.h

Issue 11365111: Object.observe: generate change records for indexed properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments; added/fixed missing bits of new elements functionality. 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 | Annotate | Revision Log
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 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 1463
1464 // Returns the constructor name (the name (possibly, inferred name) of the 1464 // Returns the constructor name (the name (possibly, inferred name) of the
1465 // function that was used to instantiate the object). 1465 // function that was used to instantiate the object).
1466 String* constructor_name(); 1466 String* constructor_name();
1467 1467
1468 inline PropertyAttributes GetPropertyAttribute(String* name); 1468 inline PropertyAttributes GetPropertyAttribute(String* name);
1469 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver, 1469 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver,
1470 String* name); 1470 String* name);
1471 PropertyAttributes GetLocalPropertyAttribute(String* name); 1471 PropertyAttributes GetLocalPropertyAttribute(String* name);
1472 1472
1473 inline PropertyAttributes GetElementAttribute(uint32_t index);
1474 inline PropertyAttributes GetElementAttributeWithReceiver(
1475 JSReceiver* receiver,
1476 uint32_t index,
1477 bool continue_search);
1478 inline PropertyAttributes GetLocalElementAttribute(uint32_t index);
1479
1473 // Can cause a GC. 1480 // Can cause a GC.
1474 inline bool HasProperty(String* name); 1481 inline bool HasProperty(String* name);
1475 inline bool HasLocalProperty(String* name); 1482 inline bool HasLocalProperty(String* name);
1476 inline bool HasElement(uint32_t index); 1483 inline bool HasElement(uint32_t index);
1484 inline bool HasLocalElement(uint32_t index);
1477 1485
1478 // Return the object's prototype (might be Heap::null_value()). 1486 // Return the object's prototype (might be Heap::null_value()).
1479 inline Object* GetPrototype(); 1487 inline Object* GetPrototype();
1480 1488
1481 // Return the constructor function (may be Heap::null_value()). 1489 // Return the constructor function (may be Heap::null_value()).
1482 inline Object* GetConstructor(); 1490 inline Object* GetConstructor();
1483 1491
1484 // Set the object's prototype (only JSReceiver and null are allowed). 1492 // Set the object's prototype (only JSReceiver and null are allowed).
1485 MUST_USE_RESULT MaybeObject* SetPrototype(Object* value, 1493 MUST_USE_RESULT MaybeObject* SetPrototype(Object* value,
1486 bool skip_hidden_prototypes); 1494 bool skip_hidden_prototypes);
1487 1495
1488 // Retrieves a permanent object identity hash code. The undefined value might 1496 // Retrieves a permanent object identity hash code. The undefined value might
1489 // be returned in case no hash was created yet and OMIT_CREATION was used. 1497 // be returned in case no hash was created yet and OMIT_CREATION was used.
1490 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); 1498 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
1491 1499
1492 // Lookup a property. If found, the result is valid and has 1500 // Lookup a property. If found, the result is valid and has
1493 // detailed information. 1501 // detailed information.
1494 void LocalLookup(String* name, LookupResult* result); 1502 void LocalLookup(String* name, LookupResult* result);
1495 void Lookup(String* name, LookupResult* result); 1503 void Lookup(String* name, LookupResult* result);
1496 1504
1497 protected: 1505 protected:
1498 Smi* GenerateIdentityHash(); 1506 Smi* GenerateIdentityHash();
1499 1507
1500 private: 1508 private:
1501 PropertyAttributes GetPropertyAttribute(JSReceiver* receiver, 1509 PropertyAttributes GetPropertyAttributeForResult(JSReceiver* receiver,
1502 LookupResult* result, 1510 LookupResult* result,
1503 String* name, 1511 String* name,
1504 bool continue_search); 1512 bool continue_search);
1505 1513
1506 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); 1514 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
1507 }; 1515 };
1508 1516
1509 // The JSObject describes real heap allocated JavaScript objects with 1517 // The JSObject describes real heap allocated JavaScript objects with
1510 // properties. 1518 // properties.
1511 // Note that the map of JSObject changes during execution to enable inline 1519 // Note that the map of JSObject changes during execution to enable inline
1512 // caching. 1520 // caching.
1513 class JSObject: public JSReceiver { 1521 class JSObject: public JSReceiver {
1514 public: 1522 public:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 String* name, 1689 String* name,
1682 bool continue_search); 1690 bool continue_search);
1683 PropertyAttributes GetPropertyAttributeWithInterceptor(JSObject* receiver, 1691 PropertyAttributes GetPropertyAttributeWithInterceptor(JSObject* receiver,
1684 String* name, 1692 String* name,
1685 bool continue_search); 1693 bool continue_search);
1686 PropertyAttributes GetPropertyAttributeWithFailedAccessCheck( 1694 PropertyAttributes GetPropertyAttributeWithFailedAccessCheck(
1687 Object* receiver, 1695 Object* receiver,
1688 LookupResult* result, 1696 LookupResult* result,
1689 String* name, 1697 String* name,
1690 bool continue_search); 1698 bool continue_search);
1699 PropertyAttributes GetElementAttributeWithReceiver(JSReceiver* receiver,
1700 uint32_t index,
1701 bool continue_search);
1691 1702
1692 static void DefineAccessor(Handle<JSObject> object, 1703 static void DefineAccessor(Handle<JSObject> object,
1693 Handle<String> name, 1704 Handle<String> name,
1694 Handle<Object> getter, 1705 Handle<Object> getter,
1695 Handle<Object> setter, 1706 Handle<Object> setter,
1696 PropertyAttributes attributes); 1707 PropertyAttributes attributes);
1697 // Can cause GC. 1708 // Can cause GC.
1698 MUST_USE_RESULT MaybeObject* DefineAccessor(String* name, 1709 MUST_USE_RESULT MaybeObject* DefineAccessor(String* name,
1699 Object* getter, 1710 Object* getter,
1700 Object* setter, 1711 Object* setter,
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 static inline int SizeOf(Map* map, HeapObject* object); 2200 static inline int SizeOf(Map* map, HeapObject* object);
2190 }; 2201 };
2191 2202
2192 private: 2203 private:
2193 friend class DictionaryElementsAccessor; 2204 friend class DictionaryElementsAccessor;
2194 2205
2195 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, 2206 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
2196 Object* structure, 2207 Object* structure,
2197 uint32_t index, 2208 uint32_t index,
2198 Object* holder); 2209 Object* holder);
2210 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor(
2211 JSReceiver* receiver,
2212 uint32_t index,
2213 bool continue_search);
2214 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor(
2215 JSReceiver* receiver,
2216 uint32_t index,
2217 bool continue_search);
2199 MUST_USE_RESULT MaybeObject* SetElementWithCallback( 2218 MUST_USE_RESULT MaybeObject* SetElementWithCallback(
2200 Object* structure, 2219 Object* structure,
2201 uint32_t index, 2220 uint32_t index,
2202 Object* value, 2221 Object* value,
2203 JSObject* holder, 2222 JSObject* holder,
2204 StrictModeFlag strict_mode); 2223 StrictModeFlag strict_mode);
2205 MUST_USE_RESULT MaybeObject* SetElementWithInterceptor( 2224 MUST_USE_RESULT MaybeObject* SetElementWithInterceptor(
2206 uint32_t index, 2225 uint32_t index,
2207 Object* value, 2226 Object* value,
2208 PropertyAttributes attributes, 2227 PropertyAttributes attributes,
(...skipping 6766 matching lines...) Expand 10 before | Expand all | Expand 10 after
8975 } else { 8994 } else {
8976 value &= ~(1 << bit_position); 8995 value &= ~(1 << bit_position);
8977 } 8996 }
8978 return value; 8997 return value;
8979 } 8998 }
8980 }; 8999 };
8981 9000
8982 } } // namespace v8::internal 9001 } } // namespace v8::internal
8983 9002
8984 #endif // V8_OBJECTS_H_ 9003 #endif // V8_OBJECTS_H_
OLDNEW
« src/elements.cc ('K') | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698