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

Side by Side Diff: src/objects.cc

Issue 10905266: Directly set the value in the descriptors pointer to avoid checks. (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 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 1803
1804 // TODO(verwaest): From here on we lose existing map transitions, causing 1804 // TODO(verwaest): From here on we lose existing map transitions, causing
1805 // invalid back pointers. This will change once we can store multiple 1805 // invalid back pointers. This will change once we can store multiple
1806 // transitions with the same key. 1806 // transitions with the same key.
1807 1807
1808 if (old_map->owns_descriptors()) { 1808 if (old_map->owns_descriptors()) {
1809 // If the old map owns its own descriptors, transfer ownership to the 1809 // If the old map owns its own descriptors, transfer ownership to the
1810 // new_map and install its descriptors in the old_map. Since the old_map 1810 // new_map and install its descriptors in the old_map. Since the old_map
1811 // stores the descriptors for the new_map, remove the transition array of 1811 // stores the descriptors for the new_map, remove the transition array of
1812 // the new_map that is only in place to store the descriptors. 1812 // the new_map that is only in place to store the descriptors.
1813 old_map->transitions()->set_descriptors(new_map->instance_descriptors()); 1813 old_map->transitions()->descriptors_pointer()->set_value(
1814 new_map->instance_descriptors());
1814 new_map->ClearTransitions(GetHeap()); 1815 new_map->ClearTransitions(GetHeap());
1815 old_map->set_owns_descriptors(false); 1816 old_map->set_owns_descriptors(false);
1816 Map* map; 1817 Map* map;
1817 JSGlobalPropertyCell* pointer = 1818 JSGlobalPropertyCell* pointer =
1818 old_map->transitions()->descriptors_pointer(); 1819 old_map->transitions()->descriptors_pointer();
1819 for (Object* current = old_map; 1820 for (Object* current = old_map;
1820 !current->IsUndefined(); 1821 !current->IsUndefined();
1821 current = map->GetBackPointer()) { 1822 current = map->GetBackPointer()) {
1822 map = Map::cast(current); 1823 map = Map::cast(current);
1823 if (!map->HasTransitionArray()) break; 1824 if (!map->HasTransitionArray()) break;
(...skipping 11667 matching lines...) Expand 10 before | Expand all | Expand 10 after
13491 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13492 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13492 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13493 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13493 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13494 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13494 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13495 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13495 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13496 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13496 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13497 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13497 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13498 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13498 } 13499 }
13499 13500
13500 } } // namespace v8::internal 13501 } } // 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