| 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 6868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6879 | 6879 |
| 6880 | 6880 |
| 6881 MaybeObject* Heap::AddWeakObjectToCodeDependency(Object* obj, | 6881 MaybeObject* Heap::AddWeakObjectToCodeDependency(Object* obj, |
| 6882 DependentCode* dep) { | 6882 DependentCode* dep) { |
| 6883 ASSERT(!InNewSpace(obj)); | 6883 ASSERT(!InNewSpace(obj)); |
| 6884 ASSERT(!InNewSpace(dep)); | 6884 ASSERT(!InNewSpace(dep)); |
| 6885 MaybeObject* maybe_obj = | 6885 MaybeObject* maybe_obj = |
| 6886 WeakHashTable::cast(weak_object_to_code_table_)->Put(obj, dep); | 6886 WeakHashTable::cast(weak_object_to_code_table_)->Put(obj, dep); |
| 6887 WeakHashTable* table; | 6887 WeakHashTable* table; |
| 6888 if (!maybe_obj->To(&table)) return maybe_obj; | 6888 if (!maybe_obj->To(&table)) return maybe_obj; |
| 6889 if (ShouldZapGarbage() && weak_object_to_code_table_ != table) { |
| 6890 WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value()); |
| 6891 } |
| 6889 set_weak_object_to_code_table(table); | 6892 set_weak_object_to_code_table(table); |
| 6890 ASSERT_EQ(dep, WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj)); | 6893 ASSERT_EQ(dep, WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj)); |
| 6891 return weak_object_to_code_table_; | 6894 return weak_object_to_code_table_; |
| 6892 } | 6895 } |
| 6893 | 6896 |
| 6894 | 6897 |
| 6895 DependentCode* Heap::LookupWeakObjectToCodeDependency(Object* obj) { | 6898 DependentCode* Heap::LookupWeakObjectToCodeDependency(Object* obj) { |
| 6896 Object* dep = WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj); | 6899 Object* dep = WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj); |
| 6897 if (dep->IsDependentCode()) return DependentCode::cast(dep); | 6900 if (dep->IsDependentCode()) return DependentCode::cast(dep); |
| 6898 return DependentCode::cast(empty_fixed_array()); | 6901 return DependentCode::cast(empty_fixed_array()); |
| (...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7899 if (FLAG_concurrent_recompilation) { | 7902 if (FLAG_concurrent_recompilation) { |
| 7900 heap_->relocation_mutex_->Lock(); | 7903 heap_->relocation_mutex_->Lock(); |
| 7901 #ifdef DEBUG | 7904 #ifdef DEBUG |
| 7902 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7905 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 7903 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7906 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 7904 #endif // DEBUG | 7907 #endif // DEBUG |
| 7905 } | 7908 } |
| 7906 } | 7909 } |
| 7907 | 7910 |
| 7908 } } // namespace v8::internal | 7911 } } // namespace v8::internal |
| OLD | NEW |