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 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 } | 2277 } |
2278 | 2278 |
2279 | 2279 |
2280 MaybeObject* JSObject::NormalizeProperties(PropertyNormalizationMode mode, | 2280 MaybeObject* JSObject::NormalizeProperties(PropertyNormalizationMode mode, |
2281 int expected_additional_properties) { | 2281 int expected_additional_properties) { |
2282 if (!HasFastProperties()) return this; | 2282 if (!HasFastProperties()) return this; |
2283 | 2283 |
2284 // The global object is always normalized. | 2284 // The global object is always normalized. |
2285 ASSERT(!IsGlobalObject()); | 2285 ASSERT(!IsGlobalObject()); |
2286 | 2286 |
| 2287 // JSGlobalProxy must never be normalized |
| 2288 ASSERT(!IsJSGlobalProxy()); |
| 2289 |
2287 // Allocate new content. | 2290 // Allocate new content. |
2288 int property_count = map()->NumberOfDescribedProperties(); | 2291 int property_count = map()->NumberOfDescribedProperties(); |
2289 if (expected_additional_properties > 0) { | 2292 if (expected_additional_properties > 0) { |
2290 property_count += expected_additional_properties; | 2293 property_count += expected_additional_properties; |
2291 } else { | 2294 } else { |
2292 property_count += 2; // Make space for two more properties. | 2295 property_count += 2; // Make space for two more properties. |
2293 } | 2296 } |
2294 Object* obj; | 2297 Object* obj; |
2295 { MaybeObject* maybe_obj = | 2298 { MaybeObject* maybe_obj = |
2296 StringDictionary::Allocate(property_count); | 2299 StringDictionary::Allocate(property_count); |
(...skipping 7570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9867 if (break_point_objects()->IsUndefined()) return 0; | 9870 if (break_point_objects()->IsUndefined()) return 0; |
9868 // Single beak point. | 9871 // Single beak point. |
9869 if (!break_point_objects()->IsFixedArray()) return 1; | 9872 if (!break_point_objects()->IsFixedArray()) return 1; |
9870 // Multiple break points. | 9873 // Multiple break points. |
9871 return FixedArray::cast(break_point_objects())->length(); | 9874 return FixedArray::cast(break_point_objects())->length(); |
9872 } | 9875 } |
9873 #endif | 9876 #endif |
9874 | 9877 |
9875 | 9878 |
9876 } } // namespace v8::internal | 9879 } } // namespace v8::internal |
OLD | NEW |