| OLD | NEW |
| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 391 } |
| 392 | 392 |
| 393 | 393 |
| 394 NewSpacePage* NewSpacePage::Initialize(Heap* heap, Address start) { | 394 NewSpacePage* NewSpacePage::Initialize(Heap* heap, Address start) { |
| 395 MemoryChunk* chunk = MemoryChunk::Initialize(heap, | 395 MemoryChunk* chunk = MemoryChunk::Initialize(heap, |
| 396 start, | 396 start, |
| 397 Page::kPageSize, | 397 Page::kPageSize, |
| 398 NOT_EXECUTABLE, | 398 NOT_EXECUTABLE, |
| 399 heap->new_space()); | 399 heap->new_space()); |
| 400 chunk->initialize_scan_on_scavenge(true); | 400 chunk->initialize_scan_on_scavenge(true); |
| 401 chunk->SetFlag(MemoryChunk::IN_NEW_SPACE); |
| 401 heap->incremental_marking()->SetNewSpacePageFlags(chunk); | 402 heap->incremental_marking()->SetNewSpacePageFlags(chunk); |
| 402 return static_cast<NewSpacePage*>(chunk); | 403 return static_cast<NewSpacePage*>(chunk); |
| 403 } | 404 } |
| 404 | 405 |
| 405 | 406 |
| 406 MemoryChunk* MemoryChunk::Initialize(Heap* heap, | 407 MemoryChunk* MemoryChunk::Initialize(Heap* heap, |
| 407 Address base, | 408 Address base, |
| 408 size_t size, | 409 size_t size, |
| 409 Executability executable, | 410 Executability executable, |
| 410 Space* owner) { | 411 Space* owner) { |
| (...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 page_count_--; | 2167 page_count_--; |
| 2167 | 2168 |
| 2168 heap()->isolate()->memory_allocator()->Free(page); | 2169 heap()->isolate()->memory_allocator()->Free(page); |
| 2169 } | 2170 } |
| 2170 } | 2171 } |
| 2171 } | 2172 } |
| 2172 | 2173 |
| 2173 | 2174 |
| 2174 bool LargeObjectSpace::Contains(HeapObject* object) { | 2175 bool LargeObjectSpace::Contains(HeapObject* object) { |
| 2175 Address address = object->address(); | 2176 Address address = object->address(); |
| 2176 if (heap()->new_space()->Contains(address)) { | |
| 2177 return false; | |
| 2178 } | |
| 2179 MemoryChunk* chunk = MemoryChunk::FromAddress(address); | 2177 MemoryChunk* chunk = MemoryChunk::FromAddress(address); |
| 2180 | 2178 |
| 2181 bool owned = chunk->owner() == this; | 2179 bool owned = (chunk->owner() == this); |
| 2182 | 2180 |
| 2183 SLOW_ASSERT(!owned | 2181 SLOW_ASSERT(!owned |
| 2184 || !FindObject(address)->IsFailure()); | 2182 || !FindObject(address)->IsFailure()); |
| 2185 | 2183 |
| 2186 return owned; | 2184 return owned; |
| 2187 } | 2185 } |
| 2188 | 2186 |
| 2189 | 2187 |
| 2190 #ifdef DEBUG | 2188 #ifdef DEBUG |
| 2191 // We do not assume that the large object iterator works, because it depends | 2189 // We do not assume that the large object iterator works, because it depends |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2267 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 2265 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
| 2268 if (obj->IsCode()) { | 2266 if (obj->IsCode()) { |
| 2269 Code* code = Code::cast(obj); | 2267 Code* code = Code::cast(obj); |
| 2270 isolate->code_kind_statistics()[code->kind()] += code->Size(); | 2268 isolate->code_kind_statistics()[code->kind()] += code->Size(); |
| 2271 } | 2269 } |
| 2272 } | 2270 } |
| 2273 } | 2271 } |
| 2274 #endif // DEBUG | 2272 #endif // DEBUG |
| 2275 | 2273 |
| 2276 } } // namespace v8::internal | 2274 } } // namespace v8::internal |
| OLD | NEW |