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

Side by Side Diff: src/objects-visiting-inl.h

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
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | 890 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
891 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | 891 RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
892 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | 892 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
893 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 893 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
894 894
895 // There are two places where we iterate code bodies: here and the 895 // There are two places where we iterate code bodies: here and the
896 // templated CodeIterateBody (below). They should be kept in sync. 896 // templated CodeIterateBody (below). They should be kept in sync.
897 IteratePointer(v, kRelocationInfoOffset); 897 IteratePointer(v, kRelocationInfoOffset);
898 IteratePointer(v, kHandlerTableOffset); 898 IteratePointer(v, kHandlerTableOffset);
899 IteratePointer(v, kDeoptimizationDataOffset); 899 IteratePointer(v, kDeoptimizationDataOffset);
900 IteratePointer(v, kTypeFeedbackInfoOffset); 900 if (v->weak_pointer_mode() == VISIT_WEAK_POINTERS || !is_optimized_code()) {
901 // In optimized code this field is a weak next_code_link.
902 IteratePointer(v, kTypeFeedbackInfoOffset);
903 }
901 IteratePointer(v, kConstantPoolOffset); 904 IteratePointer(v, kConstantPoolOffset);
902 905
903 RelocIterator it(this, mode_mask); 906 RelocIterator it(this, mode_mask);
904 Isolate* isolate = this->GetIsolate(); 907 Isolate* isolate = this->GetIsolate();
905 for (; !it.done(); it.next()) { 908 for (; !it.done(); it.next()) {
906 it.rinfo()->Visit(isolate, v); 909 it.rinfo()->Visit(isolate, v);
907 } 910 }
908 } 911 }
909 912
910 913
(...skipping 11 matching lines...) Expand all
922 // templated CodeIterateBody (above). They should be kept in sync. 925 // templated CodeIterateBody (above). They should be kept in sync.
923 StaticVisitor::VisitPointer( 926 StaticVisitor::VisitPointer(
924 heap, 927 heap,
925 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); 928 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset));
926 StaticVisitor::VisitPointer( 929 StaticVisitor::VisitPointer(
927 heap, 930 heap,
928 reinterpret_cast<Object**>(this->address() + kHandlerTableOffset)); 931 reinterpret_cast<Object**>(this->address() + kHandlerTableOffset));
929 StaticVisitor::VisitPointer( 932 StaticVisitor::VisitPointer(
930 heap, 933 heap,
931 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset)); 934 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset));
932 StaticVisitor::VisitPointer( 935 if (StaticVisitor::weak_pointer_mode() == VISIT_WEAK_POINTERS ||
933 heap, 936 !is_optimized_code()) {
Michael Starzinger 2014/03/04 12:31:12 As discussed offline: AFAICT, currently we can aff
titzer 2014/03/05 08:58:02 +1 unoverlap. I am sorry for overlapping them in t
ulan 2014/03/06 11:13:32 Nope, it is my fault. I remember introducing this
ulan 2014/03/06 11:13:32 Done.
934 reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset)); 937 // In optimized code this field is a weak next_code_link.
938 StaticVisitor::VisitPointer(
939 heap,
940 reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset));
941 }
935 StaticVisitor::VisitPointer( 942 StaticVisitor::VisitPointer(
936 heap, 943 heap,
937 reinterpret_cast<Object**>(this->address() + kConstantPoolOffset)); 944 reinterpret_cast<Object**>(this->address() + kConstantPoolOffset));
938 945
939 946
940 RelocIterator it(this, mode_mask); 947 RelocIterator it(this, mode_mask);
941 for (; !it.done(); it.next()) { 948 for (; !it.done(); it.next()) {
942 it.rinfo()->template Visit<StaticVisitor>(heap); 949 it.rinfo()->template Visit<StaticVisitor>(heap);
943 } 950 }
944 } 951 }
945 952
946 953
947 } } // namespace v8::internal 954 } } // namespace v8::internal
948 955
949 #endif // V8_OBJECTS_VISITING_INL_H_ 956 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698