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

Side by Side Diff: src/objects.h

Issue 1368753003: Add C++ implementation of Object.defineProperties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: preview -- needs refactoring Created 5 years, 2 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
« no previous file with comments | « src/lookup.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 // Retrieves a permanent object identity hash code. The undefined value might 1820 // Retrieves a permanent object identity hash code. The undefined value might
1821 // be returned in case no hash was created yet. 1821 // be returned in case no hash was created yet.
1822 inline Object* GetIdentityHash(); 1822 inline Object* GetIdentityHash();
1823 1823
1824 // Retrieves a permanent object identity hash code. May create and store a 1824 // Retrieves a permanent object identity hash code. May create and store a
1825 // hash code if needed and none exists. 1825 // hash code if needed and none exists.
1826 inline static Handle<Smi> GetOrCreateIdentityHash( 1826 inline static Handle<Smi> GetOrCreateIdentityHash(
1827 Handle<JSReceiver> object); 1827 Handle<JSReceiver> object);
1828 1828
1829 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS }; 1829 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS };
1830 enum IncludeSymbolNamedProperties { SKIP_SYMBOLS, INCLUDE_SYMBOLS };
1830 1831
1831 // Computes the enumerable keys for a JSObject. Used for implementing 1832 // Computes the enumerable keys for a JSObject. Used for implementing
1832 // "for (n in object) { }". 1833 // "for (n in object) { }".
1833 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( 1834 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys(
1834 Handle<JSReceiver> object, 1835 Handle<JSReceiver> object, KeyCollectionType type,
1835 KeyCollectionType type); 1836 IncludeSymbolNamedProperties include_symbols = SKIP_SYMBOLS);
1836 1837
1837 private: 1838 private:
1838 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); 1839 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
1839 }; 1840 };
1840 1841
1841 1842
1842 // The JSObject describes real heap allocated JavaScript objects with 1843 // The JSObject describes real heap allocated JavaScript objects with
1843 // properties. 1844 // properties.
1844 // Note that the map of JSObject changes during execution to enable inline 1845 // Note that the map of JSObject changes during execution to enable inline
1845 // caching. 1846 // caching.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 // Retrieves an AccessorPair property from the given object. Might return 2024 // Retrieves an AccessorPair property from the given object. Might return
2024 // undefined if the property doesn't exist or is of a different kind. 2025 // undefined if the property doesn't exist or is of a different kind.
2025 MUST_USE_RESULT static MaybeHandle<Object> GetAccessor( 2026 MUST_USE_RESULT static MaybeHandle<Object> GetAccessor(
2026 Handle<JSObject> object, 2027 Handle<JSObject> object,
2027 Handle<Name> name, 2028 Handle<Name> name,
2028 AccessorComponent component); 2029 AccessorComponent component);
2029 2030
2030 // Defines an AccessorPair property on the given object. 2031 // Defines an AccessorPair property on the given object.
2031 // TODO(mstarzinger): Rename to SetAccessor(). 2032 // TODO(mstarzinger): Rename to SetAccessor().
2032 static MaybeHandle<Object> DefineAccessor(Handle<JSObject> object, 2033 static MaybeHandle<Object> DefineAccessor(Handle<JSObject> object,
2033 Handle<Name> name, 2034 Handle<Object> name,
2034 Handle<Object> getter, 2035 Handle<Object> getter,
2035 Handle<Object> setter, 2036 Handle<Object> setter,
2036 PropertyAttributes attributes); 2037 PropertyAttributes attributes);
2037 2038
2038 // Defines an AccessorInfo property on the given object. 2039 // Defines an AccessorInfo property on the given object.
2039 MUST_USE_RESULT static MaybeHandle<Object> SetAccessor( 2040 MUST_USE_RESULT static MaybeHandle<Object> SetAccessor(
2040 Handle<JSObject> object, 2041 Handle<JSObject> object,
2041 Handle<AccessorInfo> info); 2042 Handle<AccessorInfo> info);
2042 2043
2043 // The result must be checked first for exceptions. If there's no exception, 2044 // The result must be checked first for exceptions. If there's no exception,
(...skipping 8528 matching lines...) Expand 10 before | Expand all | Expand 10 after
10572 10573
10573 Isolate* isolate_; 10574 Isolate* isolate_;
10574 Handle<FixedArray> keys_; 10575 Handle<FixedArray> keys_;
10575 Handle<OrderedHashSet> set_; 10576 Handle<OrderedHashSet> set_;
10576 int length_; 10577 int length_;
10577 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); 10578 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
10578 }; 10579 };
10579 } } // namespace v8::internal 10580 } } // namespace v8::internal
10580 10581
10581 #endif // V8_OBJECTS_H_ 10582 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/lookup.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698