| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2464 // Gets the number of currently used elements. | 2464 // Gets the number of currently used elements. |
| 2465 int GetFastElementsUsage(); | 2465 int GetFastElementsUsage(); |
| 2466 | 2466 |
| 2467 static bool AllCanRead(LookupIterator* it); | 2467 static bool AllCanRead(LookupIterator* it); |
| 2468 static bool AllCanWrite(LookupIterator* it); | 2468 static bool AllCanWrite(LookupIterator* it); |
| 2469 | 2469 |
| 2470 private: | 2470 private: |
| 2471 friend class JSReceiver; | 2471 friend class JSReceiver; |
| 2472 friend class Object; | 2472 friend class Object; |
| 2473 | 2473 |
| 2474 static Handle<InterceptorInfo> GetInterceptorForFailedAccessCheck( |
| 2475 LookupIterator* it); |
| 2476 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptorInternal( |
| 2477 LookupIterator* it, Handle<InterceptorInfo> interceptor, bool* done); |
| 2478 MUST_USE_RESULT static Maybe<PropertyAttributes> |
| 2479 GetPropertyAttributesWithInterceptorInternal( |
| 2480 LookupIterator* it, Handle<InterceptorInfo> interceptor); |
| 2481 MUST_USE_RESULT static Maybe<bool> SetPropertyWithInterceptorInternal( |
| 2482 LookupIterator* it, Handle<InterceptorInfo> interceptor, |
| 2483 ShouldThrow should_throw, Handle<Object> value); |
| 2484 |
| 2474 // Used from Object::GetProperty(). | 2485 // Used from Object::GetProperty(). |
| 2475 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( | 2486 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( |
| 2476 LookupIterator* it); | 2487 LookupIterator* it); |
| 2477 | 2488 |
| 2478 MUST_USE_RESULT static Maybe<bool> SetPropertyWithFailedAccessCheck( | 2489 MUST_USE_RESULT static Maybe<bool> SetPropertyWithFailedAccessCheck( |
| 2479 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); | 2490 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); |
| 2480 | 2491 |
| 2481 // Add a property to a slow-case object. | 2492 // Add a property to a slow-case object. |
| 2482 static void AddSlowProperty(Handle<JSObject> object, | 2493 static void AddSlowProperty(Handle<JSObject> object, |
| 2483 Handle<Name> name, | 2494 Handle<Name> name, |
| (...skipping 7895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10379 // assertTrue("foo" in obj); | 10390 // assertTrue("foo" in obj); |
| 10380 inline bool IsJSAccessor(Object* obj); | 10391 inline bool IsJSAccessor(Object* obj); |
| 10381 | 10392 |
| 10382 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair); | 10393 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair); |
| 10383 }; | 10394 }; |
| 10384 | 10395 |
| 10385 | 10396 |
| 10386 class AccessCheckInfo: public Struct { | 10397 class AccessCheckInfo: public Struct { |
| 10387 public: | 10398 public: |
| 10388 DECL_ACCESSORS(callback, Object) | 10399 DECL_ACCESSORS(callback, Object) |
| 10400 DECL_ACCESSORS(named_interceptor, Object) |
| 10401 DECL_ACCESSORS(indexed_interceptor, Object) |
| 10389 DECL_ACCESSORS(data, Object) | 10402 DECL_ACCESSORS(data, Object) |
| 10390 | 10403 |
| 10391 DECLARE_CAST(AccessCheckInfo) | 10404 DECLARE_CAST(AccessCheckInfo) |
| 10392 | 10405 |
| 10393 // Dispatched behavior. | 10406 // Dispatched behavior. |
| 10394 DECLARE_PRINTER(AccessCheckInfo) | 10407 DECLARE_PRINTER(AccessCheckInfo) |
| 10395 DECLARE_VERIFIER(AccessCheckInfo) | 10408 DECLARE_VERIFIER(AccessCheckInfo) |
| 10396 | 10409 |
| 10410 static AccessCheckInfo* Get(Isolate* isolate, Handle<JSObject> receiver); |
| 10411 |
| 10397 static const int kCallbackOffset = HeapObject::kHeaderSize; | 10412 static const int kCallbackOffset = HeapObject::kHeaderSize; |
| 10398 static const int kDataOffset = kCallbackOffset + kPointerSize; | 10413 static const int kNamedInterceptorOffset = kCallbackOffset + kPointerSize; |
| 10414 static const int kIndexedInterceptorOffset = |
| 10415 kNamedInterceptorOffset + kPointerSize; |
| 10416 static const int kDataOffset = kIndexedInterceptorOffset + kPointerSize; |
| 10399 static const int kSize = kDataOffset + kPointerSize; | 10417 static const int kSize = kDataOffset + kPointerSize; |
| 10400 | 10418 |
| 10401 private: | 10419 private: |
| 10402 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); | 10420 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); |
| 10403 }; | 10421 }; |
| 10404 | 10422 |
| 10405 | 10423 |
| 10406 class InterceptorInfo: public Struct { | 10424 class InterceptorInfo: public Struct { |
| 10407 public: | 10425 public: |
| 10408 DECL_ACCESSORS(getter, Object) | 10426 DECL_ACCESSORS(getter, Object) |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10807 } | 10825 } |
| 10808 return value; | 10826 return value; |
| 10809 } | 10827 } |
| 10810 }; | 10828 }; |
| 10811 | 10829 |
| 10812 | 10830 |
| 10813 } // NOLINT, false-positive due to second-order macros. | 10831 } // NOLINT, false-positive due to second-order macros. |
| 10814 } // NOLINT, false-positive due to second-order macros. | 10832 } // NOLINT, false-positive due to second-order macros. |
| 10815 | 10833 |
| 10816 #endif // V8_OBJECTS_H_ | 10834 #endif // V8_OBJECTS_H_ |
| OLD | NEW |