Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: src/heap.cc

Issue 181833004: Fix memory leak caused by treating Code::next_code_link as strong in marker. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/objects.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7078 matching lines...) Expand 10 before | Expand all | Expand 10 after
7089 public: 7089 public:
7090 explicit MarkVisitor(PathTracer* tracer) : tracer_(tracer) {} 7090 explicit MarkVisitor(PathTracer* tracer) : tracer_(tracer) {}
7091 void VisitPointers(Object** start, Object** end) { 7091 void VisitPointers(Object** start, Object** end) {
7092 // Scan all HeapObject pointers in [start, end) 7092 // Scan all HeapObject pointers in [start, end)
7093 for (Object** p = start; !tracer_->found() && (p < end); p++) { 7093 for (Object** p = start; !tracer_->found() && (p < end); p++) {
7094 if ((*p)->IsHeapObject()) 7094 if ((*p)->IsHeapObject())
7095 tracer_->MarkRecursively(p, this); 7095 tracer_->MarkRecursively(p, this);
7096 } 7096 }
7097 } 7097 }
7098 7098
7099 WeakPointerMode weak_pointer_mode() {
7100 return SKIP_WEAK_POINTERS;
7101 }
7102
7099 private: 7103 private:
7100 PathTracer* tracer_; 7104 PathTracer* tracer_;
7101 }; 7105 };
7102 7106
7103 7107
7104 class PathTracer::UnmarkVisitor: public ObjectVisitor { 7108 class PathTracer::UnmarkVisitor: public ObjectVisitor {
7105 public: 7109 public:
7106 explicit UnmarkVisitor(PathTracer* tracer) : tracer_(tracer) {} 7110 explicit UnmarkVisitor(PathTracer* tracer) : tracer_(tracer) {}
7107 void VisitPointers(Object** start, Object** end) { 7111 void VisitPointers(Object** start, Object** end) {
7108 // Scan all HeapObject pointers in [start, end) 7112 // Scan all HeapObject pointers in [start, end)
7109 for (Object** p = start; p < end; p++) { 7113 for (Object** p = start; p < end; p++) {
7110 if ((*p)->IsHeapObject()) 7114 if ((*p)->IsHeapObject())
7111 tracer_->UnmarkRecursively(p, this); 7115 tracer_->UnmarkRecursively(p, this);
7112 } 7116 }
7113 } 7117 }
7114 7118
7119 WeakPointerMode weak_pointer_mode() {
7120 return SKIP_WEAK_POINTERS;
7121 }
7122
7115 private: 7123 private:
7116 PathTracer* tracer_; 7124 PathTracer* tracer_;
7117 }; 7125 };
7118 7126
7119 7127
7120 void PathTracer::VisitPointers(Object** start, Object** end) { 7128 void PathTracer::VisitPointers(Object** start, Object** end) {
7121 bool done = ((what_to_find_ == FIND_FIRST) && found_target_); 7129 bool done = ((what_to_find_ == FIND_FIRST) && found_target_);
7122 // Visit all HeapObject pointers in [start, end) 7130 // Visit all HeapObject pointers in [start, end)
7123 for (Object** p = start; !done && (p < end); p++) { 7131 for (Object** p = start; !done && (p < end); p++) {
7124 if ((*p)->IsHeapObject()) { 7132 if ((*p)->IsHeapObject()) {
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
7743 static_cast<int>(object_sizes_last_time_[index])); 7751 static_cast<int>(object_sizes_last_time_[index]));
7744 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7752 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7745 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7753 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7746 7754
7747 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7755 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7748 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7756 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7749 ClearObjectStats(); 7757 ClearObjectStats();
7750 } 7758 }
7751 7759
7752 } } // namespace v8::internal 7760 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698