Chromium Code Reviews| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 isolate_->counters()->objs_since_last_full()->Increment(); | 247 isolate_->counters()->objs_since_last_full()->Increment(); |
| 248 isolate_->counters()->objs_since_last_young()->Increment(); | 248 isolate_->counters()->objs_since_last_young()->Increment(); |
| 249 #endif | 249 #endif |
| 250 MaybeObject* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); | 250 MaybeObject* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); |
| 251 if (result->IsFailure()) old_gen_exhausted_ = true; | 251 if (result->IsFailure()) old_gen_exhausted_ = true; |
| 252 return result; | 252 return result; |
| 253 } | 253 } |
| 254 | 254 |
| 255 | 255 |
| 256 bool Heap::InNewSpace(Object* object) { | 256 bool Heap::InNewSpace(Object* object) { |
| 257 bool result = new_space_.Contains(object); | 257 bool result = new_space_.PageContains(object); |
|
Erik Corry
2011/05/19 07:22:32
Not mad keen on this name, but I guess it will go
Lasse Reichstein
2011/05/19 08:40:40
That is the idea.
If anything, this name is a lit
| |
| 258 ASSERT(!result || // Either not in new space | 258 ASSERT(!result || // Either not in new space |
| 259 gc_state_ != NOT_IN_GC || // ... or in the middle of GC | 259 gc_state_ != NOT_IN_GC || // ... or in the middle of GC |
| 260 InToSpace(object)); // ... or in to-space (where we allocate). | 260 InToSpace(object)); // ... or in to-space (where we allocate). |
| 261 return result; | 261 return result; |
| 262 } | 262 } |
| 263 | 263 |
| 264 | 264 |
| 265 bool Heap::InNewSpace(Address addr) { | 265 bool Heap::InNewSpace(Address addr) { |
| 266 return new_space_.Contains(addr); | 266 return new_space_.Contains(addr); |
| 267 } | 267 } |
| 268 | 268 |
| 269 | 269 |
| 270 bool Heap::InNewSpacePage(Address addr) { | |
| 271 return new_space_.PageContains(addr); | |
| 272 } | |
| 273 | |
| 274 | |
| 270 bool Heap::InFromSpace(Object* object) { | 275 bool Heap::InFromSpace(Object* object) { |
| 271 return new_space_.FromSpaceContains(object); | 276 return new_space_.FromSpaceContains(object); |
| 272 } | 277 } |
| 273 | 278 |
| 274 | 279 |
| 275 bool Heap::InToSpace(Object* object) { | 280 bool Heap::InToSpace(Object* object) { |
| 276 return new_space_.ToSpaceContains(object); | 281 return new_space_.ToSpaceContains(object); |
| 277 } | 282 } |
| 278 | 283 |
| 279 | 284 |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 688 | 693 |
| 689 | 694 |
| 690 Heap* _inline_get_heap_() { | 695 Heap* _inline_get_heap_() { |
| 691 return HEAP; | 696 return HEAP; |
| 692 } | 697 } |
| 693 | 698 |
| 694 | 699 |
| 695 } } // namespace v8::internal | 700 } } // namespace v8::internal |
| 696 | 701 |
| 697 #endif // V8_HEAP_INL_H_ | 702 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |