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

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

Issue 227553005: Remove gc greedy mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/heap.cc ('k') | test/mjsunit/greedy.js » ('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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 return amount_of_external_allocated_memory_; 620 return amount_of_external_allocated_memory_;
621 } 621 }
622 622
623 623
624 Isolate* Heap::isolate() { 624 Isolate* Heap::isolate() {
625 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) - 625 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) -
626 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); 626 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4);
627 } 627 }
628 628
629 629
630 #ifdef DEBUG
631 #define GC_GREEDY_CHECK(ISOLATE) \
632 if (FLAG_gc_greedy) (ISOLATE)->heap()->GarbageCollectionGreedyCheck()
633 #else
634 #define GC_GREEDY_CHECK(ISOLATE) { }
635 #endif
636
637 // Calls the FUNCTION_CALL function and retries it up to three times 630 // Calls the FUNCTION_CALL function and retries it up to three times
638 // to guarantee that any allocations performed during the call will 631 // to guarantee that any allocations performed during the call will
639 // succeed if there's enough memory. 632 // succeed if there's enough memory.
640 633
641 // Warning: Do not use the identifiers __object__, __maybe_object__ or 634 // Warning: Do not use the identifiers __object__, __maybe_object__ or
642 // __scope__ in a call to this macro. 635 // __scope__ in a call to this macro.
643 636
644 #define CALL_AND_RETRY(ISOLATE, FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ 637 #define CALL_AND_RETRY(ISOLATE, FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \
645 do { \ 638 do { \
646 GC_GREEDY_CHECK(ISOLATE); \
647 MaybeObject* __maybe_object__ = FUNCTION_CALL; \ 639 MaybeObject* __maybe_object__ = FUNCTION_CALL; \
648 Object* __object__ = NULL; \ 640 Object* __object__ = NULL; \
649 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \ 641 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \
650 if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \ 642 if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \
651 (ISOLATE)->heap()->CollectGarbage(Failure::cast(__maybe_object__)-> \ 643 (ISOLATE)->heap()->CollectGarbage(Failure::cast(__maybe_object__)-> \
652 allocation_space(), \ 644 allocation_space(), \
653 "allocation failure"); \ 645 "allocation failure"); \
654 __maybe_object__ = FUNCTION_CALL; \ 646 __maybe_object__ = FUNCTION_CALL; \
655 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \ 647 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \
656 if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \ 648 if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 817
826 818
827 double GCTracer::SizeOfHeapObjects() { 819 double GCTracer::SizeOfHeapObjects() {
828 return (static_cast<double>(heap_->SizeOfObjects())) / MB; 820 return (static_cast<double>(heap_->SizeOfObjects())) / MB;
829 } 821 }
830 822
831 823
832 } } // namespace v8::internal 824 } } // namespace v8::internal
833 825
834 #endif // V8_HEAP_INL_H_ 826 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | test/mjsunit/greedy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698