| 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 7296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7746 #ifdef DEBUG | 7745 #ifdef DEBUG |
| 7747 void Heap::GarbageCollectionGreedyCheck() { | 7746 void Heap::GarbageCollectionGreedyCheck() { |
| 7748 ASSERT(FLAG_gc_greedy); | 7747 ASSERT(FLAG_gc_greedy); |
| 7749 if (isolate_->bootstrapper()->IsActive()) return; | 7748 if (isolate_->bootstrapper()->IsActive()) return; |
| 7750 if (disallow_allocation_failure()) return; | 7749 if (disallow_allocation_failure()) return; |
| 7751 CollectGarbage(NEW_SPACE); | 7750 CollectGarbage(NEW_SPACE); |
| 7752 } | 7751 } |
| 7753 #endif | 7752 #endif |
| 7754 | 7753 |
| 7755 | 7754 |
| 7756 TranscendentalCache::SubCache::SubCache(Isolate* isolate, Type t) | |
| 7757 : type_(t), | |
| 7758 isolate_(isolate) { | |
| 7759 uint32_t in0 = 0xffffffffu; // Bit-pattern for a NaN that isn't | |
| 7760 uint32_t in1 = 0xffffffffu; // generated by the FPU. | |
| 7761 for (int i = 0; i < kCacheSize; i++) { | |
| 7762 elements_[i].in[0] = in0; | |
| 7763 elements_[i].in[1] = in1; | |
| 7764 elements_[i].output = NULL; | |
| 7765 } | |
| 7766 } | |
| 7767 | |
| 7768 | |
| 7769 void TranscendentalCache::Clear() { | |
| 7770 for (int i = 0; i < kNumberOfCaches; i++) { | |
| 7771 if (caches_[i] != NULL) { | |
| 7772 delete caches_[i]; | |
| 7773 caches_[i] = NULL; | |
| 7774 } | |
| 7775 } | |
| 7776 } | |
| 7777 | |
| 7778 | |
| 7779 void ExternalStringTable::CleanUp() { | 7755 void ExternalStringTable::CleanUp() { |
| 7780 int last = 0; | 7756 int last = 0; |
| 7781 for (int i = 0; i < new_space_strings_.length(); ++i) { | 7757 for (int i = 0; i < new_space_strings_.length(); ++i) { |
| 7782 if (new_space_strings_[i] == heap_->the_hole_value()) { | 7758 if (new_space_strings_[i] == heap_->the_hole_value()) { |
| 7783 continue; | 7759 continue; |
| 7784 } | 7760 } |
| 7785 ASSERT(new_space_strings_[i]->IsExternalString()); | 7761 ASSERT(new_space_strings_[i]->IsExternalString()); |
| 7786 if (heap_->InNewSpace(new_space_strings_[i])) { | 7762 if (heap_->InNewSpace(new_space_strings_[i])) { |
| 7787 new_space_strings_[last++] = new_space_strings_[i]; | 7763 new_space_strings_[last++] = new_space_strings_[i]; |
| 7788 } else { | 7764 } else { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7957 static_cast<int>(object_sizes_last_time_[index])); | 7933 static_cast<int>(object_sizes_last_time_[index])); |
| 7958 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7934 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7959 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7935 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7960 | 7936 |
| 7961 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7937 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7962 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7938 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7963 ClearObjectStats(); | 7939 ClearObjectStats(); |
| 7964 } | 7940 } |
| 7965 | 7941 |
| 7966 } } // namespace v8::internal | 7942 } } // namespace v8::internal |
| OLD | NEW |