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

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

Issue 15119004: Put preservation of optimized code map behind a flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/flag-definitions.h ('k') | no next file » | 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 305
306 template<typename StaticVisitor> 306 template<typename StaticVisitor>
307 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( 307 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
308 Map* map, HeapObject* object) { 308 Map* map, HeapObject* object) {
309 Heap* heap = map->GetHeap(); 309 Heap* heap = map->GetHeap();
310 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); 310 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
311 if (shared->ic_age() != heap->global_ic_age()) { 311 if (shared->ic_age() != heap->global_ic_age()) {
312 shared->ResetForNewContext(heap->global_ic_age()); 312 shared->ResetForNewContext(heap->global_ic_age());
313 } 313 }
314 if (FLAG_cache_optimized_code &&
315 FLAG_flush_optimized_code_cache &&
316 !shared->optimized_code_map()->IsSmi()) {
317 // Always flush the optimized code map if requested by flag.
318 shared->ClearOptimizedCodeMap();
319 }
314 MarkCompactCollector* collector = heap->mark_compact_collector(); 320 MarkCompactCollector* collector = heap->mark_compact_collector();
315 if (collector->is_code_flushing_enabled()) { 321 if (collector->is_code_flushing_enabled()) {
316 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) { 322 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) {
317 // Add the shared function info holding an optimized code map to 323 // Add the shared function info holding an optimized code map to
318 // the code flusher for processing of code maps after marking. 324 // the code flusher for processing of code maps after marking.
319 collector->code_flusher()->AddOptimizedCodeMap(shared); 325 collector->code_flusher()->AddOptimizedCodeMap(shared);
320 // Treat all references within the code map weakly by marking the 326 // Treat all references within the code map weakly by marking the
321 // code map itself but not pushing it onto the marking deque. 327 // code map itself but not pushing it onto the marking deque.
322 FixedArray* code_map = FixedArray::cast(shared->optimized_code_map()); 328 FixedArray* code_map = FixedArray::cast(shared->optimized_code_map());
323 StaticVisitor::MarkObjectWithoutPush(heap, code_map); 329 StaticVisitor::MarkObjectWithoutPush(heap, code_map);
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 RelocIterator it(this, mode_mask); 745 RelocIterator it(this, mode_mask);
740 for (; !it.done(); it.next()) { 746 for (; !it.done(); it.next()) {
741 it.rinfo()->template Visit<StaticVisitor>(heap); 747 it.rinfo()->template Visit<StaticVisitor>(heap);
742 } 748 }
743 } 749 }
744 750
745 751
746 } } // namespace v8::internal 752 } } // namespace v8::internal
747 753
748 #endif // V8_OBJECTS_VISITING_INL_H_ 754 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698