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

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

Issue 8677006: Recommit introducing short external strings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixing webkit failures. Created 9 years, 1 month 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
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 249
250 void Heap::FinalizeExternalString(String* string) { 250 void Heap::FinalizeExternalString(String* string) {
251 ASSERT(string->IsExternalString()); 251 ASSERT(string->IsExternalString());
252 v8::String::ExternalStringResourceBase** resource_addr = 252 v8::String::ExternalStringResourceBase** resource_addr =
253 reinterpret_cast<v8::String::ExternalStringResourceBase**>( 253 reinterpret_cast<v8::String::ExternalStringResourceBase**>(
254 reinterpret_cast<byte*>(string) + 254 reinterpret_cast<byte*>(string) +
255 ExternalString::kResourceOffset - 255 ExternalString::kResourceOffset -
256 kHeapObjectTag); 256 kHeapObjectTag);
257 257
258 // Clear pointer cache.
259 ExternalString::cast(string)->clear_data_cache();
260
261 // Dispose of the C++ object if it has not already been disposed. 258 // Dispose of the C++ object if it has not already been disposed.
262 if (*resource_addr != NULL) { 259 if (*resource_addr != NULL) {
263 (*resource_addr)->Dispose(); 260 (*resource_addr)->Dispose();
261 *resource_addr = NULL;
264 } 262 }
265
266 // Clear the resource pointer in the string.
267 *resource_addr = NULL;
268 } 263 }
269 264
270 265
271 MaybeObject* Heap::AllocateRawMap() { 266 MaybeObject* Heap::AllocateRawMap() {
272 #ifdef DEBUG 267 #ifdef DEBUG
273 isolate_->counters()->objs_since_last_full()->Increment(); 268 isolate_->counters()->objs_since_last_full()->Increment();
274 isolate_->counters()->objs_since_last_young()->Increment(); 269 isolate_->counters()->objs_since_last_young()->Increment();
275 #endif 270 #endif
276 MaybeObject* result = map_space_->AllocateRaw(Map::kSize); 271 MaybeObject* result = map_space_->AllocateRaw(Map::kSize);
277 if (result->IsFailure()) old_gen_exhausted_ = true; 272 if (result->IsFailure()) old_gen_exhausted_ = true;
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 701
707 702
708 Heap* _inline_get_heap_() { 703 Heap* _inline_get_heap_() {
709 return HEAP; 704 return HEAP;
710 } 705 }
711 706
712 707
713 } } // namespace v8::internal 708 } } // namespace v8::internal
714 709
715 #endif // V8_HEAP_INL_H_ 710 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698