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

Side by Side Diff: src/objects.h

Issue 906463002: add support for all can read interceptors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/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 <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 1942
1943 // Empty handle is returned if the element cannot be set to the given value. 1943 // Empty handle is returned if the element cannot be set to the given value.
1944 MUST_USE_RESULT static MaybeHandle<Object> SetElement( 1944 MUST_USE_RESULT static MaybeHandle<Object> SetElement(
1945 Handle<JSObject> object, uint32_t index, Handle<Object> value, 1945 Handle<JSObject> object, uint32_t index, Handle<Object> value,
1946 PropertyAttributes attributes, LanguageMode language_mode, 1946 PropertyAttributes attributes, LanguageMode language_mode,
1947 bool check_prototype = true, SetPropertyMode set_mode = SET_PROPERTY); 1947 bool check_prototype = true, SetPropertyMode set_mode = SET_PROPERTY);
1948 1948
1949 // Returns the index'th element. 1949 // Returns the index'th element.
1950 // The undefined object if index is out of bounds. 1950 // The undefined object if index is out of bounds.
1951 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithInterceptor( 1951 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithInterceptor(
1952 Handle<JSObject> object, 1952 Handle<JSObject> object, Handle<Object> receiver, uint32_t index,
1953 Handle<Object> receiver, 1953 bool check_prototype);
1954 uint32_t index);
1955 1954
1956 enum SetFastElementsCapacitySmiMode { 1955 enum SetFastElementsCapacitySmiMode {
1957 kAllowSmiElements, 1956 kAllowSmiElements,
1958 kForceSmiElements, 1957 kForceSmiElements,
1959 kDontAllowSmiElements 1958 kDontAllowSmiElements
1960 }; 1959 };
1961 1960
1962 // Replace the elements' backing store with fast elements of the given 1961 // Replace the elements' backing store with fast elements of the given
1963 // capacity. Update the length for JSArrays. Returns the new backing 1962 // capacity. Update the length for JSArrays. Returns the new backing
1964 // store. 1963 // store.
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 static MaybeHandle<Object> SetElementWithCallbackSetterInPrototypes( 2289 static MaybeHandle<Object> SetElementWithCallbackSetterInPrototypes(
2291 Handle<JSObject> object, uint32_t index, Handle<Object> value, 2290 Handle<JSObject> object, uint32_t index, Handle<Object> value,
2292 bool* found, LanguageMode language_mode); 2291 bool* found, LanguageMode language_mode);
2293 MUST_USE_RESULT static MaybeHandle<Object> SetDictionaryElement( 2292 MUST_USE_RESULT static MaybeHandle<Object> SetDictionaryElement(
2294 Handle<JSObject> object, uint32_t index, Handle<Object> value, 2293 Handle<JSObject> object, uint32_t index, Handle<Object> value,
2295 PropertyAttributes attributes, LanguageMode language_mode, 2294 PropertyAttributes attributes, LanguageMode language_mode,
2296 bool check_prototype, SetPropertyMode set_mode = SET_PROPERTY); 2295 bool check_prototype, SetPropertyMode set_mode = SET_PROPERTY);
2297 MUST_USE_RESULT static MaybeHandle<Object> SetFastDoubleElement( 2296 MUST_USE_RESULT static MaybeHandle<Object> SetFastDoubleElement(
2298 Handle<JSObject> object, uint32_t index, Handle<Object> value, 2297 Handle<JSObject> object, uint32_t index, Handle<Object> value,
2299 LanguageMode language_mode, bool check_prototype = true); 2298 LanguageMode language_mode, bool check_prototype = true);
2299 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithFailedAccessCheck(
2300 Isolate* isolate, Handle<JSObject> object, Handle<Object> receiver,
2301 uint32_t index);
2302 MUST_USE_RESULT static Maybe<PropertyAttributes>
2303 GetElementAttributesWithFailedAccessCheck(Isolate* isolate,
2304 Handle<JSObject> object,
2305 Handle<Object> receiver,
2306 uint32_t index);
2300 2307
2301 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( 2308 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck(
2302 LookupIterator* it, Handle<Object> value, LanguageMode language_mode); 2309 LookupIterator* it, Handle<Object> value, LanguageMode language_mode);
2303 2310
2304 // Add a property to a slow-case object. 2311 // Add a property to a slow-case object.
2305 static void AddSlowProperty(Handle<JSObject> object, 2312 static void AddSlowProperty(Handle<JSObject> object,
2306 Handle<Name> name, 2313 Handle<Name> name,
2307 Handle<Object> value, 2314 Handle<Object> value,
2308 PropertyAttributes attributes); 2315 PropertyAttributes attributes);
2309 2316
(...skipping 8226 matching lines...) Expand 10 before | Expand all | Expand 10 after
10536 10543
10537 class InterceptorInfo: public Struct { 10544 class InterceptorInfo: public Struct {
10538 public: 10545 public:
10539 DECL_ACCESSORS(getter, Object) 10546 DECL_ACCESSORS(getter, Object)
10540 DECL_ACCESSORS(setter, Object) 10547 DECL_ACCESSORS(setter, Object)
10541 DECL_ACCESSORS(query, Object) 10548 DECL_ACCESSORS(query, Object)
10542 DECL_ACCESSORS(deleter, Object) 10549 DECL_ACCESSORS(deleter, Object)
10543 DECL_ACCESSORS(enumerator, Object) 10550 DECL_ACCESSORS(enumerator, Object)
10544 DECL_ACCESSORS(data, Object) 10551 DECL_ACCESSORS(data, Object)
10545 DECL_BOOLEAN_ACCESSORS(can_intercept_symbols) 10552 DECL_BOOLEAN_ACCESSORS(can_intercept_symbols)
10553 DECL_BOOLEAN_ACCESSORS(all_can_read)
10546 10554
10547 inline int flags() const; 10555 inline int flags() const;
10548 inline void set_flags(int flags); 10556 inline void set_flags(int flags);
10549 10557
10550 DECLARE_CAST(InterceptorInfo) 10558 DECLARE_CAST(InterceptorInfo)
10551 10559
10552 // Dispatched behavior. 10560 // Dispatched behavior.
10553 DECLARE_PRINTER(InterceptorInfo) 10561 DECLARE_PRINTER(InterceptorInfo)
10554 DECLARE_VERIFIER(InterceptorInfo) 10562 DECLARE_VERIFIER(InterceptorInfo)
10555 10563
10556 static const int kGetterOffset = HeapObject::kHeaderSize; 10564 static const int kGetterOffset = HeapObject::kHeaderSize;
10557 static const int kSetterOffset = kGetterOffset + kPointerSize; 10565 static const int kSetterOffset = kGetterOffset + kPointerSize;
10558 static const int kQueryOffset = kSetterOffset + kPointerSize; 10566 static const int kQueryOffset = kSetterOffset + kPointerSize;
10559 static const int kDeleterOffset = kQueryOffset + kPointerSize; 10567 static const int kDeleterOffset = kQueryOffset + kPointerSize;
10560 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; 10568 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize;
10561 static const int kDataOffset = kEnumeratorOffset + kPointerSize; 10569 static const int kDataOffset = kEnumeratorOffset + kPointerSize;
10562 static const int kFlagsOffset = kDataOffset + kPointerSize; 10570 static const int kFlagsOffset = kDataOffset + kPointerSize;
10563 static const int kSize = kFlagsOffset + kPointerSize; 10571 static const int kSize = kFlagsOffset + kPointerSize;
10564 10572
10565 static const int kCanInterceptSymbolsBit = 0; 10573 static const int kCanInterceptSymbolsBit = 0;
10574 static const int kAllCanReadBit = 1;
10566 10575
10567 private: 10576 private:
10568 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); 10577 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo);
10569 }; 10578 };
10570 10579
10571 10580
10572 class CallHandlerInfo: public Struct { 10581 class CallHandlerInfo: public Struct {
10573 public: 10582 public:
10574 DECL_ACCESSORS(callback, Object) 10583 DECL_ACCESSORS(callback, Object)
10575 DECL_ACCESSORS(data, Object) 10584 DECL_ACCESSORS(data, Object)
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
10956 } else { 10965 } else {
10957 value &= ~(1 << bit_position); 10966 value &= ~(1 << bit_position);
10958 } 10967 }
10959 return value; 10968 return value;
10960 } 10969 }
10961 }; 10970 };
10962 10971
10963 } } // namespace v8::internal 10972 } } // namespace v8::internal
10964 10973
10965 #endif // V8_OBJECTS_H_ 10974 #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