OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 }; | 174 }; |
175 | 175 |
176 | 176 |
177 // ---------------------------------------------------------------------------- | 177 // ---------------------------------------------------------------------------- |
178 // Handle operations. | 178 // Handle operations. |
179 // They might invoke garbage collection. The result is an handle to | 179 // They might invoke garbage collection. The result is an handle to |
180 // an object of expected type, or the handle is an error if running out | 180 // an object of expected type, or the handle is an error if running out |
181 // of space or encountering an internal error. | 181 // of space or encountering an internal error. |
182 | 182 |
183 void NormalizeProperties(Handle<JSObject> object, | 183 void NormalizeProperties(Handle<JSObject> object, |
184 PropertyNormalizationMode mode); | 184 PropertyNormalizationMode mode, |
| 185 int expected_additional_properties); |
185 void NormalizeElements(Handle<JSObject> object); | 186 void NormalizeElements(Handle<JSObject> object); |
186 void TransformToFastProperties(Handle<JSObject> object, | 187 void TransformToFastProperties(Handle<JSObject> object, |
187 int unused_property_fields); | 188 int unused_property_fields); |
188 void FlattenString(Handle<String> str); | 189 void FlattenString(Handle<String> str); |
189 | 190 |
190 Handle<Object> SetProperty(Handle<JSObject> object, | 191 Handle<Object> SetProperty(Handle<JSObject> object, |
191 Handle<String> key, | 192 Handle<String> key, |
192 Handle<Object> value, | 193 Handle<Object> value, |
193 PropertyAttributes attributes); | 194 PropertyAttributes attributes); |
194 | 195 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 330 |
330 | 331 |
331 // ---------------------------------------------------------------------------- | 332 // ---------------------------------------------------------------------------- |
332 | 333 |
333 | 334 |
334 // Stack allocated wrapper call for optimizing adding multiple | 335 // Stack allocated wrapper call for optimizing adding multiple |
335 // properties to an object. | 336 // properties to an object. |
336 class OptimizedObjectForAddingMultipleProperties BASE_EMBEDDED { | 337 class OptimizedObjectForAddingMultipleProperties BASE_EMBEDDED { |
337 public: | 338 public: |
338 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, | 339 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, |
| 340 int expected_property_count, |
339 bool condition = true); | 341 bool condition = true); |
340 ~OptimizedObjectForAddingMultipleProperties(); | 342 ~OptimizedObjectForAddingMultipleProperties(); |
341 private: | 343 private: |
342 bool has_been_transformed_; // Tells whether the object has been transformed. | 344 bool has_been_transformed_; // Tells whether the object has been transformed. |
343 int unused_property_fields_; // Captures the unused number of field. | 345 int unused_property_fields_; // Captures the unused number of field. |
344 Handle<JSObject> object_; // The object being optimized. | 346 Handle<JSObject> object_; // The object being optimized. |
345 }; | 347 }; |
346 | 348 |
347 | 349 |
348 } } // namespace v8::internal | 350 } } // namespace v8::internal |
349 | 351 |
350 #endif // V8_HANDLES_H_ | 352 #endif // V8_HANDLES_H_ |
OLD | NEW |