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

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

Issue 3781020: Return false from PagedSpace::Contains is the page from an address is not val... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 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.h ('k') | 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 400 }
401 401
402 #endif 402 #endif
403 403
404 404
405 // -------------------------------------------------------------------------- 405 // --------------------------------------------------------------------------
406 // PagedSpace 406 // PagedSpace
407 407
408 bool PagedSpace::Contains(Address addr) { 408 bool PagedSpace::Contains(Address addr) {
409 Page* p = Page::FromAddress(addr); 409 Page* p = Page::FromAddress(addr);
410 ASSERT(p->is_valid()); 410 if (!p->is_valid()) return false;
411
412 return MemoryAllocator::IsPageInSpace(p, this); 411 return MemoryAllocator::IsPageInSpace(p, this);
413 } 412 }
414 413
415 414
416 // Try linear allocation in the page of alloc_info's allocation top. Does 415 // Try linear allocation in the page of alloc_info's allocation top. Does
417 // not contain slow case logic (eg, move to the next page or try free list 416 // not contain slow case logic (eg, move to the next page or try free list
418 // allocation) so it can be used by all the allocation functions and for all 417 // allocation) so it can be used by all the allocation functions and for all
419 // the paged spaces. 418 // the paged spaces.
420 HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info, 419 HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info,
421 int size_in_bytes) { 420 int size_in_bytes) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 491
493 bool FreeListNode::IsFreeListNode(HeapObject* object) { 492 bool FreeListNode::IsFreeListNode(HeapObject* object) {
494 return object->map() == Heap::raw_unchecked_byte_array_map() 493 return object->map() == Heap::raw_unchecked_byte_array_map()
495 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() 494 || object->map() == Heap::raw_unchecked_one_pointer_filler_map()
496 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); 495 || object->map() == Heap::raw_unchecked_two_pointer_filler_map();
497 } 496 }
498 497
499 } } // namespace v8::internal 498 } } // namespace v8::internal
500 499
501 #endif // V8_SPACES_INL_H_ 500 #endif // V8_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698