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

Side by Side Diff: src/objects.cc

Issue 10828112: Don't leak inobject space when transforming to fast properties without descriptors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 12559 matching lines...) Expand 10 before | Expand all | Expand 10 after
12570 int inobject_props = obj->map()->inobject_properties(); 12570 int inobject_props = obj->map()->inobject_properties();
12571 12571
12572 // Allocate new map. 12572 // Allocate new map.
12573 Map* new_map; 12573 Map* new_map;
12574 MaybeObject* maybe_new_map = obj->map()->CopyDropDescriptors(); 12574 MaybeObject* maybe_new_map = obj->map()->CopyDropDescriptors();
12575 if (!maybe_new_map->To(&new_map)) return maybe_new_map; 12575 if (!maybe_new_map->To(&new_map)) return maybe_new_map;
12576 12576
12577 if (instance_descriptor_length == 0) { 12577 if (instance_descriptor_length == 0) {
12578 ASSERT_LE(unused_property_fields, inobject_props); 12578 ASSERT_LE(unused_property_fields, inobject_props);
12579 // Transform the object. 12579 // Transform the object.
12580 new_map->set_unused_property_fields(unused_property_fields); 12580 new_map->set_unused_property_fields(inobject_props);
12581 obj->set_map(new_map); 12581 obj->set_map(new_map);
12582 obj->set_properties(heap->empty_fixed_array()); 12582 obj->set_properties(heap->empty_fixed_array());
12583 // Check that it really works. 12583 // Check that it really works.
12584 ASSERT(obj->HasFastProperties()); 12584 ASSERT(obj->HasFastProperties());
12585 return obj; 12585 return obj;
12586 } 12586 }
12587 12587
12588 // Allocate the instance descriptor. 12588 // Allocate the instance descriptor.
12589 DescriptorArray* descriptors; 12589 DescriptorArray* descriptors;
12590 MaybeObject* maybe_descriptors = 12590 MaybeObject* maybe_descriptors =
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
13174 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13174 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13175 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13175 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13176 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13176 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13177 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13177 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13178 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13178 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13179 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13179 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13180 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13180 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13181 } 13181 }
13182 13182
13183 } } // namespace v8::internal 13183 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698