Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: src/objects-visiting-inl.h

Issue 11092081: Reland r12342: Flush monomorphic ICs on context disposal instead of context exit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 template<typename StaticVisitor> 208 template<typename StaticVisitor>
209 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( 209 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget(
210 Heap* heap, RelocInfo* rinfo) { 210 Heap* heap, RelocInfo* rinfo) {
211 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); 211 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
212 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 212 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
213 // Monomorphic ICs are preserved when possible, but need to be flushed 213 // Monomorphic ICs are preserved when possible, but need to be flushed
214 // when they might be keeping a Context alive, or when the heap is about 214 // when they might be keeping a Context alive, or when the heap is about
215 // to be serialized. 215 // to be serialized.
216 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() 216 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()
217 && (target->ic_state() == MEGAMORPHIC || Serializer::enabled() || 217 && (target->ic_state() == MEGAMORPHIC || heap->flush_monomorphic_ics() ||
218 heap->isolate()->context_exit_happened() || 218 Serializer::enabled() || target->ic_age() != heap->global_ic_age())) {
219 target->ic_age() != heap->global_ic_age())) {
220 IC::Clear(rinfo->pc()); 219 IC::Clear(rinfo->pc());
221 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 220 target = Code::GetCodeFromTargetAddress(rinfo->target_address());
222 } 221 }
223 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); 222 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target);
224 StaticVisitor::MarkObject(heap, target); 223 StaticVisitor::MarkObject(heap, target);
225 } 224 }
226 225
227 226
228 template<typename StaticVisitor> 227 template<typename StaticVisitor>
229 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( 228 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext(
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 RelocIterator it(this, mode_mask); 403 RelocIterator it(this, mode_mask);
405 for (; !it.done(); it.next()) { 404 for (; !it.done(); it.next()) {
406 it.rinfo()->template Visit<StaticVisitor>(heap); 405 it.rinfo()->template Visit<StaticVisitor>(heap);
407 } 406 }
408 } 407 }
409 408
410 409
411 } } // namespace v8::internal 410 } } // namespace v8::internal
412 411
413 #endif // V8_OBJECTS_VISITING_INL_H_ 412 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698