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

Side by Side Diff: src/heap.cc

Issue 23903008: Drop OS::IsOutsideAllocatedSpace() and move the tracking to the MemoryAllocator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | src/platform.h » ('j') | src/platform-linux.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 6151 matching lines...) Expand 10 before | Expand all | Expand 10 after
6162 } 6162 }
6163 6163
6164 #endif // DEBUG 6164 #endif // DEBUG
6165 6165
6166 bool Heap::Contains(HeapObject* value) { 6166 bool Heap::Contains(HeapObject* value) {
6167 return Contains(value->address()); 6167 return Contains(value->address());
6168 } 6168 }
6169 6169
6170 6170
6171 bool Heap::Contains(Address addr) { 6171 bool Heap::Contains(Address addr) {
6172 if (OS::IsOutsideAllocatedSpace(addr)) return false; 6172 if (isolate_->memory_allocator()->IsOutsideAllocatedSpace(addr)) return false;
6173 return HasBeenSetUp() && 6173 return HasBeenSetUp() &&
6174 (new_space_.ToSpaceContains(addr) || 6174 (new_space_.ToSpaceContains(addr) ||
6175 old_pointer_space_->Contains(addr) || 6175 old_pointer_space_->Contains(addr) ||
6176 old_data_space_->Contains(addr) || 6176 old_data_space_->Contains(addr) ||
6177 code_space_->Contains(addr) || 6177 code_space_->Contains(addr) ||
6178 map_space_->Contains(addr) || 6178 map_space_->Contains(addr) ||
6179 cell_space_->Contains(addr) || 6179 cell_space_->Contains(addr) ||
6180 property_cell_space_->Contains(addr) || 6180 property_cell_space_->Contains(addr) ||
6181 lo_space_->SlowContains(addr)); 6181 lo_space_->SlowContains(addr));
6182 } 6182 }
6183 6183
6184 6184
6185 bool Heap::InSpace(HeapObject* value, AllocationSpace space) { 6185 bool Heap::InSpace(HeapObject* value, AllocationSpace space) {
6186 return InSpace(value->address(), space); 6186 return InSpace(value->address(), space);
6187 } 6187 }
6188 6188
6189 6189
6190 bool Heap::InSpace(Address addr, AllocationSpace space) { 6190 bool Heap::InSpace(Address addr, AllocationSpace space) {
6191 if (OS::IsOutsideAllocatedSpace(addr)) return false; 6191 if (isolate_->memory_allocator()->IsOutsideAllocatedSpace(addr)) return false;
6192 if (!HasBeenSetUp()) return false; 6192 if (!HasBeenSetUp()) return false;
6193 6193
6194 switch (space) { 6194 switch (space) {
6195 case NEW_SPACE: 6195 case NEW_SPACE:
6196 return new_space_.ToSpaceContains(addr); 6196 return new_space_.ToSpaceContains(addr);
6197 case OLD_POINTER_SPACE: 6197 case OLD_POINTER_SPACE:
6198 return old_pointer_space_->Contains(addr); 6198 return old_pointer_space_->Contains(addr);
6199 case OLD_DATA_SPACE: 6199 case OLD_DATA_SPACE:
6200 return old_data_space_->Contains(addr); 6200 return old_data_space_->Contains(addr);
6201 case CODE_SPACE: 6201 case CODE_SPACE:
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
8060 if (FLAG_concurrent_recompilation) { 8060 if (FLAG_concurrent_recompilation) {
8061 heap_->relocation_mutex_->Lock(); 8061 heap_->relocation_mutex_->Lock();
8062 #ifdef DEBUG 8062 #ifdef DEBUG
8063 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8063 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8064 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8064 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8065 #endif // DEBUG 8065 #endif // DEBUG
8066 } 8066 }
8067 } 8067 }
8068 8068
8069 } } // namespace v8::internal 8069 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/platform.h » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698