OLD | NEW |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 template <class T> class Handle; | 143 template <class T> class Handle; |
144 template <class T> class Local; | 144 template <class T> class Local; |
145 template <class T> class Persistent; | 145 template <class T> class Persistent; |
146 | 146 |
147 namespace internal { | 147 namespace internal { |
148 class Arguments; | 148 class Arguments; |
149 class Heap; | 149 class Heap; |
150 class HeapObject; | 150 class HeapObject; |
151 class Isolate; | 151 class Isolate; |
152 class Object; | 152 class Object; |
| 153 class LookupCache; |
153 } | 154 } |
154 | 155 |
155 | 156 |
156 /** | 157 /** |
157 * General purpose unique identifier. | 158 * General purpose unique identifier. |
158 */ | 159 */ |
159 class UniqueId { | 160 class UniqueId { |
160 public: | 161 public: |
161 explicit UniqueId(intptr_t data) | 162 explicit UniqueId(intptr_t data) |
162 : data_(data) {} | 163 : data_(data) {} |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 ALL_CAN_WRITE = 1 << 1, | 1676 ALL_CAN_WRITE = 1 << 1, |
1676 PROHIBITS_OVERWRITING = 1 << 2 | 1677 PROHIBITS_OVERWRITING = 1 << 2 |
1677 }; | 1678 }; |
1678 | 1679 |
1679 | 1680 |
1680 /** | 1681 /** |
1681 * A JavaScript object (ECMA-262, 4.3.3) | 1682 * A JavaScript object (ECMA-262, 4.3.3) |
1682 */ | 1683 */ |
1683 class V8EXPORT Object : public Value { | 1684 class V8EXPORT Object : public Value { |
1684 public: | 1685 public: |
| 1686 class V8EXPORT CachedProperty { |
| 1687 public: |
| 1688 explicit CachedProperty(Handle<String> key); |
| 1689 |
| 1690 protected: |
| 1691 internal::LookupCache* cache_; |
| 1692 Persistent<String> key_; |
| 1693 |
| 1694 friend class Object; |
| 1695 }; |
| 1696 |
1685 bool Set(Handle<Value> key, | 1697 bool Set(Handle<Value> key, |
1686 Handle<Value> value, | 1698 Handle<Value> value, |
1687 PropertyAttribute attribs = None); | 1699 PropertyAttribute attribs = None); |
1688 | 1700 |
1689 bool Set(uint32_t index, Handle<Value> value); | 1701 bool Set(uint32_t index, Handle<Value> value); |
1690 | 1702 |
| 1703 bool Set(CachedProperty key, |
| 1704 Handle<Value> value, |
| 1705 PropertyAttribute attribs = None); |
| 1706 |
1691 // Sets a local property on this object bypassing interceptors and | 1707 // Sets a local property on this object bypassing interceptors and |
1692 // overriding accessors or read-only properties. | 1708 // overriding accessors or read-only properties. |
1693 // | 1709 // |
1694 // Note that if the object has an interceptor the property will be set | 1710 // Note that if the object has an interceptor the property will be set |
1695 // locally, but since the interceptor takes precedence the local property | 1711 // locally, but since the interceptor takes precedence the local property |
1696 // will only be returned if the interceptor doesn't return a value. | 1712 // will only be returned if the interceptor doesn't return a value. |
1697 // | 1713 // |
1698 // Note also that this only works for named properties. | 1714 // Note also that this only works for named properties. |
1699 bool ForceSet(Handle<Value> key, | 1715 bool ForceSet(Handle<Value> key, |
1700 Handle<Value> value, | 1716 Handle<Value> value, |
1701 PropertyAttribute attribs = None); | 1717 PropertyAttribute attribs = None); |
1702 | 1718 |
1703 Local<Value> Get(Handle<Value> key); | 1719 Local<Value> Get(Handle<Value> key); |
1704 | 1720 |
1705 Local<Value> Get(uint32_t index); | 1721 Local<Value> Get(uint32_t index); |
1706 | 1722 |
| 1723 Local<Value> Get(CachedProperty key); |
| 1724 |
1707 /** | 1725 /** |
1708 * Gets the property attributes of a property which can be None or | 1726 * Gets the property attributes of a property which can be None or |
1709 * any combination of ReadOnly, DontEnum and DontDelete. Returns | 1727 * any combination of ReadOnly, DontEnum and DontDelete. Returns |
1710 * None when the property doesn't exist. | 1728 * None when the property doesn't exist. |
1711 */ | 1729 */ |
1712 PropertyAttribute GetPropertyAttributes(Handle<Value> key); | 1730 PropertyAttribute GetPropertyAttributes(Handle<Value> key); |
1713 | 1731 |
1714 bool Has(Handle<Value> key); | 1732 bool Has(Handle<Value> key); |
1715 | 1733 |
1716 bool Delete(Handle<Value> key); | 1734 bool Delete(Handle<Value> key); |
(...skipping 3626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5343 | 5361 |
5344 | 5362 |
5345 } // namespace v8 | 5363 } // namespace v8 |
5346 | 5364 |
5347 | 5365 |
5348 #undef V8EXPORT | 5366 #undef V8EXPORT |
5349 #undef TYPE_CHECK | 5367 #undef TYPE_CHECK |
5350 | 5368 |
5351 | 5369 |
5352 #endif // V8_H_ | 5370 #endif // V8_H_ |
OLD | NEW |