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

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

Issue 254623002: Simplify feedback vector creation and store in SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments Created 6 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/objects-printer.cc ('k') | src/parser.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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset), 421 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset),
422 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset)); 422 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset));
423 } 423 }
424 424
425 425
426 template<typename StaticVisitor> 426 template<typename StaticVisitor>
427 void StaticMarkingVisitor<StaticVisitor>::VisitCode( 427 void StaticMarkingVisitor<StaticVisitor>::VisitCode(
428 Map* map, HeapObject* object) { 428 Map* map, HeapObject* object) {
429 Heap* heap = map->GetHeap(); 429 Heap* heap = map->GetHeap();
430 Code* code = Code::cast(object); 430 Code* code = Code::cast(object);
431 if (FLAG_cleanup_code_caches_at_gc) {
432 code->ClearTypeFeedbackInfo(heap);
433 }
434 if (FLAG_age_code && !Serializer::enabled()) { 431 if (FLAG_age_code && !Serializer::enabled()) {
435 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); 432 code->MakeOlder(heap->mark_compact_collector()->marking_parity());
436 } 433 }
437 code->CodeIterateBody<StaticVisitor>(heap); 434 code->CodeIterateBody<StaticVisitor>(heap);
438 } 435 }
439 436
440 437
441 template<typename StaticVisitor> 438 template<typename StaticVisitor>
442 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( 439 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
443 Map* map, HeapObject* object) { 440 Map* map, HeapObject* object) {
444 Heap* heap = map->GetHeap(); 441 Heap* heap = map->GetHeap();
445 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); 442 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
446 if (shared->ic_age() != heap->global_ic_age()) { 443 if (shared->ic_age() != heap->global_ic_age()) {
447 shared->ResetForNewContext(heap->global_ic_age()); 444 shared->ResetForNewContext(heap->global_ic_age());
448 } 445 }
446 if (FLAG_cleanup_code_caches_at_gc) {
447 shared->ClearTypeFeedbackInfo();
448 }
449 if (FLAG_cache_optimized_code && 449 if (FLAG_cache_optimized_code &&
450 FLAG_flush_optimized_code_cache && 450 FLAG_flush_optimized_code_cache &&
451 !shared->optimized_code_map()->IsSmi()) { 451 !shared->optimized_code_map()->IsSmi()) {
452 // Always flush the optimized code map if requested by flag. 452 // Always flush the optimized code map if requested by flag.
453 shared->ClearOptimizedCodeMap(); 453 shared->ClearOptimizedCodeMap();
454 } 454 }
455 MarkCompactCollector* collector = heap->mark_compact_collector(); 455 MarkCompactCollector* collector = heap->mark_compact_collector();
456 if (collector->is_code_flushing_enabled()) { 456 if (collector->is_code_flushing_enabled()) {
457 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) { 457 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) {
458 // Add the shared function info holding an optimized code map to 458 // Add the shared function info holding an optimized code map to
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 RelocIterator it(this, mode_mask); 954 RelocIterator it(this, mode_mask);
955 for (; !it.done(); it.next()) { 955 for (; !it.done(); it.next()) {
956 it.rinfo()->template Visit<StaticVisitor>(heap); 956 it.rinfo()->template Visit<StaticVisitor>(heap);
957 } 957 }
958 } 958 }
959 959
960 960
961 } } // namespace v8::internal 961 } } // namespace v8::internal
962 962
963 #endif // V8_OBJECTS_VISITING_INL_H_ 963 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698