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 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 } | 2249 } |
2250 Map* map = Map::cast(map_obj); | 2250 Map* map = Map::cast(map_obj); |
2251 map->set_inobject_properties(in_object_properties); | 2251 map->set_inobject_properties(in_object_properties); |
2252 map->set_unused_property_fields(in_object_properties); | 2252 map->set_unused_property_fields(in_object_properties); |
2253 map->set_prototype(prototype); | 2253 map->set_prototype(prototype); |
2254 | 2254 |
2255 // If the function has only simple this property assignments add field | 2255 // If the function has only simple this property assignments add field |
2256 // descriptors for these to the initial map as the object cannot be | 2256 // descriptors for these to the initial map as the object cannot be |
2257 // constructed without having these properties. | 2257 // constructed without having these properties. |
2258 ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); | 2258 ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); |
2259 if (fun->shared()->has_only_this_property_assignments() && | 2259 if (fun->shared()->has_only_simple_this_property_assignments() && |
2260 fun->shared()->this_property_assignments_count() > 0 && | 2260 fun->shared()->this_property_assignments_count() > 0) { |
2261 fun->shared()->has_only_simple_this_property_assignments()) { | |
2262 int count = fun->shared()->this_property_assignments_count(); | 2261 int count = fun->shared()->this_property_assignments_count(); |
2263 if (count > in_object_properties) { | 2262 if (count > in_object_properties) { |
2264 count = in_object_properties; | 2263 count = in_object_properties; |
2265 } | 2264 } |
2266 Object* descriptors_obj = DescriptorArray::Allocate(count); | 2265 Object* descriptors_obj = DescriptorArray::Allocate(count); |
2267 if (descriptors_obj->IsFailure()) return descriptors_obj; | 2266 if (descriptors_obj->IsFailure()) return descriptors_obj; |
2268 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); | 2267 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); |
2269 for (int i = 0; i < count; i++) { | 2268 for (int i = 0; i < count; i++) { |
2270 String* name = fun->shared()->GetThisPropertyAssignmentName(i); | 2269 String* name = fun->shared()->GetThisPropertyAssignmentName(i); |
2271 ASSERT(name->IsSymbol()); | 2270 ASSERT(name->IsSymbol()); |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4036 for (int i = 0; i < kNumberOfCaches; i++) { | 4035 for (int i = 0; i < kNumberOfCaches; i++) { |
4037 if (caches_[i] != NULL) { | 4036 if (caches_[i] != NULL) { |
4038 delete caches_[i]; | 4037 delete caches_[i]; |
4039 caches_[i] = NULL; | 4038 caches_[i] = NULL; |
4040 } | 4039 } |
4041 } | 4040 } |
4042 } | 4041 } |
4043 | 4042 |
4044 | 4043 |
4045 } } // namespace v8::internal | 4044 } } // namespace v8::internal |
OLD | NEW |