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 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 3259 void Heap::SetStackLimit(intptr_t limit) { |
3260 // We don't use this on x86-64 yet, but we need to remove the top | 3260 // We don't use the stack limit in the roots array on x86-64 yet, but since |
3261 // bits or it won't be a valid Smi. This has no effect on 32 bit | 3261 // pointers are generally out of range of Smis we should set the value either. |
3262 // architectures. | 3262 #if !HOST_ARCH_64_BIT |
3263 limit &= 0xfffffffful; | |
3264 // Set up the special root array entry containing the stack guard. | 3263 // Set up the special root array entry containing the stack guard. |
3265 // This is actually an address, but the tag makes the GC ignore it. | 3264 // This is actually an address, but the tag makes the GC ignore it. |
3266 set_stack_limit(Smi::FromInt(limit >> kSmiTagSize)); | 3265 set_stack_limit(Smi::FromInt(limit >> kSmiTagSize)); |
| 3266 #endif |
3267 } | 3267 } |
3268 | 3268 |
3269 | 3269 |
3270 void Heap::TearDown() { | 3270 void Heap::TearDown() { |
3271 GlobalHandles::TearDown(); | 3271 GlobalHandles::TearDown(); |
3272 | 3272 |
3273 new_space_.TearDown(); | 3273 new_space_.TearDown(); |
3274 | 3274 |
3275 if (old_pointer_space_ != NULL) { | 3275 if (old_pointer_space_ != NULL) { |
3276 old_pointer_space_->TearDown(); | 3276 old_pointer_space_->TearDown(); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3970 #ifdef DEBUG | 3970 #ifdef DEBUG |
3971 bool Heap::GarbageCollectionGreedyCheck() { | 3971 bool Heap::GarbageCollectionGreedyCheck() { |
3972 ASSERT(FLAG_gc_greedy); | 3972 ASSERT(FLAG_gc_greedy); |
3973 if (Bootstrapper::IsActive()) return true; | 3973 if (Bootstrapper::IsActive()) return true; |
3974 if (disallow_allocation_failure()) return true; | 3974 if (disallow_allocation_failure()) return true; |
3975 return CollectGarbage(0, NEW_SPACE); | 3975 return CollectGarbage(0, NEW_SPACE); |
3976 } | 3976 } |
3977 #endif | 3977 #endif |
3978 | 3978 |
3979 } } // namespace v8::internal | 3979 } } // namespace v8::internal |
OLD | NEW |