| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 V(Map, meta_map, MetaMap) \ | 72 V(Map, meta_map, MetaMap) \ |
| 73 V(Map, hash_table_map, HashTableMap) \ | 73 V(Map, hash_table_map, HashTableMap) \ |
| 74 V(Smi, stack_limit, StackLimit) \ | 74 V(Smi, stack_limit, StackLimit) \ |
| 75 V(FixedArray, number_string_cache, NumberStringCache) \ | 75 V(FixedArray, number_string_cache, NumberStringCache) \ |
| 76 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ | 76 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ |
| 77 V(Object, instanceof_cache_map, InstanceofCacheMap) \ | 77 V(Object, instanceof_cache_map, InstanceofCacheMap) \ |
| 78 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ | 78 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ |
| 79 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ | 79 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ |
| 80 V(FixedArray, string_split_cache, StringSplitCache) \ | 80 V(FixedArray, string_split_cache, StringSplitCache) \ |
| 81 V(Object, termination_exception, TerminationException) \ | 81 V(Object, termination_exception, TerminationException) \ |
| 82 V(Smi, string_hash_seed, StringHashSeed) \ |
| 82 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 83 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
| 83 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 84 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
| 84 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ | 85 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ |
| 85 V(String, empty_string, EmptyString) \ | 86 V(String, empty_string, EmptyString) \ |
| 86 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ | 87 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
| 87 V(Map, string_map, StringMap) \ | 88 V(Map, string_map, StringMap) \ |
| 88 V(Map, ascii_string_map, AsciiStringMap) \ | 89 V(Map, ascii_string_map, AsciiStringMap) \ |
| 89 V(Map, symbol_map, SymbolMap) \ | 90 V(Map, symbol_map, SymbolMap) \ |
| 90 V(Map, cons_string_map, ConsStringMap) \ | 91 V(Map, cons_string_map, ConsStringMap) \ |
| 91 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ | 92 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 // the provided data as the relocation information. | 835 // the provided data as the relocation information. |
| 835 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info); | 836 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info); |
| 836 | 837 |
| 837 // Finds the symbol for string in the symbol table. | 838 // Finds the symbol for string in the symbol table. |
| 838 // If not found, a new symbol is added to the table and returned. | 839 // If not found, a new symbol is added to the table and returned. |
| 839 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation | 840 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation |
| 840 // failed. | 841 // failed. |
| 841 // Please note this function does not perform a garbage collection. | 842 // Please note this function does not perform a garbage collection. |
| 842 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str); | 843 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str); |
| 843 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str); | 844 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str); |
| 844 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol( | 845 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str); |
| 845 Vector<const uc16> str); | |
| 846 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(const char* str) { | 846 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(const char* str) { |
| 847 return LookupSymbol(CStrVector(str)); | 847 return LookupSymbol(CStrVector(str)); |
| 848 } | 848 } |
| 849 MUST_USE_RESULT MaybeObject* LookupSymbol(String* str); | 849 MUST_USE_RESULT MaybeObject* LookupSymbol(String* str); |
| 850 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Handle<SeqAsciiString> string, | 850 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Handle<SeqAsciiString> string, |
| 851 int from, | 851 int from, |
| 852 int length); | 852 int length); |
| 853 | 853 |
| 854 bool LookupSymbolIfExists(String* str, String** symbol); | 854 bool LookupSymbolIfExists(String* str, String** symbol); |
| 855 bool LookupTwoCharsSymbolIfExists(String* str, String** symbol); | 855 bool LookupTwoCharsSymbolIfExists(String* str, String** symbol); |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 bool is_safe_to_read_maps() { return is_safe_to_read_maps_; } | 1294 bool is_safe_to_read_maps() { return is_safe_to_read_maps_; } |
| 1295 | 1295 |
| 1296 void CallGlobalGCPrologueCallback() { | 1296 void CallGlobalGCPrologueCallback() { |
| 1297 if (global_gc_prologue_callback_ != NULL) global_gc_prologue_callback_(); | 1297 if (global_gc_prologue_callback_ != NULL) global_gc_prologue_callback_(); |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 void CallGlobalGCEpilogueCallback() { | 1300 void CallGlobalGCEpilogueCallback() { |
| 1301 if (global_gc_epilogue_callback_ != NULL) global_gc_epilogue_callback_(); | 1301 if (global_gc_epilogue_callback_ != NULL) global_gc_epilogue_callback_(); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 uint32_t StringHashSeed() { |
| 1305 uint32_t seed = static_cast<uint32_t>(string_hash_seed()->value()); |
| 1306 ASSERT(FLAG_randomize_string_hashes || seed == 0); |
| 1307 return seed; |
| 1308 } |
| 1309 |
| 1304 private: | 1310 private: |
| 1305 Heap(); | 1311 Heap(); |
| 1306 | 1312 |
| 1307 // This can be calculated directly from a pointer to the heap; however, it is | 1313 // This can be calculated directly from a pointer to the heap; however, it is |
| 1308 // more expedient to get at the isolate directly from within Heap methods. | 1314 // more expedient to get at the isolate directly from within Heap methods. |
| 1309 Isolate* isolate_; | 1315 Isolate* isolate_; |
| 1310 | 1316 |
| 1311 int reserved_semispace_size_; | 1317 int reserved_semispace_size_; |
| 1312 int max_semispace_size_; | 1318 int max_semispace_size_; |
| 1313 int initial_semispace_size_; | 1319 int initial_semispace_size_; |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2355 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2350 }; | 2356 }; |
| 2351 #endif // DEBUG || LIVE_OBJECT_LIST | 2357 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2352 | 2358 |
| 2353 | 2359 |
| 2354 } } // namespace v8::internal | 2360 } } // namespace v8::internal |
| 2355 | 2361 |
| 2356 #undef HEAP | 2362 #undef HEAP |
| 2357 | 2363 |
| 2358 #endif // V8_HEAP_H_ | 2364 #endif // V8_HEAP_H_ |
| OLD | NEW |