Chromium Code Reviews

Side by Side Diff: src/objects.h

Issue 225673003: Return MaybeHandle from GetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1518 matching lines...)
1529 1529
1530 void Lookup(Name* name, LookupResult* result); 1530 void Lookup(Name* name, LookupResult* result);
1531 1531
1532 // Property access. 1532 // Property access.
1533 MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key); 1533 MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key);
1534 MUST_USE_RESULT inline MaybeObject* GetProperty( 1534 MUST_USE_RESULT inline MaybeObject* GetProperty(
1535 Name* key, 1535 Name* key,
1536 PropertyAttributes* attributes); 1536 PropertyAttributes* attributes);
1537 1537
1538 // TODO(yangguo): this should eventually replace the non-handlified version. 1538 // TODO(yangguo): this should eventually replace the non-handlified version.
1539 static Handle<Object> GetPropertyWithReceiver(Handle<Object> object, 1539 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithReceiver(
1540 Handle<Object> receiver, 1540 Handle<Object> object,
1541 Handle<Name> name, 1541 Handle<Object> receiver,
1542 PropertyAttributes* attributes); 1542 Handle<Name> name,
1543 PropertyAttributes* attributes);
1543 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( 1544 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver(
1544 Object* receiver, 1545 Object* receiver,
1545 Name* key, 1546 Name* key,
1546 PropertyAttributes* attributes); 1547 PropertyAttributes* attributes);
1547 1548
1548 static Handle<Object> GetPropertyOrElement(Handle<Object> object, 1549 static Handle<Object> GetPropertyOrElement(Handle<Object> object,
1549 Handle<Name> key); 1550 Handle<Name> key);
1550 1551
1551 static Handle<Object> GetProperty(Handle<Object> object, 1552 static Handle<Object> GetProperty(Handle<Object> object,
1552 Handle<Name> key); 1553 Handle<Name> key);
1553 static Handle<Object> GetProperty(Handle<Object> object, 1554 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
1554 Handle<Object> receiver, 1555 Handle<Object> object,
1555 LookupResult* result, 1556 Handle<Object> receiver,
1556 Handle<Name> key, 1557 LookupResult* result,
1557 PropertyAttributes* attributes); 1558 Handle<Name> key,
1559 PropertyAttributes* attributes);
1558 1560
1559 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, 1561 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver,
1560 LookupResult* result, 1562 LookupResult* result,
1561 Name* key, 1563 Name* key,
1562 PropertyAttributes* attributes); 1564 PropertyAttributes* attributes);
1563 1565
1564 MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver, 1566 MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver,
1565 JSReceiver* getter); 1567 JSReceiver* getter);
1566 1568
1567 static inline Handle<Object> GetElement(Isolate* isolate, 1569 static inline Handle<Object> GetElement(Isolate* isolate,
(...skipping 672 matching lines...)
2240 // Undefined values are placed after non-undefined values. 2242 // Undefined values are placed after non-undefined values.
2241 // Returns the number of non-undefined values. 2243 // Returns the number of non-undefined values.
2242 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, 2244 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object,
2243 uint32_t limit); 2245 uint32_t limit);
2244 // As PrepareElementsForSort, but only on objects where elements is 2246 // As PrepareElementsForSort, but only on objects where elements is
2245 // a dictionary, and it will stay a dictionary. 2247 // a dictionary, and it will stay a dictionary.
2246 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, 2248 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object,
2247 uint32_t limit); 2249 uint32_t limit);
2248 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit); 2250 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit);
2249 2251
2250 static Handle<Object> GetPropertyWithCallback(Handle<JSObject> object, 2252 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithCallback(
2251 Handle<Object> receiver, 2253 Handle<JSObject> object,
2252 Handle<Object> structure, 2254 Handle<Object> receiver,
2253 Handle<Name> name); 2255 Handle<Object> structure,
2256 Handle<Name> name);
2254 2257
2255 static Handle<Object> SetPropertyWithCallback( 2258 static Handle<Object> SetPropertyWithCallback(
2256 Handle<JSObject> object, 2259 Handle<JSObject> object,
2257 Handle<Object> structure, 2260 Handle<Object> structure,
2258 Handle<Name> name, 2261 Handle<Name> name,
2259 Handle<Object> value, 2262 Handle<Object> value,
2260 Handle<JSObject> holder, 2263 Handle<JSObject> holder,
2261 StrictMode strict_mode); 2264 StrictMode strict_mode);
2262 2265
2263 static Handle<Object> SetPropertyWithInterceptor( 2266 static Handle<Object> SetPropertyWithInterceptor(
(...skipping 99 matching lines...)
2363 Handle<Name> name, 2366 Handle<Name> name,
2364 Handle<Object> getter, 2367 Handle<Object> getter,
2365 Handle<Object> setter, 2368 Handle<Object> setter,
2366 PropertyAttributes attributes, 2369 PropertyAttributes attributes,
2367 v8::AccessControl access_control = v8::DEFAULT); 2370 v8::AccessControl access_control = v8::DEFAULT);
2368 2371
2369 // Defines an AccessorInfo property on the given object. 2372 // Defines an AccessorInfo property on the given object.
2370 static Handle<Object> SetAccessor(Handle<JSObject> object, 2373 static Handle<Object> SetAccessor(Handle<JSObject> object,
2371 Handle<AccessorInfo> info); 2374 Handle<AccessorInfo> info);
2372 2375
2373 static Handle<Object> GetPropertyWithInterceptor( 2376 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptor(
2374 Handle<JSObject> object, 2377 Handle<JSObject> object,
2375 Handle<Object> receiver, 2378 Handle<Object> receiver,
2376 Handle<Name> name, 2379 Handle<Name> name,
2377 PropertyAttributes* attributes); 2380 PropertyAttributes* attributes);
2378 static Handle<Object> GetPropertyPostInterceptor( 2381 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyPostInterceptor(
2379 Handle<JSObject> object, 2382 Handle<JSObject> object,
2380 Handle<Object> receiver, 2383 Handle<Object> receiver,
2381 Handle<Name> name, 2384 Handle<Name> name,
2382 PropertyAttributes* attributes); 2385 PropertyAttributes* attributes);
2383 MUST_USE_RESULT MaybeObject* GetLocalPropertyPostInterceptor( 2386 MUST_USE_RESULT MaybeObject* GetLocalPropertyPostInterceptor(
2384 Object* receiver, 2387 Object* receiver,
2385 Name* name, 2388 Name* name,
2386 PropertyAttributes* attributes); 2389 PropertyAttributes* attributes);
2387 2390
2388 // Returns true if this is an instance of an api function and has 2391 // Returns true if this is an instance of an api function and has
(...skipping 377 matching lines...)
2766 2769
2767 private: 2770 private:
2768 friend class DictionaryElementsAccessor; 2771 friend class DictionaryElementsAccessor;
2769 friend class JSReceiver; 2772 friend class JSReceiver;
2770 friend class Object; 2773 friend class Object;
2771 2774
2772 static void UpdateAllocationSite(Handle<JSObject> object, 2775 static void UpdateAllocationSite(Handle<JSObject> object,
2773 ElementsKind to_kind); 2776 ElementsKind to_kind);
2774 2777
2775 // Used from Object::GetProperty(). 2778 // Used from Object::GetProperty().
2776 static Handle<Object> GetPropertyWithFailedAccessCheck( 2779 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck(
2777 Handle<JSObject> object, 2780 Handle<JSObject> object,
2778 Handle<Object> receiver, 2781 Handle<Object> receiver,
2779 LookupResult* result, 2782 LookupResult* result,
2780 Handle<Name> name, 2783 Handle<Name> name,
2781 PropertyAttributes* attributes); 2784 PropertyAttributes* attributes);
2782 2785
2783 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, 2786 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
2784 Object* structure, 2787 Object* structure,
2785 uint32_t index, 2788 uint32_t index,
2786 Object* holder); 2789 Object* holder);
(...skipping 8032 matching lines...)
10819 } else { 10822 } else {
10820 value &= ~(1 << bit_position); 10823 value &= ~(1 << bit_position);
10821 } 10824 }
10822 return value; 10825 return value;
10823 } 10826 }
10824 }; 10827 };
10825 10828
10826 } } // namespace v8::internal 10829 } } // namespace v8::internal
10827 10830
10828 #endif // V8_OBJECTS_H_ 10831 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/json-stringifier.h ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine