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

Side by Side Diff: src/heap.h

Issue 7977001: 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: More tweaks. Created 9 years, 3 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') | src/heap.cc » ('J')
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 V(Map, global_context_map, GlobalContextMap) \ 69 V(Map, global_context_map, GlobalContextMap) \
70 V(Map, fixed_array_map, FixedArrayMap) \ 70 V(Map, fixed_array_map, FixedArrayMap) \
71 V(Map, serialized_scope_info_map, SerializedScopeInfoMap) \ 71 V(Map, serialized_scope_info_map, SerializedScopeInfoMap) \
72 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 72 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
73 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ 73 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
74 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 74 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
75 V(Map, meta_map, MetaMap) \ 75 V(Map, meta_map, MetaMap) \
76 V(Map, hash_table_map, HashTableMap) \ 76 V(Map, hash_table_map, HashTableMap) \
77 V(Smi, stack_limit, StackLimit) \ 77 V(Smi, stack_limit, StackLimit) \
78 V(FixedArray, number_string_cache, NumberStringCache) \ 78 V(FixedArray, number_string_cache, NumberStringCache) \
79 V(FixedArray, string_locks, StringLocks) \
79 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ 80 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
80 V(Object, instanceof_cache_map, InstanceofCacheMap) \ 81 V(Object, instanceof_cache_map, InstanceofCacheMap) \
81 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ 82 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
82 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ 83 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
83 V(FixedArray, string_split_cache, StringSplitCache) \ 84 V(FixedArray, string_split_cache, StringSplitCache) \
84 V(Object, termination_exception, TerminationException) \ 85 V(Object, termination_exception, TerminationException) \
85 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ 86 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
86 V(ByteArray, empty_byte_array, EmptyByteArray) \ 87 V(ByteArray, empty_byte_array, EmptyByteArray) \
87 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ 88 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \
88 V(String, empty_string, EmptyString) \ 89 V(String, empty_string, EmptyString) \
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 // 1201 //
1201 // Support for the API. 1202 // Support for the API.
1202 // 1203 //
1203 1204
1204 bool CreateApiObjects(); 1205 bool CreateApiObjects();
1205 1206
1206 // Attempt to find the number in a small cache. If we finds it, return 1207 // Attempt to find the number in a small cache. If we finds it, return
1207 // the string representation of the number. Otherwise return undefined. 1208 // the string representation of the number. Otherwise return undefined.
1208 Object* GetNumberStringCache(Object* number); 1209 Object* GetNumberStringCache(Object* number);
1209 1210
1211 // Locks a string to prevent changes to the string's representation or
1212 // encoding, e.g., due to externalization.
1213 // It does not prevent moving the string during a GC
1214 // (i.e., it's not a way to keep a pointer to an underlying character
1215 // sequence valid). Might fail if the underlying data structure can't
1216 // grow to accomodate the string, otherwise returns the string itself.
1217 MaybeObject* LockString(String* string);
1218 // Removes the lock on the string.
1219 void UnlockString(String* string);
1220 // Check if a string is locked.
1221 bool IsStringLocked(String* string);
1222 // Initializes the data structure underlying LockString.
1223 MaybeObject* InitializeStringLocks();
1224
1210 // Update the cache with a new number-string pair. 1225 // Update the cache with a new number-string pair.
1211 void SetNumberStringCache(Object* number, String* str); 1226 void SetNumberStringCache(Object* number, String* str);
1212 1227
1213 // Adjusts the amount of registered external memory. 1228 // Adjusts the amount of registered external memory.
1214 // Returns the adjusted value. 1229 // Returns the adjusted value.
1215 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); 1230 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
1216 1231
1217 // Allocate uninitialized fixed array. 1232 // Allocate uninitialized fixed array.
1218 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length); 1233 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length);
1219 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length, 1234 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length,
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2477 2492
2478 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2493 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2479 }; 2494 };
2480 #endif // DEBUG || LIVE_OBJECT_LIST 2495 #endif // DEBUG || LIVE_OBJECT_LIST
2481 2496
2482 } } // namespace v8::internal 2497 } } // namespace v8::internal
2483 2498
2484 #undef HEAP 2499 #undef HEAP
2485 2500
2486 #endif // V8_HEAP_H_ 2501 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698