OLD | NEW |
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 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 { MaybeObject* maybe_obj = CopyDropTransitions(); | 2751 { MaybeObject* maybe_obj = CopyDropTransitions(); |
2752 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 2752 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
2753 } | 2753 } |
2754 Map* new_map = Map::cast(obj); | 2754 Map* new_map = Map::cast(obj); |
2755 new_map->set_has_fast_elements(false); | 2755 new_map->set_has_fast_elements(false); |
2756 Counters::map_fast_to_slow_elements.Increment(); | 2756 Counters::map_fast_to_slow_elements.Increment(); |
2757 return new_map; | 2757 return new_map; |
2758 } | 2758 } |
2759 | 2759 |
2760 | 2760 |
2761 MaybeObject* Map::NewExternalArrayElementsMap() { | |
2762 // TODO(danno): Special case empty object map (or most common case) | |
2763 // to return a pre-canned pixel array map. | |
2764 Object* obj; | |
2765 { MaybeObject* maybe_obj = CopyDropTransitions(); | |
2766 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | |
2767 } | |
2768 Map* new_map = Map::cast(obj); | |
2769 new_map->set_has_fast_elements(false); | |
2770 new_map->set_has_external_array_elements(true); | |
2771 Counters::map_to_external_array_elements.Increment(); | |
2772 return new_map; | |
2773 } | |
2774 | |
2775 | |
2776 ACCESSORS(Map, instance_descriptors, DescriptorArray, | 2761 ACCESSORS(Map, instance_descriptors, DescriptorArray, |
2777 kInstanceDescriptorsOffset) | 2762 kInstanceDescriptorsOffset) |
2778 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 2763 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
2779 ACCESSORS(Map, constructor, Object, kConstructorOffset) | 2764 ACCESSORS(Map, constructor, Object, kConstructorOffset) |
2780 | 2765 |
2781 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) | 2766 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
2782 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset) | 2767 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset) |
2783 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 2768 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
2784 | 2769 |
2785 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) | 2770 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 #undef WRITE_INT_FIELD | 3921 #undef WRITE_INT_FIELD |
3937 #undef READ_SHORT_FIELD | 3922 #undef READ_SHORT_FIELD |
3938 #undef WRITE_SHORT_FIELD | 3923 #undef WRITE_SHORT_FIELD |
3939 #undef READ_BYTE_FIELD | 3924 #undef READ_BYTE_FIELD |
3940 #undef WRITE_BYTE_FIELD | 3925 #undef WRITE_BYTE_FIELD |
3941 | 3926 |
3942 | 3927 |
3943 } } // namespace v8::internal | 3928 } } // namespace v8::internal |
3944 | 3929 |
3945 #endif // V8_OBJECTS_INL_H_ | 3930 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |