| 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(Smi, hash_seed, HashSeed) \ |
| 83 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 83 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
| 84 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 84 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
| 85 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ | 85 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ |
| 86 V(String, empty_string, EmptyString) \ | 86 V(String, empty_string, EmptyString) \ |
| 87 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ | 87 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
| 88 V(Map, string_map, StringMap) \ | 88 V(Map, string_map, StringMap) \ |
| 89 V(Map, ascii_string_map, AsciiStringMap) \ | 89 V(Map, ascii_string_map, AsciiStringMap) \ |
| 90 V(Map, symbol_map, SymbolMap) \ | 90 V(Map, symbol_map, SymbolMap) \ |
| 91 V(Map, cons_string_map, ConsStringMap) \ | 91 V(Map, cons_string_map, ConsStringMap) \ |
| 92 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ | 92 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 121 V(Map, oddball_map, OddballMap) \ | 121 V(Map, oddball_map, OddballMap) \ |
| 122 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ | 122 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ |
| 123 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ | 123 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ |
| 124 V(Map, message_object_map, JSMessageObjectMap) \ | 124 V(Map, message_object_map, JSMessageObjectMap) \ |
| 125 V(Map, foreign_map, ForeignMap) \ | 125 V(Map, foreign_map, ForeignMap) \ |
| 126 V(Object, nan_value, NanValue) \ | 126 V(Object, nan_value, NanValue) \ |
| 127 V(Object, minus_zero_value, MinusZeroValue) \ | 127 V(Object, minus_zero_value, MinusZeroValue) \ |
| 128 V(Map, neander_map, NeanderMap) \ | 128 V(Map, neander_map, NeanderMap) \ |
| 129 V(JSObject, message_listeners, MessageListeners) \ | 129 V(JSObject, message_listeners, MessageListeners) \ |
| 130 V(Foreign, prototype_accessors, PrototypeAccessors) \ | 130 V(Foreign, prototype_accessors, PrototypeAccessors) \ |
| 131 V(NumberDictionary, code_stubs, CodeStubs) \ | 131 V(UnseededNumberDictionary, code_stubs, CodeStubs) \ |
| 132 V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ | 132 V(UnseededNumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ |
| 133 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \ | 133 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \ |
| 134 V(Code, js_entry_code, JsEntryCode) \ | 134 V(Code, js_entry_code, JsEntryCode) \ |
| 135 V(Code, js_construct_entry_code, JsConstructEntryCode) \ | 135 V(Code, js_construct_entry_code, JsConstructEntryCode) \ |
| 136 V(FixedArray, natives_source_cache, NativesSourceCache) \ | 136 V(FixedArray, natives_source_cache, NativesSourceCache) \ |
| 137 V(Object, last_script_id, LastScriptId) \ | 137 V(Object, last_script_id, LastScriptId) \ |
| 138 V(Script, empty_script, EmptyScript) \ | 138 V(Script, empty_script, EmptyScript) \ |
| 139 V(Smi, real_stack_limit, RealStackLimit) \ | 139 V(Smi, real_stack_limit, RealStackLimit) \ |
| 140 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ | 140 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ |
| 141 | 141 |
| 142 #define ROOT_LIST(V) \ | 142 #define ROOT_LIST(V) \ |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 // Checks whether an address/object in a space. | 1030 // Checks whether an address/object in a space. |
| 1031 // Currently used by tests, serialization and heap verification only. | 1031 // Currently used by tests, serialization and heap verification only. |
| 1032 bool InSpace(Address addr, AllocationSpace space); | 1032 bool InSpace(Address addr, AllocationSpace space); |
| 1033 bool InSpace(HeapObject* value, AllocationSpace space); | 1033 bool InSpace(HeapObject* value, AllocationSpace space); |
| 1034 | 1034 |
| 1035 // Finds out which space an object should get promoted to based on its type. | 1035 // Finds out which space an object should get promoted to based on its type. |
| 1036 inline OldSpace* TargetSpace(HeapObject* object); | 1036 inline OldSpace* TargetSpace(HeapObject* object); |
| 1037 inline AllocationSpace TargetSpaceId(InstanceType type); | 1037 inline AllocationSpace TargetSpaceId(InstanceType type); |
| 1038 | 1038 |
| 1039 // Sets the stub_cache_ (only used when expanding the dictionary). | 1039 // Sets the stub_cache_ (only used when expanding the dictionary). |
| 1040 void public_set_code_stubs(NumberDictionary* value) { | 1040 void public_set_code_stubs(UnseededNumberDictionary* value) { |
| 1041 roots_[kCodeStubsRootIndex] = value; | 1041 roots_[kCodeStubsRootIndex] = value; |
| 1042 } | 1042 } |
| 1043 | 1043 |
| 1044 // Support for computing object sizes for old objects during GCs. Returns | 1044 // Support for computing object sizes for old objects during GCs. Returns |
| 1045 // a function that is guaranteed to be safe for computing object sizes in | 1045 // a function that is guaranteed to be safe for computing object sizes in |
| 1046 // the current GC phase. | 1046 // the current GC phase. |
| 1047 HeapObjectCallback GcSafeSizeOfOldObjectFunction() { | 1047 HeapObjectCallback GcSafeSizeOfOldObjectFunction() { |
| 1048 return gc_safe_size_of_old_object_; | 1048 return gc_safe_size_of_old_object_; |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary). | 1051 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary). |
| 1052 void public_set_non_monomorphic_cache(NumberDictionary* value) { | 1052 void public_set_non_monomorphic_cache(UnseededNumberDictionary* value) { |
| 1053 roots_[kNonMonomorphicCacheRootIndex] = value; | 1053 roots_[kNonMonomorphicCacheRootIndex] = value; |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 void public_set_empty_script(Script* script) { | 1056 void public_set_empty_script(Script* script) { |
| 1057 roots_[kEmptyScriptRootIndex] = script; | 1057 roots_[kEmptyScriptRootIndex] = script; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 // Update the next script id. | 1060 // Update the next script id. |
| 1061 inline void SetLastScriptId(Object* last_script_id); | 1061 inline void SetLastScriptId(Object* last_script_id); |
| 1062 | 1062 |
| (...skipping 231 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() { | 1304 uint32_t HashSeed() { |
| 1305 uint32_t seed = static_cast<uint32_t>(string_hash_seed()->value()); | 1305 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); |
| 1306 ASSERT(FLAG_randomize_string_hashes || seed == 0); | 1306 ASSERT(FLAG_randomize_hashes || seed == 0); |
| 1307 return seed; | 1307 return seed; |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 private: | 1310 private: |
| 1311 Heap(); | 1311 Heap(); |
| 1312 | 1312 |
| 1313 // 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 |
| 1314 // 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. |
| 1315 Isolate* isolate_; | 1315 Isolate* isolate_; |
| 1316 | 1316 |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2355 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2355 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2356 }; | 2356 }; |
| 2357 #endif // DEBUG || LIVE_OBJECT_LIST | 2357 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2358 | 2358 |
| 2359 | 2359 |
| 2360 } } // namespace v8::internal | 2360 } } // namespace v8::internal |
| 2361 | 2361 |
| 2362 #undef HEAP | 2362 #undef HEAP |
| 2363 | 2363 |
| 2364 #endif // V8_HEAP_H_ | 2364 #endif // V8_HEAP_H_ |
| OLD | NEW |