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

Side by Side Diff: src/objects.h

Issue 11420011: Clean-up refactoring to eliminate GetLocalElementKind. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Eps. Created 8 years, 1 month 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 | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')
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 // 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 // Property access. 966 // Property access.
967 MUST_USE_RESULT inline MaybeObject* GetProperty(String* key); 967 MUST_USE_RESULT inline MaybeObject* GetProperty(String* key);
968 MUST_USE_RESULT inline MaybeObject* GetProperty( 968 MUST_USE_RESULT inline MaybeObject* GetProperty(
969 String* key, 969 String* key,
970 PropertyAttributes* attributes); 970 PropertyAttributes* attributes);
971 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( 971 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver(
972 Object* receiver, 972 Object* receiver,
973 String* key, 973 String* key,
974 PropertyAttributes* attributes); 974 PropertyAttributes* attributes);
975 975
976 static Handle<Object> GetProperty(Handle<Object> object, Handle<String> key);
976 static Handle<Object> GetProperty(Handle<Object> object, 977 static Handle<Object> GetProperty(Handle<Object> object,
977 Handle<Object> receiver, 978 Handle<Object> receiver,
978 LookupResult* result, 979 LookupResult* result,
979 Handle<String> key, 980 Handle<String> key,
980 PropertyAttributes* attributes); 981 PropertyAttributes* attributes);
981 982
982 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, 983 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver,
983 LookupResult* result, 984 LookupResult* result,
984 String* key, 985 String* key,
985 PropertyAttributes* attributes); 986 PropertyAttributes* attributes);
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); 1840 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements);
1840 1841
1841 // Computes the new capacity when expanding the elements of a JSObject. 1842 // Computes the new capacity when expanding the elements of a JSObject.
1842 static int NewElementsCapacity(int old_capacity) { 1843 static int NewElementsCapacity(int old_capacity) {
1843 // (old_capacity + 50%) + 16 1844 // (old_capacity + 50%) + 16
1844 return old_capacity + (old_capacity >> 1) + 16; 1845 return old_capacity + (old_capacity >> 1) + 16;
1845 } 1846 }
1846 1847
1847 PropertyType GetLocalPropertyType(String* name); 1848 PropertyType GetLocalPropertyType(String* name);
1848 PropertyType GetLocalElementType(uint32_t index); 1849 PropertyType GetLocalElementType(uint32_t index);
1850 // These methods do not perform access checks!
Michael Starzinger 2012/11/15 21:45:37 Add empty newline above the comment.
rossberg 2012/11/16 12:50:02 Done.
1849 AccessorPair* GetLocalPropertyAccessorPair(String* name); 1851 AccessorPair* GetLocalPropertyAccessorPair(String* name);
1850 AccessorPair* GetLocalElementAccessorPair(uint32_t index); 1852 AccessorPair* GetLocalElementAccessorPair(uint32_t index);
1851 1853
1852 // Tells whether the index'th element is present and how it is stored.
1853 enum LocalElementKind {
Michael Starzinger 2012/11/15 21:45:37 Oh yeah, LocalElementKind be gone. I like that!
1854 // There is no element with given index.
1855 UNDEFINED_ELEMENT,
1856
1857 // Element with given index is handled by interceptor.
1858 INTERCEPTED_ELEMENT,
1859
1860 // Element with given index is character in string.
1861 STRING_CHARACTER_ELEMENT,
1862
1863 // Element with given index is stored in fast backing store.
1864 FAST_ELEMENT,
1865
1866 // Element with given index is stored in slow backing store.
1867 DICTIONARY_ELEMENT
1868 };
1869
1870 LocalElementKind GetLocalElementKind(uint32_t index);
1871
1872 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, 1854 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index,
1873 Object* value, 1855 Object* value,
1874 StrictModeFlag strict_mode, 1856 StrictModeFlag strict_mode,
1875 bool check_prototype); 1857 bool check_prototype);
1876 1858
1877 MUST_USE_RESULT MaybeObject* SetDictionaryElement( 1859 MUST_USE_RESULT MaybeObject* SetDictionaryElement(
1878 uint32_t index, 1860 uint32_t index,
1879 Object* value, 1861 Object* value,
1880 PropertyAttributes attributes, 1862 PropertyAttributes attributes,
1881 StrictModeFlag strict_mode, 1863 StrictModeFlag strict_mode,
(...skipping 7136 matching lines...) Expand 10 before | Expand all | Expand 10 after
9018 } else { 9000 } else {
9019 value &= ~(1 << bit_position); 9001 value &= ~(1 << bit_position);
9020 } 9002 }
9021 return value; 9003 return value;
9022 } 9004 }
9023 }; 9005 };
9024 9006
9025 } } // namespace v8::internal 9007 } } // namespace v8::internal
9026 9008
9027 #endif // V8_OBJECTS_H_ 9009 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698