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

Side by Side Diff: src/mark-compact.cc

Issue 11896064: Fix corner case when JSFunction is evicted from flusher. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | test/cctest/test-heap.cc » ('j') | test/cctest/test-heap.cc » ('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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 SharedFunctionInfo* candidate = shared_function_info_candidates_head_; 936 SharedFunctionInfo* candidate = shared_function_info_candidates_head_;
937 while (candidate != NULL) { 937 while (candidate != NULL) {
938 if (candidate == shared_info) return true; 938 if (candidate == shared_info) return true;
939 candidate = GetNextCandidate(candidate); 939 candidate = GetNextCandidate(candidate);
940 } 940 }
941 return false; 941 return false;
942 } 942 }
943 943
944 944
945 void CodeFlusher::EvictCandidate(SharedFunctionInfo* shared_info) { 945 void CodeFlusher::EvictCandidate(SharedFunctionInfo* shared_info) {
946 // The function is no longer a candidate, make sure it gets visited 946 // Make sure previous flushing decisions are revisited.
947 // again so that previous flushing decisions are revisited.
948 isolate_->heap()->incremental_marking()->RecordWrites(shared_info); 947 isolate_->heap()->incremental_marking()->RecordWrites(shared_info);
949 948
950 SharedFunctionInfo* candidate = shared_function_info_candidates_head_; 949 SharedFunctionInfo* candidate = shared_function_info_candidates_head_;
951 SharedFunctionInfo* next_candidate; 950 SharedFunctionInfo* next_candidate;
952 if (candidate == shared_info) { 951 if (candidate == shared_info) {
953 next_candidate = GetNextCandidate(shared_info); 952 next_candidate = GetNextCandidate(shared_info);
954 shared_function_info_candidates_head_ = next_candidate; 953 shared_function_info_candidates_head_ = next_candidate;
955 ClearNextCandidate(shared_info); 954 ClearNextCandidate(shared_info);
956 } else { 955 } else {
957 while (candidate != NULL) { 956 while (candidate != NULL) {
958 next_candidate = GetNextCandidate(candidate); 957 next_candidate = GetNextCandidate(candidate);
959 958
960 if (next_candidate == shared_info) { 959 if (next_candidate == shared_info) {
961 next_candidate = GetNextCandidate(shared_info); 960 next_candidate = GetNextCandidate(shared_info);
962 SetNextCandidate(candidate, next_candidate); 961 SetNextCandidate(candidate, next_candidate);
963 ClearNextCandidate(shared_info); 962 ClearNextCandidate(shared_info);
964 break; 963 break;
965 } 964 }
966 965
967 candidate = next_candidate; 966 candidate = next_candidate;
968 } 967 }
969 } 968 }
970 } 969 }
971 970
972 971
973 void CodeFlusher::EvictCandidate(JSFunction* function) { 972 void CodeFlusher::EvictCandidate(JSFunction* function) {
974 ASSERT(!function->next_function_link()->IsUndefined()); 973 ASSERT(!function->next_function_link()->IsUndefined());
975 Object* undefined = isolate_->heap()->undefined_value(); 974 Object* undefined = isolate_->heap()->undefined_value();
976 975
977 // The function is no longer a candidate, make sure it gets visited 976 // Make sure previous flushing decisions are revisited.
978 // again so that previous flushing decisions are revisited.
979 isolate_->heap()->incremental_marking()->RecordWrites(function); 977 isolate_->heap()->incremental_marking()->RecordWrites(function);
978 isolate_->heap()->incremental_marking()->RecordWrites(function->shared());
980 979
981 JSFunction* candidate = jsfunction_candidates_head_; 980 JSFunction* candidate = jsfunction_candidates_head_;
982 JSFunction* next_candidate; 981 JSFunction* next_candidate;
983 if (candidate == function) { 982 if (candidate == function) {
984 next_candidate = GetNextCandidate(function); 983 next_candidate = GetNextCandidate(function);
985 jsfunction_candidates_head_ = next_candidate; 984 jsfunction_candidates_head_ = next_candidate;
986 ClearNextCandidate(function, undefined); 985 ClearNextCandidate(function, undefined);
987 } else { 986 } else {
988 while (candidate != NULL) { 987 while (candidate != NULL) {
989 next_candidate = GetNextCandidate(candidate); 988 next_candidate = GetNextCandidate(candidate);
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after
3848 while (buffer != NULL) { 3847 while (buffer != NULL) {
3849 SlotsBuffer* next_buffer = buffer->next(); 3848 SlotsBuffer* next_buffer = buffer->next();
3850 DeallocateBuffer(buffer); 3849 DeallocateBuffer(buffer);
3851 buffer = next_buffer; 3850 buffer = next_buffer;
3852 } 3851 }
3853 *buffer_address = NULL; 3852 *buffer_address = NULL;
3854 } 3853 }
3855 3854
3856 3855
3857 } } // namespace v8::internal 3856 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | test/cctest/test-heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698