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

Side by Side Diff: src/objects.cc

Issue 10912049: Only regenerate enumeration indices if properties were deleted. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 12516 matching lines...) Expand 10 before | Expand all | Expand 10 after
12527 } 12527 }
12528 Heap* heap = Dictionary<Shape, Key>::GetHeap(); 12528 Heap* heap = Dictionary<Shape, Key>::GetHeap();
12529 return heap->undefined_value(); 12529 return heap->undefined_value();
12530 } 12530 }
12531 12531
12532 12532
12533 MaybeObject* StringDictionary::TransformPropertiesToFastFor( 12533 MaybeObject* StringDictionary::TransformPropertiesToFastFor(
12534 JSObject* obj, int unused_property_fields) { 12534 JSObject* obj, int unused_property_fields) {
12535 // Make sure we preserve dictionary representation if there are too many 12535 // Make sure we preserve dictionary representation if there are too many
12536 // descriptors. 12536 // descriptors.
12537 if (NumberOfElements() > DescriptorArray::kMaxNumberOfDescriptors) return obj; 12537 int number_of_elements = NumberOfElements();
12538 if (number_of_elements > DescriptorArray::kMaxNumberOfDescriptors) return obj;
12538 12539
12539 MaybeObject* maybe_result = GenerateNewEnumerationIndices(); 12540 if (number_of_elements != NextEnumerationIndex()) {
12540 if (maybe_result->IsFailure()) return maybe_result; 12541 MaybeObject* maybe_result = GenerateNewEnumerationIndices();
12542 if (maybe_result->IsFailure()) return maybe_result;
12543 }
12541 12544
12542 int instance_descriptor_length = 0; 12545 int instance_descriptor_length = 0;
12543 int number_of_fields = 0; 12546 int number_of_fields = 0;
12544 12547
12545 Heap* heap = GetHeap(); 12548 Heap* heap = GetHeap();
12546 12549
12547 // Compute the length of the instance descriptor. 12550 // Compute the length of the instance descriptor.
12548 int capacity = Capacity(); 12551 int capacity = Capacity();
12549 for (int i = 0; i < capacity; i++) { 12552 for (int i = 0; i < capacity; i++) {
12550 Object* k = KeyAt(i); 12553 Object* k = KeyAt(i);
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
13168 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13171 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13169 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13172 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13170 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13173 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13171 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13174 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13172 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13175 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13173 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13176 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13174 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13177 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13175 } 13178 }
13176 13179
13177 } } // namespace v8::internal 13180 } } // 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