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 5638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5649 } | 5649 } |
5650 UNREACHABLE(); | 5650 UNREACHABLE(); |
5651 } | 5651 } |
5652 | 5652 |
5653 | 5653 |
5654 // TODO(ishell): Find a better place for this. | 5654 // TODO(ishell): Find a better place for this. |
5655 void Heap::AddWeakObjectToCodeDependency(Handle<Object> obj, | 5655 void Heap::AddWeakObjectToCodeDependency(Handle<Object> obj, |
5656 Handle<DependentCode> dep) { | 5656 Handle<DependentCode> dep) { |
5657 ASSERT(!InNewSpace(*obj)); | 5657 ASSERT(!InNewSpace(*obj)); |
5658 ASSERT(!InNewSpace(*dep)); | 5658 ASSERT(!InNewSpace(*dep)); |
| 5659 HandleScope scope(isolate()); |
5659 Handle<WeakHashTable> table(WeakHashTable::cast(weak_object_to_code_table_), | 5660 Handle<WeakHashTable> table(WeakHashTable::cast(weak_object_to_code_table_), |
5660 isolate()); | 5661 isolate()); |
5661 table = WeakHashTable::Put(table, obj, dep); | 5662 table = WeakHashTable::Put(table, obj, dep); |
5662 | 5663 |
5663 if (ShouldZapGarbage() && weak_object_to_code_table_ != *table) { | 5664 if (ShouldZapGarbage() && weak_object_to_code_table_ != *table) { |
5664 WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value()); | 5665 WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value()); |
5665 } | 5666 } |
5666 set_weak_object_to_code_table(*table); | 5667 set_weak_object_to_code_table(*table); |
5667 ASSERT_EQ(*dep, table->Lookup(*obj)); | 5668 ASSERT_EQ(*dep, table->Lookup(*obj)); |
5668 } | 5669 } |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6655 static_cast<int>(object_sizes_last_time_[index])); | 6656 static_cast<int>(object_sizes_last_time_[index])); |
6656 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6657 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6657 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6658 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6658 | 6659 |
6659 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6660 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6660 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6661 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6661 ClearObjectStats(); | 6662 ClearObjectStats(); |
6662 } | 6663 } |
6663 | 6664 |
6664 } } // namespace v8::internal | 6665 } } // namespace v8::internal |
OLD | NEW |