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 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2399 if (count > in_object_properties) { | 2399 if (count > in_object_properties) { |
2400 count = in_object_properties; | 2400 count = in_object_properties; |
2401 } | 2401 } |
2402 Object* descriptors_obj = DescriptorArray::Allocate(count); | 2402 Object* descriptors_obj = DescriptorArray::Allocate(count); |
2403 if (descriptors_obj->IsFailure()) return descriptors_obj; | 2403 if (descriptors_obj->IsFailure()) return descriptors_obj; |
2404 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); | 2404 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); |
2405 for (int i = 0; i < count; i++) { | 2405 for (int i = 0; i < count; i++) { |
2406 String* name = fun->shared()->GetThisPropertyAssignmentName(i); | 2406 String* name = fun->shared()->GetThisPropertyAssignmentName(i); |
2407 ASSERT(name->IsSymbol()); | 2407 ASSERT(name->IsSymbol()); |
2408 FieldDescriptor field(name, i, NONE); | 2408 FieldDescriptor field(name, i, NONE); |
| 2409 field.SetEnumerationIndex(i); |
2409 descriptors->Set(i, &field); | 2410 descriptors->Set(i, &field); |
2410 } | 2411 } |
| 2412 descriptors->SetNextEnumerationIndex(count); |
2411 descriptors->Sort(); | 2413 descriptors->Sort(); |
2412 map->set_instance_descriptors(descriptors); | 2414 map->set_instance_descriptors(descriptors); |
2413 map->set_pre_allocated_property_fields(count); | 2415 map->set_pre_allocated_property_fields(count); |
2414 map->set_unused_property_fields(in_object_properties - count); | 2416 map->set_unused_property_fields(in_object_properties - count); |
2415 } | 2417 } |
2416 return map; | 2418 return map; |
2417 } | 2419 } |
2418 | 2420 |
2419 | 2421 |
2420 void Heap::InitializeJSObjectFromMap(JSObject* obj, | 2422 void Heap::InitializeJSObjectFromMap(JSObject* obj, |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4222 void ExternalStringTable::TearDown() { | 4224 void ExternalStringTable::TearDown() { |
4223 new_space_strings_.Free(); | 4225 new_space_strings_.Free(); |
4224 old_space_strings_.Free(); | 4226 old_space_strings_.Free(); |
4225 } | 4227 } |
4226 | 4228 |
4227 | 4229 |
4228 List<Object*> ExternalStringTable::new_space_strings_; | 4230 List<Object*> ExternalStringTable::new_space_strings_; |
4229 List<Object*> ExternalStringTable::old_space_strings_; | 4231 List<Object*> ExternalStringTable::old_space_strings_; |
4230 | 4232 |
4231 } } // namespace v8::internal | 4233 } } // namespace v8::internal |
OLD | NEW |