| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 int Heap::allocation_timeout_ = 0; | 137 int Heap::allocation_timeout_ = 0; |
| 138 bool Heap::disallow_allocation_failure_ = false; | 138 bool Heap::disallow_allocation_failure_ = false; |
| 139 #endif // DEBUG | 139 #endif // DEBUG |
| 140 | 140 |
| 141 int GCTracer::alive_after_last_gc_ = 0; | 141 int GCTracer::alive_after_last_gc_ = 0; |
| 142 double GCTracer::last_gc_end_timestamp_ = 0.0; | 142 double GCTracer::last_gc_end_timestamp_ = 0.0; |
| 143 int GCTracer::max_gc_pause_ = 0; | 143 int GCTracer::max_gc_pause_ = 0; |
| 144 int GCTracer::max_alive_after_gc_ = 0; | 144 int GCTracer::max_alive_after_gc_ = 0; |
| 145 int GCTracer::min_in_mutator_ = kMaxInt; | 145 int GCTracer::min_in_mutator_ = kMaxInt; |
| 146 | 146 |
| 147 Heap::Heap() { | 147 Heap::Heap() : isolate_(NULL) { |
| 148 // TODO(zarko): members that previously relied on static initialization | 148 // TODO(zarko): members that previously relied on static initialization |
| 149 // should be initialized here. | 149 // should be initialized here. |
| 150 } | 150 } |
| 151 | 151 |
| 152 | 152 |
| 153 int Heap::Capacity() { | 153 int Heap::Capacity() { |
| 154 if (!HasBeenSetup()) return 0; | 154 if (!HasBeenSetup()) return 0; |
| 155 | 155 |
| 156 return new_space_.Capacity() + | 156 return new_space_.Capacity() + |
| 157 old_pointer_space_->Capacity() + | 157 old_pointer_space_->Capacity() + |
| (...skipping 3779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3937 #ifdef ENABLE_LOGGING_AND_PROFILING | 3937 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 3938 // This should be called only after initial objects have been created. | 3938 // This should be called only after initial objects have been created. |
| 3939 ProducerHeapProfile::Setup(); | 3939 ProducerHeapProfile::Setup(); |
| 3940 #endif | 3940 #endif |
| 3941 | 3941 |
| 3942 return true; | 3942 return true; |
| 3943 } | 3943 } |
| 3944 | 3944 |
| 3945 | 3945 |
| 3946 void Heap::SetStackLimits() { | 3946 void Heap::SetStackLimits() { |
| 3947 ASSERT(isolate_ != NULL); |
| 3948 ASSERT(isolate_ == Isolate::Current()); |
| 3947 // On 64 bit machines, pointers are generally out of range of Smis. We write | 3949 // On 64 bit machines, pointers are generally out of range of Smis. We write |
| 3948 // something that looks like an out of range Smi to the GC. | 3950 // something that looks like an out of range Smi to the GC. |
| 3949 | 3951 |
| 3950 // Set up the special root array entries containing the stack limits. | 3952 // Set up the special root array entries containing the stack limits. |
| 3951 // These are actually addresses, but the tag makes the GC ignore it. | 3953 // These are actually addresses, but the tag makes the GC ignore it. |
| 3952 roots_[kStackLimitRootIndex] = | 3954 roots_[kStackLimitRootIndex] = |
| 3953 reinterpret_cast<Object*>( | 3955 reinterpret_cast<Object*>( |
| 3954 (StackGuard::jslimit() & ~kSmiTagMask) | kSmiTag); | 3956 (isolate_->stack_guard()->jslimit() & ~kSmiTagMask) | kSmiTag); |
| 3955 roots_[kRealStackLimitRootIndex] = | 3957 roots_[kRealStackLimitRootIndex] = |
| 3956 reinterpret_cast<Object*>( | 3958 reinterpret_cast<Object*>( |
| 3957 (StackGuard::real_jslimit() & ~kSmiTagMask) | kSmiTag); | 3959 (isolate_->stack_guard()->real_jslimit() & ~kSmiTagMask) | kSmiTag); |
| 3958 } | 3960 } |
| 3959 | 3961 |
| 3960 | 3962 |
| 3961 void Heap::TearDown() { | 3963 void Heap::TearDown() { |
| 3962 if (FLAG_print_cumulative_gc_stat) { | 3964 if (FLAG_print_cumulative_gc_stat) { |
| 3963 PrintF("\n\n"); | 3965 PrintF("\n\n"); |
| 3964 PrintF("gc_count=%d ", gc_count_); | 3966 PrintF("gc_count=%d ", gc_count_); |
| 3965 PrintF("mark_sweep_count=%d ", ms_count_); | 3967 PrintF("mark_sweep_count=%d ", ms_count_); |
| 3966 PrintF("mark_compact_count=%d ", mc_count_); | 3968 PrintF("mark_compact_count=%d ", mc_count_); |
| 3967 PrintF("max_gc_pause=%d ", GCTracer::get_max_gc_pause()); | 3969 PrintF("max_gc_pause=%d ", GCTracer::get_max_gc_pause()); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4684 void ExternalStringTable::TearDown() { | 4686 void ExternalStringTable::TearDown() { |
| 4685 new_space_strings_.Free(); | 4687 new_space_strings_.Free(); |
| 4686 old_space_strings_.Free(); | 4688 old_space_strings_.Free(); |
| 4687 } | 4689 } |
| 4688 | 4690 |
| 4689 | 4691 |
| 4690 List<Object*> ExternalStringTable::new_space_strings_; | 4692 List<Object*> ExternalStringTable::new_space_strings_; |
| 4691 List<Object*> ExternalStringTable::old_space_strings_; | 4693 List<Object*> ExternalStringTable::old_space_strings_; |
| 4692 | 4694 |
| 4693 } } // namespace v8::internal | 4695 } } // namespace v8::internal |
| OLD | NEW |