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

Side by Side Diff: src/spaces-inl.h

Issue 10918067: Refactoring of snapshots. This simplifies and improves (Closed) Base URL: http://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 | « src/spaces.cc ('k') | test/cctest/test-heap.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // Raw allocation. 262 // Raw allocation.
263 MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) { 263 MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
264 HeapObject* object = AllocateLinearly(size_in_bytes); 264 HeapObject* object = AllocateLinearly(size_in_bytes);
265 if (object != NULL) { 265 if (object != NULL) {
266 if (identity() == CODE_SPACE) { 266 if (identity() == CODE_SPACE) {
267 SkipList::Update(object->address(), size_in_bytes); 267 SkipList::Update(object->address(), size_in_bytes);
268 } 268 }
269 return object; 269 return object;
270 } 270 }
271 271
272 ASSERT(!heap()->linear_allocation() ||
273 (anchor_.next_chunk() == &anchor_ &&
274 anchor_.prev_chunk() == &anchor_));
275
272 object = free_list_.Allocate(size_in_bytes); 276 object = free_list_.Allocate(size_in_bytes);
273 if (object != NULL) { 277 if (object != NULL) {
274 if (identity() == CODE_SPACE) { 278 if (identity() == CODE_SPACE) {
275 SkipList::Update(object->address(), size_in_bytes); 279 SkipList::Update(object->address(), size_in_bytes);
276 } 280 }
277 return object; 281 return object;
278 } 282 }
279 283
280 object = SlowAllocateRaw(size_in_bytes); 284 object = SlowAllocateRaw(size_in_bytes);
281 if (object != NULL) { 285 if (object != NULL) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 Map* map = object->map(); 359 Map* map = object->map();
356 Heap* heap = object->GetHeap(); 360 Heap* heap = object->GetHeap();
357 return map == heap->raw_unchecked_free_space_map() 361 return map == heap->raw_unchecked_free_space_map()
358 || map == heap->raw_unchecked_one_pointer_filler_map() 362 || map == heap->raw_unchecked_one_pointer_filler_map()
359 || map == heap->raw_unchecked_two_pointer_filler_map(); 363 || map == heap->raw_unchecked_two_pointer_filler_map();
360 } 364 }
361 365
362 } } // namespace v8::internal 366 } } // namespace v8::internal
363 367
364 #endif // V8_SPACES_INL_H_ 368 #endif // V8_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698