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

Side by Side Diff: src/mark-compact.cc

Issue 6793013: Cache optimized code on shared function info. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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/ia32/macro-assembler-ia32.h ('k') | src/objects.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 682
683 if (IsJSBuiltinsObject(context->global())) { 683 if (IsJSBuiltinsObject(context->global())) {
684 return false; 684 return false;
685 } 685 }
686 686
687 return true; 687 return true;
688 } 688 }
689 689
690 690
691 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) { 691 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) {
692 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 692 reinterpret_cast<SharedFunctionInfo*>(object)->BeforeVisitingPointers();
693
694 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap();
695 693
696 FixedBodyVisitor<StaticMarkingVisitor, 694 FixedBodyVisitor<StaticMarkingVisitor,
697 SharedFunctionInfo::BodyDescriptor, 695 SharedFunctionInfo::BodyDescriptor,
698 void>::Visit(map, object); 696 void>::Visit(map, object);
699 } 697 }
700 698
701 699
702 static void VisitSharedFunctionInfoAndFlushCode(Map* map, 700 static void VisitSharedFunctionInfoAndFlushCode(Map* map,
703 HeapObject* object) { 701 HeapObject* object) {
704 MarkCompactCollector* collector = map->heap()->mark_compact_collector(); 702 MarkCompactCollector* collector = map->heap()->mark_compact_collector();
705 if (!collector->is_code_flushing_enabled()) { 703 if (!collector->is_code_flushing_enabled()) {
706 VisitSharedFunctionInfoGeneric(map, object); 704 VisitSharedFunctionInfoGeneric(map, object);
707 return; 705 return;
708 } 706 }
709 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false); 707 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false);
710 } 708 }
711 709
712 710
713 static void VisitSharedFunctionInfoAndFlushCodeGeneric( 711 static void VisitSharedFunctionInfoAndFlushCodeGeneric(
714 Map* map, HeapObject* object, bool known_flush_code_candidate) { 712 Map* map, HeapObject* object, bool known_flush_code_candidate) {
715 Heap* heap = map->heap(); 713 Heap* heap = map->heap();
716 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 714 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object);
717 715
718 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); 716 shared->BeforeVisitingPointers();
719 717
720 if (!known_flush_code_candidate) { 718 if (!known_flush_code_candidate) {
721 known_flush_code_candidate = IsFlushable(heap, shared); 719 known_flush_code_candidate = IsFlushable(heap, shared);
722 if (known_flush_code_candidate) { 720 if (known_flush_code_candidate) {
723 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); 721 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared);
724 } 722 }
725 } 723 }
726 724
727 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); 725 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate);
728 } 726 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 static void VisitSharedFunctionInfoFields(Heap* heap, 831 static void VisitSharedFunctionInfoFields(Heap* heap,
834 HeapObject* object, 832 HeapObject* object,
835 bool flush_code_candidate) { 833 bool flush_code_candidate) {
836 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); 834 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset));
837 835
838 if (!flush_code_candidate) { 836 if (!flush_code_candidate) {
839 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); 837 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset));
840 } 838 }
841 839
842 VisitPointers(heap, 840 VisitPointers(heap,
843 SLOT_ADDR(object, SharedFunctionInfo::kScopeInfoOffset), 841 SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset),
844 SLOT_ADDR(object, SharedFunctionInfo::kSize)); 842 SLOT_ADDR(object, SharedFunctionInfo::kSize));
845 } 843 }
846 844
847 #undef SLOT_ADDR 845 #undef SLOT_ADDR
848 846
849 typedef void (*Callback)(Map* map, HeapObject* object); 847 typedef void (*Callback)(Map* map, HeapObject* object);
850 848
851 static VisitorDispatchTable<Callback> table_; 849 static VisitorDispatchTable<Callback> table_;
852 }; 850 };
853 851
854 852
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
3083 } 3081 }
3084 3082
3085 3083
3086 void MarkCompactCollector::Initialize() { 3084 void MarkCompactCollector::Initialize() {
3087 StaticPointersToNewGenUpdatingVisitor::Initialize(); 3085 StaticPointersToNewGenUpdatingVisitor::Initialize();
3088 StaticMarkingVisitor::Initialize(); 3086 StaticMarkingVisitor::Initialize();
3089 } 3087 }
3090 3088
3091 3089
3092 } } // namespace v8::internal 3090 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698