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

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: review feedback 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
« no previous file with comments | « src/objects.cc ('k') | src/property.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 } 1715 }
1716 1716
1717 1717
1718 bool DescriptorArray::IsProperty(int descriptor_number) { 1718 bool DescriptorArray::IsProperty(int descriptor_number) {
1719 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE; 1719 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE;
1720 } 1720 }
1721 1721
1722 1722
1723 bool DescriptorArray::IsTransition(int descriptor_number) { 1723 bool DescriptorArray::IsTransition(int descriptor_number) {
1724 PropertyType t = GetType(descriptor_number); 1724 PropertyType t = GetType(descriptor_number);
1725 return t == MAP_TRANSITION || t == CONSTANT_TRANSITION; 1725 return t == MAP_TRANSITION || t == CONSTANT_TRANSITION ||
1726 t == EXTERNAL_ARRAY_TRANSITION;
1726 } 1727 }
1727 1728
1728 1729
1729 bool DescriptorArray::IsNullDescriptor(int descriptor_number) { 1730 bool DescriptorArray::IsNullDescriptor(int descriptor_number) {
1730 return GetType(descriptor_number) == NULL_DESCRIPTOR; 1731 return GetType(descriptor_number) == NULL_DESCRIPTOR;
1731 } 1732 }
1732 1733
1733 1734
1734 bool DescriptorArray::IsDontEnum(int descriptor_number) { 1735 bool DescriptorArray::IsDontEnum(int descriptor_number) {
1735 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum(); 1736 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum();
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2864 { MaybeObject* maybe_obj = CopyDropTransitions(); 2865 { MaybeObject* maybe_obj = CopyDropTransitions();
2865 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 2866 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2866 } 2867 }
2867 Map* new_map = Map::cast(obj); 2868 Map* new_map = Map::cast(obj);
2868 new_map->set_has_fast_elements(false); 2869 new_map->set_has_fast_elements(false);
2869 isolate()->counters()->map_fast_to_slow_elements()->Increment(); 2870 isolate()->counters()->map_fast_to_slow_elements()->Increment();
2870 return new_map; 2871 return new_map;
2871 } 2872 }
2872 2873
2873 2874
2874 MaybeObject* Map::NewExternalArrayElementsMap() {
2875 // TODO(danno): Special case empty object map (or most common case)
2876 // to return a pre-canned pixel array map.
2877 Object* obj;
2878 { MaybeObject* maybe_obj = CopyDropTransitions();
2879 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
2880 }
2881 Map* new_map = Map::cast(obj);
2882 new_map->set_has_fast_elements(false);
2883 new_map->set_has_external_array_elements(true);
2884 isolate()->counters()->map_to_external_array_elements()->Increment();
2885 return new_map;
2886 }
2887
2888
2889 ACCESSORS(Map, instance_descriptors, DescriptorArray, 2875 ACCESSORS(Map, instance_descriptors, DescriptorArray,
2890 kInstanceDescriptorsOffset) 2876 kInstanceDescriptorsOffset)
2891 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) 2877 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset)
2892 ACCESSORS(Map, constructor, Object, kConstructorOffset) 2878 ACCESSORS(Map, constructor, Object, kConstructorOffset)
2893 2879
2894 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) 2880 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
2895 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset) 2881 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset)
2896 ACCESSORS_GCSAFE(JSFunction, next_function_link, Object, 2882 ACCESSORS_GCSAFE(JSFunction, next_function_link, Object,
2897 kNextFunctionLinkOffset) 2883 kNextFunctionLinkOffset)
2898 2884
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
4113 #undef WRITE_INT_FIELD 4099 #undef WRITE_INT_FIELD
4114 #undef READ_SHORT_FIELD 4100 #undef READ_SHORT_FIELD
4115 #undef WRITE_SHORT_FIELD 4101 #undef WRITE_SHORT_FIELD
4116 #undef READ_BYTE_FIELD 4102 #undef READ_BYTE_FIELD
4117 #undef WRITE_BYTE_FIELD 4103 #undef WRITE_BYTE_FIELD
4118 4104
4119 4105
4120 } } // namespace v8::internal 4106 } } // namespace v8::internal
4121 4107
4122 #endif // V8_OBJECTS_INL_H_ 4108 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698