OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |