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

Side by Side Diff: src/deoptimizer.cc

Issue 11269035: Fix memory leak in DeoptimizerData. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | no next file » | no next file with comments »
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (eager_deoptimization_entry_code_ != NULL) { 55 if (eager_deoptimization_entry_code_ != NULL) {
56 Isolate::Current()->memory_allocator()->Free( 56 Isolate::Current()->memory_allocator()->Free(
57 eager_deoptimization_entry_code_); 57 eager_deoptimization_entry_code_);
58 eager_deoptimization_entry_code_ = NULL; 58 eager_deoptimization_entry_code_ = NULL;
59 } 59 }
60 if (lazy_deoptimization_entry_code_ != NULL) { 60 if (lazy_deoptimization_entry_code_ != NULL) {
61 Isolate::Current()->memory_allocator()->Free( 61 Isolate::Current()->memory_allocator()->Free(
62 lazy_deoptimization_entry_code_); 62 lazy_deoptimization_entry_code_);
63 lazy_deoptimization_entry_code_ = NULL; 63 lazy_deoptimization_entry_code_ = NULL;
64 } 64 }
65 if (deoptimizing_code_list_ != NULL) {
66 DeoptimizingCodeListNode* prev = NULL;
Sven Panne 2012/10/25 08:22:26 DBC: Move the declaration into the loop where it i
ulan 2012/10/25 08:26:02 Done. I also removed the outer null check.
67 DeoptimizingCodeListNode* current = deoptimizing_code_list_;
68 while (current != NULL) {
69 prev = current;
70 current = current->next();
71 delete prev;
72 }
73 deoptimizing_code_list_ = NULL;
74 }
65 } 75 }
66 76
67 77
68 #ifdef ENABLE_DEBUGGER_SUPPORT 78 #ifdef ENABLE_DEBUGGER_SUPPORT
69 void DeoptimizerData::Iterate(ObjectVisitor* v) { 79 void DeoptimizerData::Iterate(ObjectVisitor* v) {
70 if (deoptimized_frame_info_ != NULL) { 80 if (deoptimized_frame_info_ != NULL) {
71 deoptimized_frame_info_->Iterate(v); 81 deoptimized_frame_info_->Iterate(v);
72 } 82 }
73 } 83 }
74 #endif 84 #endif
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 1999
1990 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2000 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1991 v->VisitPointer(BitCast<Object**>(&function_)); 2001 v->VisitPointer(BitCast<Object**>(&function_));
1992 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2002 v->VisitPointers(parameters_, parameters_ + parameters_count_);
1993 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2003 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1994 } 2004 }
1995 2005
1996 #endif // ENABLE_DEBUGGER_SUPPORT 2006 #endif // ENABLE_DEBUGGER_SUPPORT
1997 2007
1998 } } // namespace v8::internal 2008 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698