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

Side by Side Diff: src/objects-inl.h

Issue 6685073: Remember and reuse derived map for external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix handling of empty property name Created 9 years, 9 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 } 1717 }
1718 1718
1719 1719
1720 bool DescriptorArray::IsProperty(int descriptor_number) { 1720 bool DescriptorArray::IsProperty(int descriptor_number) {
1721 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE; 1721 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE;
1722 } 1722 }
1723 1723
1724 1724
1725 bool DescriptorArray::IsTransition(int descriptor_number) { 1725 bool DescriptorArray::IsTransition(int descriptor_number) {
1726 PropertyType t = GetType(descriptor_number); 1726 PropertyType t = GetType(descriptor_number);
1727 return t == MAP_TRANSITION || t == CONSTANT_TRANSITION; 1727 return t == MAP_TRANSITION || t == CONSTANT_TRANSITION ||
1728 t == EXTERNAL_ARRAY_TRANSITION;
1728 } 1729 }
1729 1730
1730 1731
1731 bool DescriptorArray::IsNullDescriptor(int descriptor_number) { 1732 bool DescriptorArray::IsNullDescriptor(int descriptor_number) {
1732 return GetType(descriptor_number) == NULL_DESCRIPTOR; 1733 return GetType(descriptor_number) == NULL_DESCRIPTOR;
1733 } 1734 }
1734 1735
1735 1736
1736 bool DescriptorArray::IsDontEnum(int descriptor_number) { 1737 bool DescriptorArray::IsDontEnum(int descriptor_number) {
1737 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum(); 1738 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum();
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 { MaybeObject* maybe_obj = CopyDropTransitions(); 2862 { MaybeObject* maybe_obj = CopyDropTransitions();
2862 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 2863 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2863 } 2864 }
2864 Map* new_map = Map::cast(obj); 2865 Map* new_map = Map::cast(obj);
2865 new_map->set_has_fast_elements(false); 2866 new_map->set_has_fast_elements(false);
2866 COUNTERS->map_fast_to_slow_elements()->Increment(); 2867 COUNTERS->map_fast_to_slow_elements()->Increment();
2867 return new_map; 2868 return new_map;
2868 } 2869 }
2869 2870
2870 2871
2871 MaybeObject* Map::NewExternalArrayElementsMap() {
2872 // TODO(danno): Special case empty object map (or most common case)
2873 // to return a pre-canned pixel array map.
2874 Object* obj;
2875 { MaybeObject* maybe_obj = CopyDropTransitions();
2876 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2877 }
2878 Map* new_map = Map::cast(obj);
2879 new_map->set_has_fast_elements(false);
2880 new_map->set_has_external_array_elements(true);
2881 COUNTERS->map_to_external_array_elements()->Increment();
2882 return new_map;
2883 }
2884
2885
2886 ACCESSORS(Map, instance_descriptors, DescriptorArray, 2872 ACCESSORS(Map, instance_descriptors, DescriptorArray,
2887 kInstanceDescriptorsOffset) 2873 kInstanceDescriptorsOffset)
2888 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) 2874 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset)
2889 ACCESSORS(Map, constructor, Object, kConstructorOffset) 2875 ACCESSORS(Map, constructor, Object, kConstructorOffset)
2890 2876
2891 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) 2877 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
2892 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset) 2878 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset)
2893 ACCESSORS_GCSAFE(JSFunction, next_function_link, Object, 2879 ACCESSORS_GCSAFE(JSFunction, next_function_link, Object,
2894 kNextFunctionLinkOffset) 2880 kNextFunctionLinkOffset)
2895 2881
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
4110 #undef WRITE_INT_FIELD 4096 #undef WRITE_INT_FIELD
4111 #undef READ_SHORT_FIELD 4097 #undef READ_SHORT_FIELD
4112 #undef WRITE_SHORT_FIELD 4098 #undef WRITE_SHORT_FIELD
4113 #undef READ_BYTE_FIELD 4099 #undef READ_BYTE_FIELD
4114 #undef WRITE_BYTE_FIELD 4100 #undef WRITE_BYTE_FIELD
4115 4101
4116 4102
4117 } } // namespace v8::internal 4103 } } // namespace v8::internal
4118 4104
4119 #endif // V8_OBJECTS_INL_H_ 4105 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698