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

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

Issue 6580038: [Isolates] Merge from bleeding_edge, revisions 5934-6100. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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') | src/string.js » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2010 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
11 // with the distribution. 11 // with the distribution.
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 474
475 475
476 void LargeObjectChunk::Free(Executability executable) { 476 void LargeObjectChunk::Free(Executability executable) {
477 Isolate* isolate = 477 Isolate* isolate =
478 Page::FromAddress(RoundUp(address(), Page::kPageSize))->heap_->isolate(); 478 Page::FromAddress(RoundUp(address(), Page::kPageSize))->heap_->isolate();
479 isolate->memory_allocator()->FreeRawMemory(address(), size(), executable); 479 isolate->memory_allocator()->FreeRawMemory(address(), size(), executable);
480 } 480 }
481 481
482 // ----------------------------------------------------------------------------- 482 // -----------------------------------------------------------------------------
483 // LargeObjectSpace 483 // NewSpace
484 484
485 MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes, 485 MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes,
486 AllocationInfo* alloc_info) { 486 AllocationInfo* alloc_info) {
487 Address new_top = alloc_info->top + size_in_bytes; 487 Address new_top = alloc_info->top + size_in_bytes;
488 if (new_top > alloc_info->limit) return Failure::RetryAfterGC(); 488 if (new_top > alloc_info->limit) return Failure::RetryAfterGC();
489 489
490 Object* obj = HeapObject::FromAddress(alloc_info->top); 490 Object* obj = HeapObject::FromAddress(alloc_info->top);
491 alloc_info->top = new_top; 491 alloc_info->top = new_top;
492 #ifdef DEBUG 492 #ifdef DEBUG
493 SemiSpace* space = 493 SemiSpace* space =
494 (alloc_info == &allocation_info_) ? &to_space_ : &from_space_; 494 (alloc_info == &allocation_info_) ? &to_space_ : &from_space_;
495 ASSERT(space->low() <= alloc_info->top 495 ASSERT(space->low() <= alloc_info->top
496 && alloc_info->top <= space->high() 496 && alloc_info->top <= space->high()
497 && alloc_info->limit == space->high()); 497 && alloc_info->limit == space->high());
498 #endif 498 #endif
499 return obj; 499 return obj;
500 } 500 }
501 501
502 502
503 intptr_t LargeObjectSpace::Available() { 503 intptr_t LargeObjectSpace::Available() {
504 return LargeObjectChunk::ObjectSizeFor( 504 return LargeObjectChunk::ObjectSizeFor(
505 heap()->isolate()->memory_allocator()->Available()); 505 heap()->isolate()->memory_allocator()->Available());
506 } 506 }
507 507
508 508
509 template <typename StringType>
510 void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) {
511 ASSERT(length <= string->length());
512 ASSERT(string->IsSeqString());
513 ASSERT(string->address() + StringType::SizeFor(string->length()) ==
514 allocation_info_.top);
515 allocation_info_.top =
516 string->address() + StringType::SizeFor(length);
517 string->set_length(length);
518 }
519
520
509 bool FreeListNode::IsFreeListNode(HeapObject* object) { 521 bool FreeListNode::IsFreeListNode(HeapObject* object) {
510 return object->map() == HEAP->raw_unchecked_byte_array_map() 522 return object->map() == HEAP->raw_unchecked_byte_array_map()
511 || object->map() == HEAP->raw_unchecked_one_pointer_filler_map() 523 || object->map() == HEAP->raw_unchecked_one_pointer_filler_map()
512 || object->map() == HEAP->raw_unchecked_two_pointer_filler_map(); 524 || object->map() == HEAP->raw_unchecked_two_pointer_filler_map();
513 } 525 }
514 526
515 } } // namespace v8::internal 527 } } // namespace v8::internal
516 528
517 #endif // V8_SPACES_INL_H_ 529 #endif // V8_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698