Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 // that there can be no such embedded pointers and add assertion here. | 874 // that there can be no such embedded pointers and add assertion here. |
| 875 HeapObject* object = HeapObject::cast(rinfo->target_object()); | 875 HeapObject* object = HeapObject::cast(rinfo->target_object()); |
| 876 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 876 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
| 877 MarkBit mark = Marking::MarkBitFrom(object); | 877 MarkBit mark = Marking::MarkBitFrom(object); |
| 878 heap->mark_compact_collector()->MarkObject(object, mark); | 878 heap->mark_compact_collector()->MarkObject(object, mark); |
| 879 } | 879 } |
| 880 | 880 |
| 881 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 881 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
| 882 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 882 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
| 883 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 883 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 884 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { | 884 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
| 885 && (target->ic_state() == MEGAMORPHIC || Serializer::enabled() || | |
|
Vyacheslav Egorov (Chromium)
2012/01/18 14:09:21
store (Serializer::enabled() || heap->isolate()->s
Jakob Kummerow
2012/01/18 15:02:40
Done.
| |
| 886 heap->isolate()->context_exit_happened())) { | |
| 885 IC::Clear(rinfo->pc()); | 887 IC::Clear(rinfo->pc()); |
| 886 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 888 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 887 } else { | 889 } else { |
| 888 if (FLAG_cleanup_code_caches_at_gc && | 890 if (FLAG_cleanup_code_caches_at_gc && |
| 889 target->kind() == Code::STUB && | 891 target->kind() == Code::STUB && |
| 890 target->major_key() == CodeStub::CallFunction && | 892 target->major_key() == CodeStub::CallFunction && |
| 891 target->has_function_cache()) { | 893 target->has_function_cache()) { |
| 892 CallFunctionStub::Clear(heap, rinfo->pc()); | 894 CallFunctionStub::Clear(heap, rinfo->pc()); |
| 893 } | 895 } |
| 894 } | 896 } |
| (...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2173 heap()->isolate()->global_handles()->RemoveObjectGroups(); | 2175 heap()->isolate()->global_handles()->RemoveObjectGroups(); |
| 2174 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); | 2176 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); |
| 2175 | 2177 |
| 2176 // Flush code from collected candidates. | 2178 // Flush code from collected candidates. |
| 2177 if (is_code_flushing_enabled()) { | 2179 if (is_code_flushing_enabled()) { |
| 2178 code_flusher_->ProcessCandidates(); | 2180 code_flusher_->ProcessCandidates(); |
| 2179 } | 2181 } |
| 2180 | 2182 |
| 2181 // Clean up dead objects from the runtime profiler. | 2183 // Clean up dead objects from the runtime profiler. |
| 2182 heap()->isolate()->runtime_profiler()->RemoveDeadSamples(); | 2184 heap()->isolate()->runtime_profiler()->RemoveDeadSamples(); |
| 2185 | |
| 2186 heap()->isolate()->set_context_exit_happened(false); | |
| 2183 } | 2187 } |
| 2184 | 2188 |
| 2185 | 2189 |
| 2186 void MarkCompactCollector::ProcessMapCaches() { | 2190 void MarkCompactCollector::ProcessMapCaches() { |
| 2187 Object* raw_context = heap()->global_contexts_list_; | 2191 Object* raw_context = heap()->global_contexts_list_; |
| 2188 while (raw_context != heap()->undefined_value()) { | 2192 while (raw_context != heap()->undefined_value()) { |
| 2189 Context* context = reinterpret_cast<Context*>(raw_context); | 2193 Context* context = reinterpret_cast<Context*>(raw_context); |
| 2190 if (IsMarked(context)) { | 2194 if (IsMarked(context)) { |
| 2191 HeapObject* raw_map_cache = | 2195 HeapObject* raw_map_cache = |
| 2192 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX)); | 2196 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX)); |
| (...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3907 while (buffer != NULL) { | 3911 while (buffer != NULL) { |
| 3908 SlotsBuffer* next_buffer = buffer->next(); | 3912 SlotsBuffer* next_buffer = buffer->next(); |
| 3909 DeallocateBuffer(buffer); | 3913 DeallocateBuffer(buffer); |
| 3910 buffer = next_buffer; | 3914 buffer = next_buffer; |
| 3911 } | 3915 } |
| 3912 *buffer_address = NULL; | 3916 *buffer_address = NULL; |
| 3913 } | 3917 } |
| 3914 | 3918 |
| 3915 | 3919 |
| 3916 } } // namespace v8::internal | 3920 } } // namespace v8::internal |
| OLD | NEW |