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

Side by Side Diff: src/objects.h

Issue 467013003: Add interceptor support for symbols (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to filter out non-symbol keys from for-in enumeration Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/ic.cc ('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 "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assert-scope.h" 9 #include "src/assert-scope.h"
10 #include "src/builtins.h" 10 #include "src/builtins.h"
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 inline void FillWithHoles(int from, int to); 2791 inline void FillWithHoles(int from, int to);
2792 2792
2793 // Shrink length and insert filler objects. 2793 // Shrink length and insert filler objects.
2794 void Shrink(int length); 2794 void Shrink(int length);
2795 2795
2796 // Copy operation. 2796 // Copy operation.
2797 static Handle<FixedArray> CopySize(Handle<FixedArray> array, 2797 static Handle<FixedArray> CopySize(Handle<FixedArray> array,
2798 int new_length, 2798 int new_length,
2799 PretenureFlag pretenure = NOT_TENURED); 2799 PretenureFlag pretenure = NOT_TENURED);
2800 2800
2801 enum KeyFilter { ALL_KEYS, NON_SYMBOL_KEYS };
2802
2801 // Add the elements of a JSArray to this FixedArray. 2803 // Add the elements of a JSArray to this FixedArray.
2802 MUST_USE_RESULT static MaybeHandle<FixedArray> AddKeysFromArrayLike( 2804 MUST_USE_RESULT static MaybeHandle<FixedArray> AddKeysFromArrayLike(
2803 Handle<FixedArray> content, 2805 Handle<FixedArray> content, Handle<JSObject> array,
2804 Handle<JSObject> array); 2806 KeyFilter filter = ALL_KEYS);
2805 2807
2806 // Computes the union of keys and return the result. 2808 // Computes the union of keys and return the result.
2807 // Used for implementing "for (n in object) { }" 2809 // Used for implementing "for (n in object) { }"
2808 MUST_USE_RESULT static MaybeHandle<FixedArray> UnionOfKeys( 2810 MUST_USE_RESULT static MaybeHandle<FixedArray> UnionOfKeys(
2809 Handle<FixedArray> first, 2811 Handle<FixedArray> first,
2810 Handle<FixedArray> second); 2812 Handle<FixedArray> second);
2811 2813
2812 // Copy a sub array from the receiver to dest. 2814 // Copy a sub array from the receiver to dest.
2813 void CopyTo(int pos, FixedArray* dest, int dest_pos, int len); 2815 void CopyTo(int pos, FixedArray* dest, int dest_pos, int len);
2814 2816
(...skipping 7912 matching lines...) Expand 10 before | Expand all | Expand 10 after
10727 10729
10728 10730
10729 class InterceptorInfo: public Struct { 10731 class InterceptorInfo: public Struct {
10730 public: 10732 public:
10731 DECL_ACCESSORS(getter, Object) 10733 DECL_ACCESSORS(getter, Object)
10732 DECL_ACCESSORS(setter, Object) 10734 DECL_ACCESSORS(setter, Object)
10733 DECL_ACCESSORS(query, Object) 10735 DECL_ACCESSORS(query, Object)
10734 DECL_ACCESSORS(deleter, Object) 10736 DECL_ACCESSORS(deleter, Object)
10735 DECL_ACCESSORS(enumerator, Object) 10737 DECL_ACCESSORS(enumerator, Object)
10736 DECL_ACCESSORS(data, Object) 10738 DECL_ACCESSORS(data, Object)
10739 DECL_BOOLEAN_ACCESSORS(can_intercept_symbols)
10740
10741 // TODO(wingo): Remove flags field once all interceptors can intercept
10742 // symbols.
10743 inline int flags() const;
10744 inline void set_flags(int flags);
10737 10745
10738 DECLARE_CAST(InterceptorInfo) 10746 DECLARE_CAST(InterceptorInfo)
10739 10747
10740 // Dispatched behavior. 10748 // Dispatched behavior.
10741 DECLARE_PRINTER(InterceptorInfo) 10749 DECLARE_PRINTER(InterceptorInfo)
10742 DECLARE_VERIFIER(InterceptorInfo) 10750 DECLARE_VERIFIER(InterceptorInfo)
10743 10751
10744 static const int kGetterOffset = HeapObject::kHeaderSize; 10752 static const int kGetterOffset = HeapObject::kHeaderSize;
10745 static const int kSetterOffset = kGetterOffset + kPointerSize; 10753 static const int kSetterOffset = kGetterOffset + kPointerSize;
10746 static const int kQueryOffset = kSetterOffset + kPointerSize; 10754 static const int kQueryOffset = kSetterOffset + kPointerSize;
10747 static const int kDeleterOffset = kQueryOffset + kPointerSize; 10755 static const int kDeleterOffset = kQueryOffset + kPointerSize;
10748 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; 10756 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize;
10749 static const int kDataOffset = kEnumeratorOffset + kPointerSize; 10757 static const int kDataOffset = kEnumeratorOffset + kPointerSize;
10750 static const int kSize = kDataOffset + kPointerSize; 10758 static const int kFlagsOffset = kDataOffset + kPointerSize;
10759 static const int kSize = kFlagsOffset + kPointerSize;
10760
10761 static const int kCanInterceptSymbolsBit = 0;
10751 10762
10752 private: 10763 private:
10753 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); 10764 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo);
10754 }; 10765 };
10755 10766
10756 10767
10757 class CallHandlerInfo: public Struct { 10768 class CallHandlerInfo: public Struct {
10758 public: 10769 public:
10759 DECL_ACCESSORS(callback, Object) 10770 DECL_ACCESSORS(callback, Object)
10760 DECL_ACCESSORS(data, Object) 10771 DECL_ACCESSORS(data, Object)
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
11155 } else { 11166 } else {
11156 value &= ~(1 << bit_position); 11167 value &= ~(1 << bit_position);
11157 } 11168 }
11158 return value; 11169 return value;
11159 } 11170 }
11160 }; 11171 };
11161 11172
11162 } } // namespace v8::internal 11173 } } // namespace v8::internal
11163 11174
11164 #endif // V8_OBJECTS_H_ 11175 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698