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

Side by Side Diff: src/heap-inl.h

Issue 2658008: Remove the SetExternalStringDiposeCallback API... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 112
113 void Heap::FinalizeExternalString(String* string) { 113 void Heap::FinalizeExternalString(String* string) {
114 ASSERT(string->IsExternalString()); 114 ASSERT(string->IsExternalString());
115 v8::String::ExternalStringResourceBase** resource_addr = 115 v8::String::ExternalStringResourceBase** resource_addr =
116 reinterpret_cast<v8::String::ExternalStringResourceBase**>( 116 reinterpret_cast<v8::String::ExternalStringResourceBase**>(
117 reinterpret_cast<byte*>(string) + 117 reinterpret_cast<byte*>(string) +
118 ExternalString::kResourceOffset - 118 ExternalString::kResourceOffset -
119 kHeapObjectTag); 119 kHeapObjectTag);
120 120
121 // Dispose of the C++ object. 121 // Dispose of the C++ object if it has not already been disposed.
122 if (external_string_dispose_callback_ != NULL) { 122 if (*resource_addr != NULL) {
123 external_string_dispose_callback_(*resource_addr); 123 (*resource_addr)->Dispose();
124 } else {
125 delete *resource_addr;
126 } 124 }
127 125
128 // Clear the resource pointer in the string. 126 // Clear the resource pointer in the string.
129 *resource_addr = NULL; 127 *resource_addr = NULL;
130 } 128 }
131 129
132 130
133 Object* Heap::AllocateRawMap() { 131 Object* Heap::AllocateRawMap() {
134 #ifdef DEBUG 132 #ifdef DEBUG
135 Counters::objs_since_last_full.Increment(); 133 Counters::objs_since_last_full.Increment();
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 487
490 488
491 void ExternalStringTable::ShrinkNewStrings(int position) { 489 void ExternalStringTable::ShrinkNewStrings(int position) {
492 new_space_strings_.Rewind(position); 490 new_space_strings_.Rewind(position);
493 Verify(); 491 Verify();
494 } 492 }
495 493
496 } } // namespace v8::internal 494 } } // namespace v8::internal
497 495
498 #endif // V8_HEAP_INL_H_ 496 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698