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

Side by Side Diff: test/cctest/test-heap.cc

Issue 1700005: Fix bugs introduced by r4475:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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
« src/mark-compact.cc ('K') | « src/spaces.cc ('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 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 Address next_page = current_page + Page::kPageSize; 823 Address next_page = current_page + Page::kPageSize;
824 int bytes_to_page = static_cast<int>(next_page - current_top); 824 int bytes_to_page = static_cast<int>(next_page - current_top);
825 if (bytes_to_page <= FixedArray::kHeaderSize) { 825 if (bytes_to_page <= FixedArray::kHeaderSize) {
826 // Alas, need to cross another page to be able to 826 // Alas, need to cross another page to be able to
827 // put desired value. 827 // put desired value.
828 next_page += Page::kPageSize; 828 next_page += Page::kPageSize;
829 bytes_to_page = static_cast<int>(next_page - current_top); 829 bytes_to_page = static_cast<int>(next_page - current_top);
830 } 830 }
831 CHECK(bytes_to_page > FixedArray::kHeaderSize); 831 CHECK(bytes_to_page > FixedArray::kHeaderSize);
832 832
833 intptr_t* flags_ptr = &Page::FromAddress(next_page)->flags; 833 int* flags_ptr = &Page::FromAddress(next_page)->flags;
834 Address flags_addr = reinterpret_cast<Address>(flags_ptr); 834 Address flags_addr = reinterpret_cast<Address>(flags_ptr);
835 835
836 int bytes_to_allocate = 836 int bytes_to_allocate =
837 static_cast<int>(flags_addr - current_top) + kPointerSize; 837 static_cast<int>(flags_addr - current_top) + kPointerSize;
838 838
839 int n_elements = (bytes_to_allocate - FixedArray::kHeaderSize) / 839 int n_elements = (bytes_to_allocate - FixedArray::kHeaderSize) /
840 kPointerSize; 840 kPointerSize;
841 CHECK_EQ(bytes_to_allocate, FixedArray::SizeFor(n_elements)); 841 CHECK_EQ(bytes_to_allocate, FixedArray::SizeFor(n_elements));
842 FixedArray* array = FixedArray::cast( 842 FixedArray* array = FixedArray::cast(
843 Heap::AllocateFixedArray(n_elements)); 843 Heap::AllocateFixedArray(n_elements));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 CHECK(page->IsRSetSet(clone_addr, object_size - kPointerSize)); 958 CHECK(page->IsRSetSet(clone_addr, object_size - kPointerSize));
959 // Probe several addresses after the object. 959 // Probe several addresses after the object.
960 for (int i = 0; i < 7; i++) { 960 for (int i = 0; i < 7; i++) {
961 int offset = object_size + i * kPointerSize; 961 int offset = object_size + i * kPointerSize;
962 if (clone_addr + offset >= page->ObjectAreaEnd()) { 962 if (clone_addr + offset >= page->ObjectAreaEnd()) {
963 break; 963 break;
964 } 964 }
965 CHECK(!page->IsRSetSet(clone_addr, offset)); 965 CHECK(!page->IsRSetSet(clone_addr, offset));
966 } 966 }
967 } 967 }
OLDNEW
« src/mark-compact.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698