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

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

Issue 467037: External string table. (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « src/api.cc ('k') | src/globals.h » ('j') | src/heap.cc » ('J')
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle()); 162 v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle());
163 { 163 {
164 // Forbid reuse of destroyed nodes as they might be already deallocated. 164 // Forbid reuse of destroyed nodes as they might be already deallocated.
165 // It's fine though to reuse nodes that were destroyed in weak callback 165 // It's fine though to reuse nodes that were destroyed in weak callback
166 // as those cannot be deallocated until we are back from the callback. 166 // as those cannot be deallocated until we are back from the callback.
167 set_first_free(NULL); 167 set_first_free(NULL);
168 if (first_deallocated()) { 168 if (first_deallocated()) {
169 first_deallocated()->set_next(head()); 169 first_deallocated()->set_next(head());
170 } 170 }
171 // Check that we are not passing a finalized external string to
172 // the callback.
173 ASSERT(!object_->IsExternalAsciiString() ||
174 ExternalAsciiString::cast(object_)->resource() != NULL);
175 ASSERT(!object_->IsExternalTwoByteString() ||
176 ExternalTwoByteString::cast(object_)->resource() != NULL);
171 // Leaving V8. 177 // Leaving V8.
172 VMState state(EXTERNAL); 178 VMState state(EXTERNAL);
173 func(object, par); 179 func(object, par);
174 } 180 }
175 return true; 181 return true;
176 } 182 }
177 183
178 // Place the handle address first to avoid offset computation. 184 // Place the handle address first to avoid offset computation.
179 Object* object_; // Storage for object pointer. 185 Object* object_; // Storage for object pointer.
180 186
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 506
501 507
502 void GlobalHandles::RemoveObjectGroups() { 508 void GlobalHandles::RemoveObjectGroups() {
503 List<ObjectGroup*>* object_groups = ObjectGroups(); 509 List<ObjectGroup*>* object_groups = ObjectGroups();
504 for (int i = 0; i< object_groups->length(); i++) { 510 for (int i = 0; i< object_groups->length(); i++) {
505 delete object_groups->at(i); 511 delete object_groups->at(i);
506 } 512 }
507 object_groups->Clear(); 513 object_groups->Clear();
508 } 514 }
509 515
510
511 } } // namespace v8::internal 516 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/globals.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698