OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3249 if (!CreateInitialObjects()) return false; | 3249 if (!CreateInitialObjects()) return false; |
3250 } | 3250 } |
3251 | 3251 |
3252 LOG(IntEvent("heap-capacity", Capacity())); | 3252 LOG(IntEvent("heap-capacity", Capacity())); |
3253 LOG(IntEvent("heap-available", Available())); | 3253 LOG(IntEvent("heap-available", Available())); |
3254 | 3254 |
3255 return true; | 3255 return true; |
3256 } | 3256 } |
3257 | 3257 |
3258 | 3258 |
3259 void Heap::SetStackLimit(intptr_t limit) { | |
3260 // Set up the special root array entry is the stack guard. | |
Mads Ager (chromium)
2009/08/26 10:09:28
is -> containing?
| |
3261 // This is actually an address, but the tag makes the GC ignore it. | |
3262 limit &= ~kSmiTagMask; | |
3263 limit |= kSmiTag; | |
Mads Ager (chromium)
2009/08/26 10:09:28
Do you need this? You should be able to remove th
| |
3264 set_stack_limit(Smi::FromInt(limit >> kSmiTagSize)); | |
3265 } | |
3266 | |
3267 | |
3259 void Heap::TearDown() { | 3268 void Heap::TearDown() { |
3260 GlobalHandles::TearDown(); | 3269 GlobalHandles::TearDown(); |
3261 | 3270 |
3262 new_space_.TearDown(); | 3271 new_space_.TearDown(); |
3263 | 3272 |
3264 if (old_pointer_space_ != NULL) { | 3273 if (old_pointer_space_ != NULL) { |
3265 old_pointer_space_->TearDown(); | 3274 old_pointer_space_->TearDown(); |
3266 delete old_pointer_space_; | 3275 delete old_pointer_space_; |
3267 old_pointer_space_ = NULL; | 3276 old_pointer_space_ = NULL; |
3268 } | 3277 } |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3959 #ifdef DEBUG | 3968 #ifdef DEBUG |
3960 bool Heap::GarbageCollectionGreedyCheck() { | 3969 bool Heap::GarbageCollectionGreedyCheck() { |
3961 ASSERT(FLAG_gc_greedy); | 3970 ASSERT(FLAG_gc_greedy); |
3962 if (Bootstrapper::IsActive()) return true; | 3971 if (Bootstrapper::IsActive()) return true; |
3963 if (disallow_allocation_failure()) return true; | 3972 if (disallow_allocation_failure()) return true; |
3964 return CollectGarbage(0, NEW_SPACE); | 3973 return CollectGarbage(0, NEW_SPACE); |
3965 } | 3974 } |
3966 #endif | 3975 #endif |
3967 | 3976 |
3968 } } // namespace v8::internal | 3977 } } // namespace v8::internal |
OLD | NEW |