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

Side by Side Diff: src/heap.h

Issue 8143018: Revert "Added ability to lock strings to prevent their representation or encoding from changing." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/handles.cc ('k') | src/heap.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 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 V(Map, global_context_map, GlobalContextMap) \ 70 V(Map, global_context_map, GlobalContextMap) \
71 V(Map, fixed_array_map, FixedArrayMap) \ 71 V(Map, fixed_array_map, FixedArrayMap) \
72 V(Map, serialized_scope_info_map, SerializedScopeInfoMap) \ 72 V(Map, serialized_scope_info_map, SerializedScopeInfoMap) \
73 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 73 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
74 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ 74 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
75 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 75 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
76 V(Map, meta_map, MetaMap) \ 76 V(Map, meta_map, MetaMap) \
77 V(Map, hash_table_map, HashTableMap) \ 77 V(Map, hash_table_map, HashTableMap) \
78 V(Smi, stack_limit, StackLimit) \ 78 V(Smi, stack_limit, StackLimit) \
79 V(FixedArray, number_string_cache, NumberStringCache) \ 79 V(FixedArray, number_string_cache, NumberStringCache) \
80 V(FixedArray, string_locks, StringLocks) \
81 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ 80 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
82 V(Object, instanceof_cache_map, InstanceofCacheMap) \ 81 V(Object, instanceof_cache_map, InstanceofCacheMap) \
83 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ 82 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
84 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ 83 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
85 V(FixedArray, string_split_cache, StringSplitCache) \ 84 V(FixedArray, string_split_cache, StringSplitCache) \
86 V(Object, termination_exception, TerminationException) \ 85 V(Object, termination_exception, TerminationException) \
87 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ 86 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
88 V(ByteArray, empty_byte_array, EmptyByteArray) \ 87 V(ByteArray, empty_byte_array, EmptyByteArray) \
89 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ 88 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \
90 V(String, empty_string, EmptyString) \ 89 V(String, empty_string, EmptyString) \
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 // 1192 //
1194 // Support for the API. 1193 // Support for the API.
1195 // 1194 //
1196 1195
1197 bool CreateApiObjects(); 1196 bool CreateApiObjects();
1198 1197
1199 // Attempt to find the number in a small cache. If we finds it, return 1198 // Attempt to find the number in a small cache. If we finds it, return
1200 // the string representation of the number. Otherwise return undefined. 1199 // the string representation of the number. Otherwise return undefined.
1201 Object* GetNumberStringCache(Object* number); 1200 Object* GetNumberStringCache(Object* number);
1202 1201
1203 // Locks a string to prevent changes to the string's representation or
1204 // encoding, e.g., due to externalization.
1205 // It does not prevent moving the string during a GC
1206 // (i.e., it's not a way to keep a pointer to an underlying character
1207 // sequence valid). Might fail if the underlying data structure can't
1208 // grow to accomodate the string, otherwise returns the string itself.
1209 //
1210 // Stores data in Heap::string_locks(), a FixedArray with the number
1211 // of filled in elements in the first position, and that number of
1212 // string pointers in the following positions (in no particular order).
1213 // The FixedArray is padded with undefined or similar uninteresting values.
1214 MaybeObject* LockString(String* string);
1215 // Removes the lock on the string.
1216 void UnlockString(String* string);
1217 // Check if a string is locked.
1218 bool IsStringLocked(String* string);
1219 // Initializes the data structure underlying LockString.
1220 MaybeObject* InitializeStringLocks();
1221
1222 // Update the cache with a new number-string pair. 1202 // Update the cache with a new number-string pair.
1223 void SetNumberStringCache(Object* number, String* str); 1203 void SetNumberStringCache(Object* number, String* str);
1224 1204
1225 // Adjusts the amount of registered external memory. 1205 // Adjusts the amount of registered external memory.
1226 // Returns the adjusted value. 1206 // Returns the adjusted value.
1227 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); 1207 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
1228 1208
1229 // Allocate uninitialized fixed array. 1209 // Allocate uninitialized fixed array.
1230 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length); 1210 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length);
1231 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length, 1211 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length,
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 2464
2485 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2465 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2486 }; 2466 };
2487 #endif // DEBUG || LIVE_OBJECT_LIST 2467 #endif // DEBUG || LIVE_OBJECT_LIST
2488 2468
2489 } } // namespace v8::internal 2469 } } // namespace v8::internal
2490 2470
2491 #undef HEAP 2471 #undef HEAP
2492 2472
2493 #endif // V8_HEAP_H_ 2473 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698