| 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 SetNextCandidate(candidate, next_candidate); | 945 SetNextCandidate(candidate, next_candidate); |
| 946 ClearNextCandidate(function, undefined); | 946 ClearNextCandidate(function, undefined); |
| 947 } | 947 } |
| 948 | 948 |
| 949 candidate = next_candidate; | 949 candidate = next_candidate; |
| 950 } | 950 } |
| 951 } | 951 } |
| 952 } | 952 } |
| 953 | 953 |
| 954 | 954 |
| 955 void CodeFlusher::EvictJSFunctionCandidates() { |
| 956 Object* undefined = isolate_->heap()->undefined_value(); |
| 957 |
| 958 JSFunction* candidate = jsfunction_candidates_head_; |
| 959 JSFunction* next_candidate; |
| 960 while (candidate != NULL) { |
| 961 next_candidate = GetNextCandidate(candidate); |
| 962 ClearNextCandidate(candidate, undefined); |
| 963 candidate = next_candidate; |
| 964 } |
| 965 |
| 966 jsfunction_candidates_head_ = NULL; |
| 967 } |
| 968 |
| 969 |
| 970 void CodeFlusher::EvictSharedFunctionInfoCandidates() { |
| 971 SharedFunctionInfo* candidate = shared_function_info_candidates_head_; |
| 972 SharedFunctionInfo* next_candidate; |
| 973 while (candidate != NULL) { |
| 974 next_candidate = GetNextCandidate(candidate); |
| 975 ClearNextCandidate(candidate); |
| 976 candidate = next_candidate; |
| 977 } |
| 978 |
| 979 shared_function_info_candidates_head_ = NULL; |
| 980 } |
| 981 |
| 982 |
| 955 void CodeFlusher::IteratePointersToFromSpace(ObjectVisitor* v) { | 983 void CodeFlusher::IteratePointersToFromSpace(ObjectVisitor* v) { |
| 956 Heap* heap = isolate_->heap(); | 984 Heap* heap = isolate_->heap(); |
| 957 | 985 |
| 958 JSFunction** slot = &jsfunction_candidates_head_; | 986 JSFunction** slot = &jsfunction_candidates_head_; |
| 959 JSFunction* candidate = jsfunction_candidates_head_; | 987 JSFunction* candidate = jsfunction_candidates_head_; |
| 960 while (candidate != NULL) { | 988 while (candidate != NULL) { |
| 961 if (heap->InFromSpace(candidate)) { | 989 if (heap->InFromSpace(candidate)) { |
| 962 v->VisitPointer(reinterpret_cast<Object**>(slot)); | 990 v->VisitPointer(reinterpret_cast<Object**>(slot)); |
| 963 } | 991 } |
| 964 candidate = GetNextCandidate(*slot); | 992 candidate = GetNextCandidate(*slot); |
| (...skipping 2657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3622 heap()->isolate()->debug()->has_break_points()) { | 3650 heap()->isolate()->debug()->has_break_points()) { |
| 3623 enable = false; | 3651 enable = false; |
| 3624 } | 3652 } |
| 3625 #endif | 3653 #endif |
| 3626 | 3654 |
| 3627 if (enable) { | 3655 if (enable) { |
| 3628 if (code_flusher_ != NULL) return; | 3656 if (code_flusher_ != NULL) return; |
| 3629 code_flusher_ = new CodeFlusher(heap()->isolate()); | 3657 code_flusher_ = new CodeFlusher(heap()->isolate()); |
| 3630 } else { | 3658 } else { |
| 3631 if (code_flusher_ == NULL) return; | 3659 if (code_flusher_ == NULL) return; |
| 3660 code_flusher_->EvictAllCandidates(); |
| 3632 delete code_flusher_; | 3661 delete code_flusher_; |
| 3633 code_flusher_ = NULL; | 3662 code_flusher_ = NULL; |
| 3634 } | 3663 } |
| 3635 } | 3664 } |
| 3636 | 3665 |
| 3637 | 3666 |
| 3638 // TODO(1466) ReportDeleteIfNeeded is not called currently. | 3667 // TODO(1466) ReportDeleteIfNeeded is not called currently. |
| 3639 // Our profiling tools do not expect intersections between | 3668 // Our profiling tools do not expect intersections between |
| 3640 // code objects. We should either reenable it or change our tools. | 3669 // code objects. We should either reenable it or change our tools. |
| 3641 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj, | 3670 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3805 while (buffer != NULL) { | 3834 while (buffer != NULL) { |
| 3806 SlotsBuffer* next_buffer = buffer->next(); | 3835 SlotsBuffer* next_buffer = buffer->next(); |
| 3807 DeallocateBuffer(buffer); | 3836 DeallocateBuffer(buffer); |
| 3808 buffer = next_buffer; | 3837 buffer = next_buffer; |
| 3809 } | 3838 } |
| 3810 *buffer_address = NULL; | 3839 *buffer_address = NULL; |
| 3811 } | 3840 } |
| 3812 | 3841 |
| 3813 | 3842 |
| 3814 } } // namespace v8::internal | 3843 } } // namespace v8::internal |
| OLD | NEW |