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

Side by Side Diff: src/heap.cc

Issue 10700160: Refactor copying of maps and descriptor arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
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 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after
4173 } 4173 }
4174 4174
4175 // Allocate the global object and initialize it with the backing store. 4175 // Allocate the global object and initialize it with the backing store.
4176 { MaybeObject* maybe_obj = Allocate(map, OLD_POINTER_SPACE); 4176 { MaybeObject* maybe_obj = Allocate(map, OLD_POINTER_SPACE);
4177 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 4177 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
4178 } 4178 }
4179 JSObject* global = JSObject::cast(obj); 4179 JSObject* global = JSObject::cast(obj);
4180 InitializeJSObjectFromMap(global, dictionary, map); 4180 InitializeJSObjectFromMap(global, dictionary, map);
4181 4181
4182 // Create a new map for the global object. 4182 // Create a new map for the global object.
4183 { MaybeObject* maybe_obj = map->CopyDropDescriptors(); 4183 Map* new_map;
4184 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 4184 { MaybeObject* maybe_map = map->CopyDropDescriptors();
4185 if (!maybe_map->To(&new_map)) return maybe_map;
4185 } 4186 }
4186 Map* new_map = Map::cast(obj);
4187 4187
4188 // Set up the global object as a normalized object. 4188 // Set up the global object as a normalized object.
4189 global->set_map(new_map); 4189 global->set_map(new_map);
4190 global->set_properties(dictionary); 4190 global->set_properties(dictionary);
4191 4191
4192 // Make sure result is a global object with properties in dictionary. 4192 // Make sure result is a global object with properties in dictionary.
4193 ASSERT(global->IsGlobalObject()); 4193 ASSERT(global->IsGlobalObject());
4194 ASSERT(!global->HasFastProperties()); 4194 ASSERT(!global->HasFastProperties());
4195 return global; 4195 return global;
4196 } 4196 }
(...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after
7219 } else { 7219 } else {
7220 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7220 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7221 } 7221 }
7222 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7222 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7223 reinterpret_cast<Address>(p); 7223 reinterpret_cast<Address>(p);
7224 remembered_unmapped_pages_index_++; 7224 remembered_unmapped_pages_index_++;
7225 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7225 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7226 } 7226 }
7227 7227
7228 } } // namespace v8::internal 7228 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698