Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: src/heap.cc

Issue 332007: Fix issue with running some constructors having only this.x = ... assignments (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-483.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_this_property_assignments() &&
Mads Ager (chromium) 2009/10/23 12:17:40 Does has_only_simple_this_property_assignments imp
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()) {
2261 int count = fun->shared()->this_property_assignments_count(); 2262 int count = fun->shared()->this_property_assignments_count();
2262 if (count > in_object_properties) { 2263 if (count > in_object_properties) {
2263 count = in_object_properties; 2264 count = in_object_properties;
2264 } 2265 }
2265 Object* descriptors_obj = DescriptorArray::Allocate(count); 2266 Object* descriptors_obj = DescriptorArray::Allocate(count);
2266 if (descriptors_obj->IsFailure()) return descriptors_obj; 2267 if (descriptors_obj->IsFailure()) return descriptors_obj;
2267 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); 2268 DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj);
2268 for (int i = 0; i < count; i++) { 2269 for (int i = 0; i < count; i++) {
2269 String* name = fun->shared()->GetThisPropertyAssignmentName(i); 2270 String* name = fun->shared()->GetThisPropertyAssignmentName(i);
2270 ASSERT(name->IsSymbol()); 2271 ASSERT(name->IsSymbol());
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
4035 for (int i = 0; i < kNumberOfCaches; i++) { 4036 for (int i = 0; i < kNumberOfCaches; i++) {
4036 if (caches_[i] != NULL) { 4037 if (caches_[i] != NULL) {
4037 delete caches_[i]; 4038 delete caches_[i];
4038 caches_[i] = NULL; 4039 caches_[i] = NULL;
4039 } 4040 }
4040 } 4041 }
4041 } 4042 }
4042 4043
4043 4044
4044 } } // namespace v8::internal 4045 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-483.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698