OLD | NEW |
1 // Copyright 2006-2010 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 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 bool Heap::InNewSpace(Object* object) { | 245 bool Heap::InNewSpace(Object* object) { |
246 bool result = new_space_.Contains(object); | 246 bool result = new_space_.Contains(object); |
247 ASSERT(!result || // Either not in new space | 247 ASSERT(!result || // Either not in new space |
248 gc_state_ != NOT_IN_GC || // ... or in the middle of GC | 248 gc_state_ != NOT_IN_GC || // ... or in the middle of GC |
249 InToSpace(object)); // ... or in to-space (where we allocate). | 249 InToSpace(object)); // ... or in to-space (where we allocate). |
250 return result; | 250 return result; |
251 } | 251 } |
252 | 252 |
253 | 253 |
| 254 bool Heap::InNewSpace(Address addr) { |
| 255 return new_space_.Contains(addr); |
| 256 } |
| 257 |
| 258 |
254 bool Heap::InFromSpace(Object* object) { | 259 bool Heap::InFromSpace(Object* object) { |
255 return new_space_.FromSpaceContains(object); | 260 return new_space_.FromSpaceContains(object); |
256 } | 261 } |
257 | 262 |
258 | 263 |
259 bool Heap::InToSpace(Object* object) { | 264 bool Heap::InToSpace(Object* object) { |
260 return new_space_.ToSpaceContains(object); | 265 return new_space_.ToSpaceContains(object); |
261 } | 266 } |
262 | 267 |
263 | 268 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 591 |
587 | 592 |
588 void ExternalStringTable::ShrinkNewStrings(int position) { | 593 void ExternalStringTable::ShrinkNewStrings(int position) { |
589 new_space_strings_.Rewind(position); | 594 new_space_strings_.Rewind(position); |
590 Verify(); | 595 Verify(); |
591 } | 596 } |
592 | 597 |
593 } } // namespace v8::internal | 598 } } // namespace v8::internal |
594 | 599 |
595 #endif // V8_HEAP_INL_H_ | 600 #endif // V8_HEAP_INL_H_ |
OLD | NEW |