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

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

Issue 14710015: Prevent flushing of code that was set with %SetCode. (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/objects-inl.h ('k') | src/runtime.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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // Only flush code for functions. 559 // Only flush code for functions.
560 if (shared_info->code()->kind() != Code::FUNCTION) { 560 if (shared_info->code()->kind() != Code::FUNCTION) {
561 return false; 561 return false;
562 } 562 }
563 563
564 // Function must be lazy compilable. 564 // Function must be lazy compilable.
565 if (!shared_info->allows_lazy_compilation()) { 565 if (!shared_info->allows_lazy_compilation()) {
566 return false; 566 return false;
567 } 567 }
568 568
569 // If this is a full script wrapped in a function we do no flush the code. 569 // If this is a full script wrapped in a function we do not flush the code.
570 if (shared_info->is_toplevel()) { 570 if (shared_info->is_toplevel()) {
571 return false; 571 return false;
572 } 572 }
573 573
574 // If this is a native function we do not flush the code because %SetCode 574 // If this is a function initialized with %SetCode then the one-to-one
575 // breaks the one-to-one relation between SharedFunctionInfo and Code. 575 // relation between SharedFunctionInfo and Code is broken.
576 if (shared_info->native()) { 576 if (shared_info->dont_flush()) {
577 return false; 577 return false;
578 } 578 }
579 579
580 if (FLAG_age_code) { 580 if (FLAG_age_code) {
581 return shared_info->code()->IsOld(); 581 return shared_info->code()->IsOld();
582 } else { 582 } else {
583 // How many collections newly compiled code object will survive before being 583 // How many collections newly compiled code object will survive before being
584 // flushed. 584 // flushed.
585 static const int kCodeAgeThreshold = 5; 585 static const int kCodeAgeThreshold = 5;
586 586
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 RelocIterator it(this, mode_mask); 725 RelocIterator it(this, mode_mask);
726 for (; !it.done(); it.next()) { 726 for (; !it.done(); it.next()) {
727 it.rinfo()->template Visit<StaticVisitor>(heap); 727 it.rinfo()->template Visit<StaticVisitor>(heap);
728 } 728 }
729 } 729 }
730 730
731 731
732 } } // namespace v8::internal 732 } } // namespace v8::internal
733 733
734 #endif // V8_OBJECTS_VISITING_INL_H_ 734 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698