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

Side by Side Diff: src/isolate.cc

Issue 7624043: Fix three ~Isolate() related memory leaks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 | « src/api.h ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 if (list_ != NULL) list_->prev_ = data; 1328 if (list_ != NULL) list_->prev_ = data;
1329 data->next_ = list_; 1329 data->next_ = list_;
1330 list_ = data; 1330 list_ = data;
1331 } 1331 }
1332 1332
1333 1333
1334 void Isolate::ThreadDataTable::Remove(PerIsolateThreadData* data) { 1334 void Isolate::ThreadDataTable::Remove(PerIsolateThreadData* data) {
1335 if (list_ == data) list_ = data->next_; 1335 if (list_ == data) list_ = data->next_;
1336 if (data->next_ != NULL) data->next_->prev_ = data->prev_; 1336 if (data->next_ != NULL) data->next_->prev_ = data->prev_;
1337 if (data->prev_ != NULL) data->prev_->next_ = data->next_; 1337 if (data->prev_ != NULL) data->prev_->next_ = data->next_;
1338 delete data;
1338 } 1339 }
1339 1340
1340 1341
1341 void Isolate::ThreadDataTable::Remove(Isolate* isolate, 1342 void Isolate::ThreadDataTable::Remove(Isolate* isolate,
1342 ThreadId thread_id) { 1343 ThreadId thread_id) {
1343 PerIsolateThreadData* data = Lookup(isolate, thread_id); 1344 PerIsolateThreadData* data = Lookup(isolate, thread_id);
1344 if (data != NULL) { 1345 if (data != NULL) {
1345 Remove(data); 1346 Remove(data);
1346 } 1347 }
1347 } 1348 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 Thread::SetThreadLocal(per_isolate_thread_data_key_, data); 1530 Thread::SetThreadLocal(per_isolate_thread_data_key_, data);
1530 } 1531 }
1531 1532
1532 1533
1533 Isolate::~Isolate() { 1534 Isolate::~Isolate() {
1534 TRACE_ISOLATE(destructor); 1535 TRACE_ISOLATE(destructor);
1535 1536
1536 // Has to be called while counters_ are still alive. 1537 // Has to be called while counters_ are still alive.
1537 zone_.DeleteKeptSegment(); 1538 zone_.DeleteKeptSegment();
1538 1539
1540 delete assembler_spare_buffer_;
1541 assembler_spare_buffer_ = NULL;
1542
1539 delete unicode_cache_; 1543 delete unicode_cache_;
1540 unicode_cache_ = NULL; 1544 unicode_cache_ = NULL;
1541 1545
1542 delete regexp_stack_; 1546 delete regexp_stack_;
1543 regexp_stack_ = NULL; 1547 regexp_stack_ = NULL;
1544 1548
1545 delete ast_sentinels_; 1549 delete ast_sentinels_;
1546 ast_sentinels_ = NULL; 1550 ast_sentinels_ = NULL;
1547 1551
1548 delete descriptor_lookup_cache_; 1552 delete descriptor_lookup_cache_;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 1875
1872 #ifdef DEBUG 1876 #ifdef DEBUG
1873 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 1877 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
1874 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 1878 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
1875 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 1879 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
1876 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1880 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1877 #undef ISOLATE_FIELD_OFFSET 1881 #undef ISOLATE_FIELD_OFFSET
1878 #endif 1882 #endif
1879 1883
1880 } } // namespace v8::internal 1884 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698