| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 new_space_.ReportStatistics(); | 429 new_space_.ReportStatistics(); |
| 430 } | 430 } |
| 431 #else | 431 #else |
| 432 if (FLAG_log_gc) new_space_.ReportStatistics(); | 432 if (FLAG_log_gc) new_space_.ReportStatistics(); |
| 433 #endif // DEBUG | 433 #endif // DEBUG |
| 434 } | 434 } |
| 435 | 435 |
| 436 | 436 |
| 437 void Heap::GarbageCollectionPrologue() { | 437 void Heap::GarbageCollectionPrologue() { |
| 438 { AllowHeapAllocation for_the_first_part_of_prologue; | 438 { AllowHeapAllocation for_the_first_part_of_prologue; |
| 439 isolate_->transcendental_cache()->Clear(); | |
| 440 ClearJSFunctionResultCaches(); | 439 ClearJSFunctionResultCaches(); |
| 441 gc_count_++; | 440 gc_count_++; |
| 442 unflattened_strings_length_ = 0; | 441 unflattened_strings_length_ = 0; |
| 443 | 442 |
| 444 if (FLAG_flush_code && FLAG_flush_code_incrementally) { | 443 if (FLAG_flush_code && FLAG_flush_code_incrementally) { |
| 445 mark_compact_collector()->EnableCodeFlushing(true); | 444 mark_compact_collector()->EnableCodeFlushing(true); |
| 446 } | 445 } |
| 447 | 446 |
| 448 #ifdef VERIFY_HEAP | 447 #ifdef VERIFY_HEAP |
| 449 if (FLAG_verify_heap) { | 448 if (FLAG_verify_heap) { |
| (...skipping 7298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7748 #ifdef DEBUG | 7747 #ifdef DEBUG |
| 7749 void Heap::GarbageCollectionGreedyCheck() { | 7748 void Heap::GarbageCollectionGreedyCheck() { |
| 7750 ASSERT(FLAG_gc_greedy); | 7749 ASSERT(FLAG_gc_greedy); |
| 7751 if (isolate_->bootstrapper()->IsActive()) return; | 7750 if (isolate_->bootstrapper()->IsActive()) return; |
| 7752 if (disallow_allocation_failure()) return; | 7751 if (disallow_allocation_failure()) return; |
| 7753 CollectGarbage(NEW_SPACE); | 7752 CollectGarbage(NEW_SPACE); |
| 7754 } | 7753 } |
| 7755 #endif | 7754 #endif |
| 7756 | 7755 |
| 7757 | 7756 |
| 7758 TranscendentalCache::SubCache::SubCache(Isolate* isolate, Type t) | |
| 7759 : type_(t), | |
| 7760 isolate_(isolate) { | |
| 7761 uint32_t in0 = 0xffffffffu; // Bit-pattern for a NaN that isn't | |
| 7762 uint32_t in1 = 0xffffffffu; // generated by the FPU. | |
| 7763 for (int i = 0; i < kCacheSize; i++) { | |
| 7764 elements_[i].in[0] = in0; | |
| 7765 elements_[i].in[1] = in1; | |
| 7766 elements_[i].output = NULL; | |
| 7767 } | |
| 7768 } | |
| 7769 | |
| 7770 | |
| 7771 void TranscendentalCache::Clear() { | |
| 7772 for (int i = 0; i < kNumberOfCaches; i++) { | |
| 7773 if (caches_[i] != NULL) { | |
| 7774 delete caches_[i]; | |
| 7775 caches_[i] = NULL; | |
| 7776 } | |
| 7777 } | |
| 7778 } | |
| 7779 | |
| 7780 | |
| 7781 void ExternalStringTable::CleanUp() { | 7757 void ExternalStringTable::CleanUp() { |
| 7782 int last = 0; | 7758 int last = 0; |
| 7783 for (int i = 0; i < new_space_strings_.length(); ++i) { | 7759 for (int i = 0; i < new_space_strings_.length(); ++i) { |
| 7784 if (new_space_strings_[i] == heap_->the_hole_value()) { | 7760 if (new_space_strings_[i] == heap_->the_hole_value()) { |
| 7785 continue; | 7761 continue; |
| 7786 } | 7762 } |
| 7787 ASSERT(new_space_strings_[i]->IsExternalString()); | 7763 ASSERT(new_space_strings_[i]->IsExternalString()); |
| 7788 if (heap_->InNewSpace(new_space_strings_[i])) { | 7764 if (heap_->InNewSpace(new_space_strings_[i])) { |
| 7789 new_space_strings_[last++] = new_space_strings_[i]; | 7765 new_space_strings_[last++] = new_space_strings_[i]; |
| 7790 } else { | 7766 } else { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7959 static_cast<int>(object_sizes_last_time_[index])); | 7935 static_cast<int>(object_sizes_last_time_[index])); |
| 7960 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7936 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7961 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7937 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7962 | 7938 |
| 7963 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7939 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7964 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7940 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7965 ClearObjectStats(); | 7941 ClearObjectStats(); |
| 7966 } | 7942 } |
| 7967 | 7943 |
| 7968 } } // namespace v8::internal | 7944 } } // namespace v8::internal |
| OLD | NEW |