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

Side by Side Diff: src/objects.h

Issue 314953006: Implement LookupIterator designed to replace LookupResult (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adding to BUILD.gn Created 6 years, 6 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
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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 855
856 class AccessorPair; 856 class AccessorPair;
857 class AllocationSite; 857 class AllocationSite;
858 class AllocationSiteCreationContext; 858 class AllocationSiteCreationContext;
859 class AllocationSiteUsageContext; 859 class AllocationSiteUsageContext;
860 class DictionaryElementsAccessor; 860 class DictionaryElementsAccessor;
861 class ElementsAccessor; 861 class ElementsAccessor;
862 class FixedArrayBase; 862 class FixedArrayBase;
863 class GlobalObject; 863 class GlobalObject;
864 class ObjectVisitor; 864 class ObjectVisitor;
865 class LookupIterator;
865 class StringStream; 866 class StringStream;
866 // We cannot just say "class HeapType;" if it is created from a template... =8-? 867 // We cannot just say "class HeapType;" if it is created from a template... =8-?
867 template<class> class TypeImpl; 868 template<class> class TypeImpl;
868 struct HeapTypeConfig; 869 struct HeapTypeConfig;
869 typedef TypeImpl<HeapTypeConfig> HeapType; 870 typedef TypeImpl<HeapTypeConfig> HeapType;
870 871
871 872
872 // A template-ized version of the IsXXX functions. 873 // A template-ized version of the IsXXX functions.
873 template <class C> inline bool Is(Object* obj); 874 template <class C> inline bool Is(Object* obj);
874 875
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, 1450 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate,
1450 Handle<Object> object, 1451 Handle<Object> object,
1451 Handle<Context> context); 1452 Handle<Context> context);
1452 1453
1453 // Converts this to a Smi if possible. 1454 // Converts this to a Smi if possible.
1454 static MUST_USE_RESULT inline MaybeHandle<Smi> ToSmi(Isolate* isolate, 1455 static MUST_USE_RESULT inline MaybeHandle<Smi> ToSmi(Isolate* isolate,
1455 Handle<Object> object); 1456 Handle<Object> object);
1456 1457
1457 void Lookup(Handle<Name> name, LookupResult* result); 1458 void Lookup(Handle<Name> name, LookupResult* result);
1458 1459
1459 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithReceiver( 1460 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it);
1460 Handle<Object> object,
1461 Handle<Object> receiver,
1462 Handle<Name> name,
1463 PropertyAttributes* attributes);
1464 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( 1461 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement(
1465 Handle<Object> object, 1462 Handle<Object> object,
1466 Handle<Name> key); 1463 Handle<Name> key);
1467 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( 1464 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty(
1468 Isolate* isolate, 1465 Isolate* isolate,
1469 Handle<Object> object, 1466 Handle<Object> object,
1470 const char* key); 1467 const char* key);
1471 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( 1468 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty(
1472 Handle<Object> object, 1469 Handle<Object> object,
1473 Handle<Name> key); 1470 Handle<Name> key);
1474 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
1475 Handle<Object> object,
1476 Handle<Object> receiver,
1477 LookupResult* result,
1478 Handle<Name> key,
1479 PropertyAttributes* attributes);
1480 1471
1481 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithCallback( 1472 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithAccessor(
1482 Handle<Object> receiver, 1473 Handle<Object> receiver,
1483 Handle<Name> name, 1474 Handle<Name> name,
1484 Handle<JSObject> holder, 1475 Handle<JSObject> holder,
1485 Handle<Object> structure); 1476 Handle<Object> structure);
1486 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithCallback( 1477 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithCallback(
1487 Handle<Object> receiver, 1478 Handle<Object> receiver,
1488 Handle<Name> name, 1479 Handle<Name> name,
1489 Handle<Object> value, 1480 Handle<Object> value,
1490 Handle<JSObject> holder, 1481 Handle<JSObject> holder,
1491 Handle<Object> structure, 1482 Handle<Object> structure,
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 v8::AccessControl access_control = v8::DEFAULT); 2248 v8::AccessControl access_control = v8::DEFAULT);
2258 2249
2259 // Defines an AccessorInfo property on the given object. 2250 // Defines an AccessorInfo property on the given object.
2260 MUST_USE_RESULT static MaybeHandle<Object> SetAccessor( 2251 MUST_USE_RESULT static MaybeHandle<Object> SetAccessor(
2261 Handle<JSObject> object, 2252 Handle<JSObject> object,
2262 Handle<AccessorInfo> info); 2253 Handle<AccessorInfo> info);
2263 2254
2264 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptor( 2255 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptor(
2265 Handle<JSObject> object, 2256 Handle<JSObject> object,
2266 Handle<Object> receiver, 2257 Handle<Object> receiver,
2267 Handle<Name> name, 2258 Handle<Name> name);
2268 PropertyAttributes* attributes);
2269 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyPostInterceptor(
2270 Handle<JSObject> object,
2271 Handle<Object> receiver,
2272 Handle<Name> name,
2273 PropertyAttributes* attributes);
2274 2259
2275 // Returns true if this is an instance of an api function and has 2260 // Returns true if this is an instance of an api function and has
2276 // been modified since it was created. May give false positives. 2261 // been modified since it was created. May give false positives.
2277 bool IsDirty(); 2262 bool IsDirty();
2278 2263
2279 // Accessors for hidden properties object. 2264 // Accessors for hidden properties object.
2280 // 2265 //
2281 // Hidden properties are not own properties of the object itself. 2266 // Hidden properties are not own properties of the object itself.
2282 // Instead they are stored in an auxiliary structure kept as an own 2267 // Instead they are stored in an auxiliary structure kept as an own
2283 // property with a special name Heap::hidden_string(). But if the 2268 // property with a special name Heap::hidden_string(). But if the
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 private: 2659 private:
2675 friend class DictionaryElementsAccessor; 2660 friend class DictionaryElementsAccessor;
2676 friend class JSReceiver; 2661 friend class JSReceiver;
2677 friend class Object; 2662 friend class Object;
2678 2663
2679 static void UpdateAllocationSite(Handle<JSObject> object, 2664 static void UpdateAllocationSite(Handle<JSObject> object,
2680 ElementsKind to_kind); 2665 ElementsKind to_kind);
2681 2666
2682 // Used from Object::GetProperty(). 2667 // Used from Object::GetProperty().
2683 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( 2668 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck(
2684 Handle<JSObject> object, 2669 LookupIterator* it);
2685 Handle<Object> receiver,
2686 LookupResult* result,
2687 Handle<Name> name,
2688 PropertyAttributes* attributes);
2689 2670
2690 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithCallback( 2671 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithCallback(
2691 Handle<JSObject> object, 2672 Handle<JSObject> object,
2692 Handle<Object> receiver, 2673 Handle<Object> receiver,
2693 Handle<Object> structure, 2674 Handle<Object> structure,
2694 uint32_t index, 2675 uint32_t index,
2695 Handle<Object> holder); 2676 Handle<Object> holder);
2696 2677
2697 static PropertyAttributes GetElementAttributeWithInterceptor( 2678 static PropertyAttributes GetElementAttributeWithInterceptor(
2698 Handle<JSObject> object, 2679 Handle<JSObject> object,
(...skipping 3943 matching lines...) Expand 10 before | Expand all | Expand 10 after
6642 6623
6643 bool CanTransition() { 6624 bool CanTransition() {
6644 // Only JSObject and subtypes have map transitions and back pointers. 6625 // Only JSObject and subtypes have map transitions and back pointers.
6645 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); 6626 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
6646 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6627 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6647 } 6628 }
6648 6629
6649 bool IsJSObjectMap() { 6630 bool IsJSObjectMap() {
6650 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6631 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6651 } 6632 }
6633 bool IsJSProxyMap() {
6634 InstanceType type = instance_type();
6635 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE;
6636 }
6652 bool IsJSGlobalProxyMap() { 6637 bool IsJSGlobalProxyMap() {
6653 return instance_type() == JS_GLOBAL_PROXY_TYPE; 6638 return instance_type() == JS_GLOBAL_PROXY_TYPE;
6654 } 6639 }
6655 bool IsJSGlobalObjectMap() { 6640 bool IsJSGlobalObjectMap() {
6656 return instance_type() == JS_GLOBAL_OBJECT_TYPE; 6641 return instance_type() == JS_GLOBAL_OBJECT_TYPE;
6657 } 6642 }
6658 bool IsGlobalObjectMap() { 6643 bool IsGlobalObjectMap() {
6659 const InstanceType type = instance_type(); 6644 const InstanceType type = instance_type();
6660 return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE; 6645 return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE;
6661 } 6646 }
(...skipping 4587 matching lines...) Expand 10 before | Expand all | Expand 10 after
11249 } else { 11234 } else {
11250 value &= ~(1 << bit_position); 11235 value &= ~(1 << bit_position);
11251 } 11236 }
11252 return value; 11237 return value;
11253 } 11238 }
11254 }; 11239 };
11255 11240
11256 } } // namespace v8::internal 11241 } } // namespace v8::internal
11257 11242
11258 #endif // V8_OBJECTS_H_ 11243 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698