| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 V(UnseededNumberDictionary, code_stubs, CodeStubs) \ | 149 V(UnseededNumberDictionary, code_stubs, CodeStubs) \ |
| 150 V(UnseededNumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ | 150 V(UnseededNumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ |
| 151 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \ | 151 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \ |
| 152 V(Code, js_entry_code, JsEntryCode) \ | 152 V(Code, js_entry_code, JsEntryCode) \ |
| 153 V(Code, js_construct_entry_code, JsConstructEntryCode) \ | 153 V(Code, js_construct_entry_code, JsConstructEntryCode) \ |
| 154 V(FixedArray, natives_source_cache, NativesSourceCache) \ | 154 V(FixedArray, natives_source_cache, NativesSourceCache) \ |
| 155 V(Object, last_script_id, LastScriptId) \ | 155 V(Object, last_script_id, LastScriptId) \ |
| 156 V(Script, empty_script, EmptyScript) \ | 156 V(Script, empty_script, EmptyScript) \ |
| 157 V(Smi, real_stack_limit, RealStackLimit) \ | 157 V(Smi, real_stack_limit, RealStackLimit) \ |
| 158 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ | 158 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ |
| 159 V(Smi, arguments_adaptor_deopt_pc_offset, ArgumentsAdaptorDeoptPCOffset) |
| 159 | 160 |
| 160 #define ROOT_LIST(V) \ | 161 #define ROOT_LIST(V) \ |
| 161 STRONG_ROOT_LIST(V) \ | 162 STRONG_ROOT_LIST(V) \ |
| 162 V(SymbolTable, symbol_table, SymbolTable) | 163 V(SymbolTable, symbol_table, SymbolTable) |
| 163 | 164 |
| 164 #define SYMBOL_LIST(V) \ | 165 #define SYMBOL_LIST(V) \ |
| 165 V(Array_symbol, "Array") \ | 166 V(Array_symbol, "Array") \ |
| 166 V(Object_symbol, "Object") \ | 167 V(Object_symbol, "Object") \ |
| 167 V(Proto_symbol, "__proto__") \ | 168 V(Proto_symbol, "__proto__") \ |
| 168 V(StringImpl_symbol, "StringImpl") \ | 169 V(StringImpl_symbol, "StringImpl") \ |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 global_gc_prologue_callback_ = callback; | 1061 global_gc_prologue_callback_ = callback; |
| 1061 } | 1062 } |
| 1062 void SetGlobalGCEpilogueCallback(GCCallback callback) { | 1063 void SetGlobalGCEpilogueCallback(GCCallback callback) { |
| 1063 ASSERT((callback == NULL) ^ (global_gc_epilogue_callback_ == NULL)); | 1064 ASSERT((callback == NULL) ^ (global_gc_epilogue_callback_ == NULL)); |
| 1064 global_gc_epilogue_callback_ = callback; | 1065 global_gc_epilogue_callback_ = callback; |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 // Heap root getters. We have versions with and without type::cast() here. | 1068 // Heap root getters. We have versions with and without type::cast() here. |
| 1068 // You can't use type::cast during GC because the assert fails. | 1069 // You can't use type::cast during GC because the assert fails. |
| 1069 // TODO(1490): Try removing the unchecked accessors, now that GC marking does | 1070 // TODO(1490): Try removing the unchecked accessors, now that GC marking does |
| 1070 // not corrupt the stack. | 1071 // not corrupt the map. |
| 1071 #define ROOT_ACCESSOR(type, name, camel_name) \ | 1072 #define ROOT_ACCESSOR(type, name, camel_name) \ |
| 1072 type* name() { \ | 1073 type* name() { \ |
| 1073 return type::cast(roots_[k##camel_name##RootIndex]); \ | 1074 return type::cast(roots_[k##camel_name##RootIndex]); \ |
| 1074 } \ | 1075 } \ |
| 1075 type* raw_unchecked_##name() { \ | 1076 type* raw_unchecked_##name() { \ |
| 1076 return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \ | 1077 return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \ |
| 1077 } | 1078 } |
| 1078 ROOT_LIST(ROOT_ACCESSOR) | 1079 ROOT_LIST(ROOT_ACCESSOR) |
| 1079 #undef ROOT_ACCESSOR | 1080 #undef ROOT_ACCESSOR |
| 1080 | 1081 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 bool idle_notification_will_schedule_next_gc() { | 1511 bool idle_notification_will_schedule_next_gc() { |
| 1511 return idle_notification_will_schedule_next_gc_; | 1512 return idle_notification_will_schedule_next_gc_; |
| 1512 } | 1513 } |
| 1513 | 1514 |
| 1514 uint32_t HashSeed() { | 1515 uint32_t HashSeed() { |
| 1515 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); | 1516 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); |
| 1516 ASSERT(FLAG_randomize_hashes || seed == 0); | 1517 ASSERT(FLAG_randomize_hashes || seed == 0); |
| 1517 return seed; | 1518 return seed; |
| 1518 } | 1519 } |
| 1519 | 1520 |
| 1521 void SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
| 1522 ASSERT(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
| 1523 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
| 1524 } |
| 1525 |
| 1520 private: | 1526 private: |
| 1521 Heap(); | 1527 Heap(); |
| 1522 | 1528 |
| 1523 // This can be calculated directly from a pointer to the heap; however, it is | 1529 // This can be calculated directly from a pointer to the heap; however, it is |
| 1524 // more expedient to get at the isolate directly from within Heap methods. | 1530 // more expedient to get at the isolate directly from within Heap methods. |
| 1525 Isolate* isolate_; | 1531 Isolate* isolate_; |
| 1526 | 1532 |
| 1527 intptr_t code_range_size_; | 1533 intptr_t code_range_size_; |
| 1528 int reserved_semispace_size_; | 1534 int reserved_semispace_size_; |
| 1529 int max_semispace_size_; | 1535 int max_semispace_size_; |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2622 private: | 2628 private: |
| 2623 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2629 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2624 }; | 2630 }; |
| 2625 #endif // DEBUG || LIVE_OBJECT_LIST | 2631 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2626 | 2632 |
| 2627 } } // namespace v8::internal | 2633 } } // namespace v8::internal |
| 2628 | 2634 |
| 2629 #undef HEAP | 2635 #undef HEAP |
| 2630 | 2636 |
| 2631 #endif // V8_HEAP_H_ | 2637 #endif // V8_HEAP_H_ |
| OLD | NEW |