| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 if (count > in_object_properties) { | 2290 if (count > in_object_properties) { |
| 2291 count = in_object_properties; | 2291 count = in_object_properties; |
| 2292 } | 2292 } |
| 2293 Object* descriptors_obj = DescriptorArray::Allocate(count); | 2293 Object* descriptors_obj = DescriptorArray::Allocate(count); |
| 2294 if (descriptors_obj->IsFailure()) return descriptors_obj; | 2294 if (descriptors_obj->IsFailure()) return descriptors_obj; |
| 2295 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); | 2295 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); |
| 2296 for (int i = 0; i < count; i++) { | 2296 for (int i = 0; i < count; i++) { |
| 2297 String* name = fun->shared()->GetThisPropertyAssignmentName(i); | 2297 String* name = fun->shared()->GetThisPropertyAssignmentName(i); |
| 2298 ASSERT(name->IsSymbol()); | 2298 ASSERT(name->IsSymbol()); |
| 2299 FieldDescriptor field(name, i, NONE); | 2299 FieldDescriptor field(name, i, NONE); |
| 2300 field.SetEnumerationIndex(i); |
| 2300 descriptors->Set(i, &field); | 2301 descriptors->Set(i, &field); |
| 2301 } | 2302 } |
| 2303 descriptors->SetNextEnumerationIndex(count); |
| 2302 descriptors->Sort(); | 2304 descriptors->Sort(); |
| 2303 map->set_instance_descriptors(descriptors); | 2305 map->set_instance_descriptors(descriptors); |
| 2304 map->set_pre_allocated_property_fields(count); | 2306 map->set_pre_allocated_property_fields(count); |
| 2305 map->set_unused_property_fields(in_object_properties - count); | 2307 map->set_unused_property_fields(in_object_properties - count); |
| 2306 } | 2308 } |
| 2307 return map; | 2309 return map; |
| 2308 } | 2310 } |
| 2309 | 2311 |
| 2310 | 2312 |
| 2311 void Heap::InitializeJSObjectFromMap(JSObject* obj, | 2313 void Heap::InitializeJSObjectFromMap(JSObject* obj, |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4102 for (int i = 0; i < kNumberOfCaches; i++) { | 4104 for (int i = 0; i < kNumberOfCaches; i++) { |
| 4103 if (caches_[i] != NULL) { | 4105 if (caches_[i] != NULL) { |
| 4104 delete caches_[i]; | 4106 delete caches_[i]; |
| 4105 caches_[i] = NULL; | 4107 caches_[i] = NULL; |
| 4106 } | 4108 } |
| 4107 } | 4109 } |
| 4108 } | 4110 } |
| 4109 | 4111 |
| 4110 | 4112 |
| 4111 } } // namespace v8::internal | 4113 } } // namespace v8::internal |
| OLD | NEW |