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

Side by Side Diff: src/global-handles.cc

Issue 22371002: delete eternal handle blocks correctly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 1251
1252 1252
1253 EternalHandles::EternalHandles() : size_(0) { 1253 EternalHandles::EternalHandles() : size_(0) {
1254 for (unsigned i = 0; i < ARRAY_SIZE(singleton_handles_); i++) { 1254 for (unsigned i = 0; i < ARRAY_SIZE(singleton_handles_); i++) {
1255 singleton_handles_[i] = kInvalidIndex; 1255 singleton_handles_[i] = kInvalidIndex;
1256 } 1256 }
1257 } 1257 }
1258 1258
1259 1259
1260 EternalHandles::~EternalHandles() { 1260 EternalHandles::~EternalHandles() {
1261 for (int i = 0; i < blocks_.length(); i++) delete blocks_[i]; 1261 for (int i = 0; i < blocks_.length(); i++) delete[] blocks_[i];
1262 } 1262 }
1263 1263
1264 1264
1265 void EternalHandles::IterateAllRoots(ObjectVisitor* visitor) { 1265 void EternalHandles::IterateAllRoots(ObjectVisitor* visitor) {
1266 int limit = size_; 1266 int limit = size_;
1267 for (int i = 0; i < blocks_.length(); i++) { 1267 for (int i = 0; i < blocks_.length(); i++) {
1268 ASSERT(limit > 0); 1268 ASSERT(limit > 0);
1269 Object** block = blocks_[i]; 1269 Object** block = blocks_[i];
1270 visitor->VisitPointers(block, block + Min(limit, kSize)); 1270 visitor->VisitPointers(block, block + Min(limit, kSize));
1271 limit -= kSize; 1271 limit -= kSize;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]); 1307 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]);
1308 blocks_[block][offset] = object; 1308 blocks_[block][offset] = object;
1309 if (isolate->heap()->InNewSpace(object)) { 1309 if (isolate->heap()->InNewSpace(object)) {
1310 new_space_indices_.Add(size_); 1310 new_space_indices_.Add(size_);
1311 } 1311 }
1312 return size_++; 1312 return size_++;
1313 } 1313 }
1314 1314
1315 1315
1316 } } // namespace v8::internal 1316 } } // 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