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

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

Issue 1433923002: Maintain a FixedArray for the optimized code map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed a case, also turn on flag for testing. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_VISITING_INL_H_ 5 #ifndef V8_OBJECTS_VISITING_INL_H_
6 #define V8_OBJECTS_VISITING_INL_H_ 6 #define V8_OBJECTS_VISITING_INL_H_
7 7
8 #include "src/heap/array-buffer-tracker.h" 8 #include "src/heap/array-buffer-tracker.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/ic/ic-state.h" 10 #include "src/ic/ic-state.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 Map* map, HeapObject* object) { 444 Map* map, HeapObject* object) {
445 Heap* heap = map->GetHeap(); 445 Heap* heap = map->GetHeap();
446 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); 446 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
447 if (shared->ic_age() != heap->global_ic_age()) { 447 if (shared->ic_age() != heap->global_ic_age()) {
448 shared->ResetForNewContext(heap->global_ic_age()); 448 shared->ResetForNewContext(heap->global_ic_age());
449 } 449 }
450 if (FLAG_cleanup_code_caches_at_gc) { 450 if (FLAG_cleanup_code_caches_at_gc) {
451 shared->ClearTypeFeedbackInfoAtGCTime(); 451 shared->ClearTypeFeedbackInfoAtGCTime();
452 } 452 }
453 if (FLAG_flush_optimized_code_cache) { 453 if (FLAG_flush_optimized_code_cache) {
454 if (!shared->optimized_code_map()->IsSmi()) { 454 if (!shared->OptimizedCodeMapIsCleared()) {
455 // Always flush the optimized code map if requested by flag. 455 // Always flush the optimized code map if requested by flag.
456 shared->ClearOptimizedCodeMap(); 456 shared->ClearOptimizedCodeMap();
457 } 457 }
458 } else { 458 } else {
459 if (!shared->optimized_code_map()->IsSmi()) { 459 if (!shared->OptimizedCodeMapIsCleared()) {
460 // Treat some references within the code map weakly by marking the 460 // Treat some references within the code map weakly by marking the
461 // code map itself but not pushing it onto the marking deque. The 461 // code map itself but not pushing it onto the marking deque. The
462 // map will be processed after marking. 462 // map will be processed after marking.
463 FixedArray* code_map = FixedArray::cast(shared->optimized_code_map()); 463 FixedArray* code_map = shared->optimized_code_map();
464 MarkOptimizedCodeMap(heap, code_map); 464 MarkOptimizedCodeMap(heap, code_map);
465 } 465 }
466 } 466 }
467 MarkCompactCollector* collector = heap->mark_compact_collector(); 467 MarkCompactCollector* collector = heap->mark_compact_collector();
468 if (collector->is_code_flushing_enabled()) { 468 if (collector->is_code_flushing_enabled()) {
469 if (IsFlushable(heap, shared)) { 469 if (IsFlushable(heap, shared)) {
470 // This function's code looks flushable. But we have to postpone 470 // This function's code looks flushable. But we have to postpone
471 // the decision until we see all functions that point to the same 471 // the decision until we see all functions that point to the same
472 // SharedFunctionInfo because some of them might be optimized. 472 // SharedFunctionInfo because some of them might be optimized.
473 // That would also make the non-optimized version of the code 473 // That would also make the non-optimized version of the code
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 897
898 RelocIterator it(this, mode_mask); 898 RelocIterator it(this, mode_mask);
899 for (; !it.done(); it.next()) { 899 for (; !it.done(); it.next()) {
900 it.rinfo()->template Visit<StaticVisitor>(heap); 900 it.rinfo()->template Visit<StaticVisitor>(heap);
901 } 901 }
902 } 902 }
903 } // namespace internal 903 } // namespace internal
904 } // namespace v8 904 } // namespace v8
905 905
906 #endif // V8_OBJECTS_VISITING_INL_H_ 906 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698