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

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

Issue 8513010: Add pointer cache field to external string for access in generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 247
248 void Heap::FinalizeExternalString(String* string) { 248 void Heap::FinalizeExternalString(String* string) {
249 ASSERT(string->IsExternalString()); 249 ASSERT(string->IsExternalString());
250 v8::String::ExternalStringResourceBase** resource_addr = 250 v8::String::ExternalStringResourceBase** resource_addr =
251 reinterpret_cast<v8::String::ExternalStringResourceBase**>( 251 reinterpret_cast<v8::String::ExternalStringResourceBase**>(
252 reinterpret_cast<byte*>(string) + 252 reinterpret_cast<byte*>(string) +
253 ExternalString::kResourceOffset - 253 ExternalString::kResourceOffset -
254 kHeapObjectTag); 254 kHeapObjectTag);
255 255
256 // Clear pointer cache.
257 ExternalString::cast(string)->clear_data_cache();
258
256 // Dispose of the C++ object if it has not already been disposed. 259 // Dispose of the C++ object if it has not already been disposed.
257 if (*resource_addr != NULL) { 260 if (*resource_addr != NULL) {
258 (*resource_addr)->Dispose(); 261 (*resource_addr)->Dispose();
259 } 262 }
260 263
261 // Clear the resource pointer in the string. 264 // Clear the resource pointer in the string.
262 *resource_addr = NULL; 265 *resource_addr = NULL;
263 } 266 }
264 267
265 268
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 704
702 705
703 Heap* _inline_get_heap_() { 706 Heap* _inline_get_heap_() {
704 return HEAP; 707 return HEAP;
705 } 708 }
706 709
707 710
708 } } // namespace v8::internal 711 } } // namespace v8::internal
709 712
710 #endif // V8_HEAP_INL_H_ 713 #endif // V8_HEAP_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698