| 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 3235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3246 } | 3246 } |
| 3247 | 3247 |
| 3248 LOG(IntEvent("heap-capacity", Capacity())); | 3248 LOG(IntEvent("heap-capacity", Capacity())); |
| 3249 LOG(IntEvent("heap-available", Available())); | 3249 LOG(IntEvent("heap-available", Available())); |
| 3250 | 3250 |
| 3251 return true; | 3251 return true; |
| 3252 } | 3252 } |
| 3253 | 3253 |
| 3254 | 3254 |
| 3255 void Heap::SetStackLimit(intptr_t limit) { | 3255 void Heap::SetStackLimit(intptr_t limit) { |
| 3256 // We don't use the stack limit in the roots array on x86-64 yet, but since | 3256 // On 64 bit machines, pointers are generally out of range of Smis. We write |
| 3257 // pointers are generally out of range of Smis we should set the value either. | 3257 // something that looks like an out of range Smi to the GC. |
| 3258 #if !V8_HOST_ARCH_64_BIT | 3258 |
| 3259 // Set up the special root array entry containing the stack guard. | 3259 // Set up the special root array entry containing the stack guard. |
| 3260 // This is actually an address, but the tag makes the GC ignore it. | 3260 // This is actually an address, but the tag makes the GC ignore it. |
| 3261 set_stack_limit(Smi::FromInt(limit >> kSmiTagSize)); | 3261 roots_[kStackLimitRootIndex] = |
| 3262 #else | 3262 reinterpret_cast<Object*>((limit & ~kSmiTagMask) | kSmiTag); |
| 3263 set_stack_limit(Smi::FromInt(0)); | |
| 3264 #endif | |
| 3265 } | 3263 } |
| 3266 | 3264 |
| 3267 | 3265 |
| 3268 void Heap::TearDown() { | 3266 void Heap::TearDown() { |
| 3269 GlobalHandles::TearDown(); | 3267 GlobalHandles::TearDown(); |
| 3270 | 3268 |
| 3271 new_space_.TearDown(); | 3269 new_space_.TearDown(); |
| 3272 | 3270 |
| 3273 if (old_pointer_space_ != NULL) { | 3271 if (old_pointer_space_ != NULL) { |
| 3274 old_pointer_space_->TearDown(); | 3272 old_pointer_space_->TearDown(); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3968 #ifdef DEBUG | 3966 #ifdef DEBUG |
| 3969 bool Heap::GarbageCollectionGreedyCheck() { | 3967 bool Heap::GarbageCollectionGreedyCheck() { |
| 3970 ASSERT(FLAG_gc_greedy); | 3968 ASSERT(FLAG_gc_greedy); |
| 3971 if (Bootstrapper::IsActive()) return true; | 3969 if (Bootstrapper::IsActive()) return true; |
| 3972 if (disallow_allocation_failure()) return true; | 3970 if (disallow_allocation_failure()) return true; |
| 3973 return CollectGarbage(0, NEW_SPACE); | 3971 return CollectGarbage(0, NEW_SPACE); |
| 3974 } | 3972 } |
| 3975 #endif | 3973 #endif |
| 3976 | 3974 |
| 3977 } } // namespace v8::internal | 3975 } } // namespace v8::internal |
| OLD | NEW |