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

Side by Side Diff: src/objects.h

Issue 10915260: Reduce space usage of simple transitions and descriptors holders. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 3 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 | « 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ALLOW_CREATION, 169 ALLOW_CREATION,
170 OMIT_CREATION 170 OMIT_CREATION
171 }; 171 };
172 172
173 173
174 // Indicates whether transitions can be added to a source map or not. 174 // Indicates whether transitions can be added to a source map or not.
175 enum TransitionFlag { 175 enum TransitionFlag {
176 INSERT_TRANSITION, 176 INSERT_TRANSITION,
177 OMIT_TRANSITION 177 OMIT_TRANSITION
178 }; 178 };
179 179
Michael Starzinger 2012/09/19 09:34:55 Insert second empty newline here.
Toon Verwaest 2012/09/19 09:53:23 Done.
180 // Indicates whether the transition is simple: it either adds a property to a
Michael Starzinger 2012/09/19 09:34:55 The comment is slightly confusing to me. Can we re
Toon Verwaest 2012/09/19 09:53:23 Done.
181 // descriptor array; or it modifies the last added property.
182 enum SimpleTransitionFlag {
183 SIMPLE_TRANSITION,
184 FULL_TRANSITION
185 };
186
Michael Starzinger 2012/09/19 09:34:55 Insert second empty newline here.
Toon Verwaest 2012/09/19 09:53:23 Done.
180 // Indicates whether we are only interested in the descriptors of a particular 187 // Indicates whether we are only interested in the descriptors of a particular
181 // map, or in all descriptors in the descriptor array. 188 // map, or in all descriptors in the descriptor array.
182 enum DescriptorFlag { 189 enum DescriptorFlag {
183 ALL_DESCRIPTORS, 190 ALL_DESCRIPTORS,
184 OWN_DESCRIPTORS 191 OWN_DESCRIPTORS
185 }; 192 };
186 193
187 194
188 // Instance size sentinel for objects of variable size. 195 // Instance size sentinel for objects of variable size.
189 const int kVariableSizeSentinel = 0; 196 const int kVariableSizeSentinel = 0;
(...skipping 4639 matching lines...) Expand 10 before | Expand all | Expand 10 after
4829 ElementsKind to_kind); 4836 ElementsKind to_kind);
4830 4837
4831 bool StoresOwnDescriptors() { return HasTransitionArray(); } 4838 bool StoresOwnDescriptors() { return HasTransitionArray(); }
4832 inline bool HasTransitionArray(); 4839 inline bool HasTransitionArray();
4833 inline bool HasElementsTransition(); 4840 inline bool HasElementsTransition();
4834 inline Map* elements_transition_map(); 4841 inline Map* elements_transition_map();
4835 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( 4842 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map(
4836 Map* transitioned_map); 4843 Map* transitioned_map);
4837 inline void SetTransition(int transition_index, Map* target); 4844 inline void SetTransition(int transition_index, Map* target);
4838 inline Map* GetTransition(int transition_index); 4845 inline Map* GetTransition(int transition_index);
4839 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target); 4846 MUST_USE_RESULT inline MaybeObject* AddTransition(
4847 String* key,
4848 Map* target,
4849 SimpleTransitionFlag flag = SIMPLE_TRANSITION);
Michael Starzinger 2012/09/19 09:34:55 The Google C++ Style Guide doesn't like default ar
Toon Verwaest 2012/09/19 09:53:23 Done.
4840 DECL_ACCESSORS(transitions, TransitionArray) 4850 DECL_ACCESSORS(transitions, TransitionArray)
4841 inline void ClearTransitions(Heap* heap, 4851 inline void ClearTransitions(Heap* heap,
4842 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 4852 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
4843 4853
4844 // Tells whether the map is attached to SharedFunctionInfo 4854 // Tells whether the map is attached to SharedFunctionInfo
4845 // (for inobject slack tracking). 4855 // (for inobject slack tracking).
4846 inline void set_attached_to_shared_function_info(bool value); 4856 inline void set_attached_to_shared_function_info(bool value);
4847 4857
4848 inline bool attached_to_shared_function_info(); 4858 inline bool attached_to_shared_function_info();
4849 4859
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
4980 4990
4981 inline bool owns_descriptors(); 4991 inline bool owns_descriptors();
4982 inline void set_owns_descriptors(bool is_shared); 4992 inline void set_owns_descriptors(bool is_shared);
4983 4993
4984 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); 4994 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
4985 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); 4995 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
4986 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); 4996 MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
4987 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( 4997 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
4988 DescriptorArray* descriptors, 4998 DescriptorArray* descriptors,
4989 String* name, 4999 String* name,
4990 TransitionFlag flag); 5000 TransitionFlag flag,
5001 int descriptor_index = 0);
Michael Starzinger 2012/09/19 09:34:55 Likewise. Although there are more call-sites here.
Toon Verwaest 2012/09/19 09:53:23 Done.
4991 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor); 5002 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor);
4992 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, 5003 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor,
4993 TransitionFlag flag); 5004 TransitionFlag flag);
4994 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, 5005 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor,
4995 TransitionFlag flag); 5006 TransitionFlag flag);
4996 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, 5007 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor,
4997 int index, 5008 int index,
4998 TransitionFlag flag); 5009 TransitionFlag flag);
4999 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, 5010 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind,
5000 TransitionFlag flag); 5011 TransitionFlag flag);
(...skipping 4005 matching lines...) Expand 10 before | Expand all | Expand 10 after
9006 } else { 9017 } else {
9007 value &= ~(1 << bit_position); 9018 value &= ~(1 << bit_position);
9008 } 9019 }
9009 return value; 9020 return value;
9010 } 9021 }
9011 }; 9022 };
9012 9023
9013 } } // namespace v8::internal 9024 } } // namespace v8::internal
9014 9025
9015 #endif // V8_OBJECTS_H_ 9026 #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