OLD | NEW |
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 public: | 416 public: |
417 explicit CodeFlusher(Isolate* isolate) | 417 explicit CodeFlusher(Isolate* isolate) |
418 : isolate_(isolate), | 418 : isolate_(isolate), |
419 jsfunction_candidates_head_(NULL), | 419 jsfunction_candidates_head_(NULL), |
420 shared_function_info_candidates_head_(NULL) {} | 420 shared_function_info_candidates_head_(NULL) {} |
421 | 421 |
422 void AddCandidate(SharedFunctionInfo* shared_info) { | 422 void AddCandidate(SharedFunctionInfo* shared_info) { |
423 if (GetNextCandidate(shared_info) == NULL) { | 423 if (GetNextCandidate(shared_info) == NULL) { |
424 SetNextCandidate(shared_info, shared_function_info_candidates_head_); | 424 SetNextCandidate(shared_info, shared_function_info_candidates_head_); |
425 shared_function_info_candidates_head_ = shared_info; | 425 shared_function_info_candidates_head_ = shared_info; |
426 } else { | |
427 // TODO(mstarzinger): Active in release mode to flush out problems. | |
428 // Should be turned back into an ASSERT or removed completely. | |
429 CHECK(ContainsCandidate(shared_info)); | |
430 } | 426 } |
431 } | 427 } |
432 | 428 |
433 void AddCandidate(JSFunction* function) { | 429 void AddCandidate(JSFunction* function) { |
434 ASSERT(function->code() == function->shared()->code()); | 430 ASSERT(function->code() == function->shared()->code()); |
435 if (GetNextCandidate(function)->IsUndefined()) { | 431 if (GetNextCandidate(function)->IsUndefined()) { |
436 SetNextCandidate(function, jsfunction_candidates_head_); | 432 SetNextCandidate(function, jsfunction_candidates_head_); |
437 jsfunction_candidates_head_ = function; | 433 jsfunction_candidates_head_ = function; |
438 } | 434 } |
439 } | 435 } |
440 | 436 |
441 bool ContainsCandidate(SharedFunctionInfo* shared_info); | |
442 | |
443 void EvictCandidate(SharedFunctionInfo* shared_info); | 437 void EvictCandidate(SharedFunctionInfo* shared_info); |
444 void EvictCandidate(JSFunction* function); | 438 void EvictCandidate(JSFunction* function); |
445 | 439 |
446 void ProcessCandidates() { | 440 void ProcessCandidates() { |
447 ProcessSharedFunctionInfoCandidates(); | 441 ProcessSharedFunctionInfoCandidates(); |
448 ProcessJSFunctionCandidates(); | 442 ProcessJSFunctionCandidates(); |
449 } | 443 } |
450 | 444 |
451 void EvictAllCandidates() { | 445 void EvictAllCandidates() { |
452 EvictJSFunctionCandidates(); | 446 EvictJSFunctionCandidates(); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 | 896 |
903 friend class Heap; | 897 friend class Heap; |
904 }; | 898 }; |
905 | 899 |
906 | 900 |
907 const char* AllocationSpaceName(AllocationSpace space); | 901 const char* AllocationSpaceName(AllocationSpace space); |
908 | 902 |
909 } } // namespace v8::internal | 903 } } // namespace v8::internal |
910 | 904 |
911 #endif // V8_MARK_COMPACT_H_ | 905 #endif // V8_MARK_COMPACT_H_ |
OLD | NEW |