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

Side by Side Diff: src/objects.cc

Issue 10907233: Merged r12485, r12486, r12491, r12494, r12495 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
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 | « src/objects.h ('k') | src/version.cc » ('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 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; 480 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value;
481 } 481 }
482 Object* dict; 482 Object* dict;
483 { MaybeObject* maybe_dict = 483 { MaybeObject* maybe_dict =
484 property_dictionary()->Add(name, store_value, details); 484 property_dictionary()->Add(name, store_value, details);
485 if (!maybe_dict->ToObject(&dict)) return maybe_dict; 485 if (!maybe_dict->ToObject(&dict)) return maybe_dict;
486 } 486 }
487 set_properties(StringDictionary::cast(dict)); 487 set_properties(StringDictionary::cast(dict));
488 return value; 488 return value;
489 } 489 }
490 // Preserve enumeration index. 490
491 PropertyDetails original_details = property_dictionary()->DetailsAt(entry);
492 int enumeration_index;
493 // Preserve the enumeration index unless the property was deleted.
494 if (original_details.IsDeleted()) {
495 enumeration_index = property_dictionary()->NextEnumerationIndex();
496 property_dictionary()->SetNextEnumerationIndex(enumeration_index + 1);
497 } else {
498 enumeration_index = original_details.dictionary_index();
499 ASSERT(enumeration_index > 0);
500 }
501
491 details = PropertyDetails( 502 details = PropertyDetails(
492 details.attributes(), 503 details.attributes(), details.type(), enumeration_index);
493 details.type(),
494 property_dictionary()->DetailsAt(entry).dictionary_index());
495 504
496 if (IsGlobalObject()) { 505 if (IsGlobalObject()) {
497 JSGlobalPropertyCell* cell = 506 JSGlobalPropertyCell* cell =
498 JSGlobalPropertyCell::cast(property_dictionary()->ValueAt(entry)); 507 JSGlobalPropertyCell::cast(property_dictionary()->ValueAt(entry));
499 cell->set_value(value); 508 cell->set_value(value);
500 // Please note we have to update the property details. 509 // Please note we have to update the property details.
501 property_dictionary()->DetailsAtPut(entry, details); 510 property_dictionary()->DetailsAtPut(entry, details);
502 } else { 511 } else {
503 property_dictionary()->SetEntry(entry, name, value, details); 512 property_dictionary()->SetEntry(entry, name, value, details);
504 } 513 }
(...skipping 12707 matching lines...) Expand 10 before | Expand all | Expand 10 after
13212 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13221 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13213 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13222 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13214 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13223 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13215 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13224 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13216 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13225 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13217 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13226 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13218 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13227 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13219 } 13228 }
13220 13229
13221 } } // namespace v8::internal 13230 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698