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 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_HEAP_INL_H_ | 28 #ifndef V8_HEAP_INL_H_ |
29 #define V8_HEAP_INL_H_ | 29 #define V8_HEAP_INL_H_ |
30 | 30 |
31 #include <cmath> | 31 #include <cmath> |
32 | 32 |
33 #include "heap.h" | 33 #include "heap.h" |
34 #include "heap-profiler.h" | |
35 #include "isolate.h" | 34 #include "isolate.h" |
36 #include "list-inl.h" | 35 #include "list-inl.h" |
37 #include "objects.h" | 36 #include "objects.h" |
38 #include "platform.h" | 37 #include "platform.h" |
39 #include "v8-counters.h" | 38 #include "v8-counters.h" |
40 #include "store-buffer.h" | 39 #include "store-buffer.h" |
41 #include "store-buffer-inl.h" | 40 #include "store-buffer-inl.h" |
42 | 41 |
43 namespace v8 { | 42 namespace v8 { |
44 namespace internal { | 43 namespace internal { |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 { \ | 659 { \ |
661 AlwaysAllocateScope __scope__; \ | 660 AlwaysAllocateScope __scope__; \ |
662 __maybe_object__ = FUNCTION_CALL; \ | 661 __maybe_object__ = FUNCTION_CALL; \ |
663 } \ | 662 } \ |
664 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \ | 663 if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \ |
665 if (__maybe_object__->IsOutOfMemory()) { \ | 664 if (__maybe_object__->IsOutOfMemory()) { \ |
666 OOM; \ | 665 OOM; \ |
667 } \ | 666 } \ |
668 if (__maybe_object__->IsRetryAfterGC()) { \ | 667 if (__maybe_object__->IsRetryAfterGC()) { \ |
669 /* TODO(1181417): Fix this. */ \ | 668 /* TODO(1181417): Fix this. */ \ |
670 v8::internal::Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true);\ | 669 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); \ |
671 } \ | 670 } \ |
672 RETURN_EMPTY; \ | 671 RETURN_EMPTY; \ |
673 } while (false) | 672 } while (false) |
674 | 673 |
675 #define CALL_AND_RETRY_OR_DIE( \ | 674 #define CALL_AND_RETRY_OR_DIE( \ |
676 ISOLATE, FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ | 675 ISOLATE, FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ |
677 CALL_AND_RETRY( \ | 676 CALL_AND_RETRY( \ |
678 ISOLATE, \ | 677 ISOLATE, \ |
679 FUNCTION_CALL, \ | 678 FUNCTION_CALL, \ |
680 RETURN_VALUE, \ | 679 RETURN_VALUE, \ |
681 RETURN_EMPTY, \ | 680 RETURN_EMPTY, \ |
682 v8::internal::Heap::FatalProcessOutOfMemory("CALL_AND_RETRY", true)) | 681 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY", true)) |
683 | 682 |
684 #define CALL_HEAP_FUNCTION(ISOLATE, FUNCTION_CALL, TYPE) \ | 683 #define CALL_HEAP_FUNCTION(ISOLATE, FUNCTION_CALL, TYPE) \ |
685 CALL_AND_RETRY_OR_DIE(ISOLATE, \ | 684 CALL_AND_RETRY_OR_DIE(ISOLATE, \ |
686 FUNCTION_CALL, \ | 685 FUNCTION_CALL, \ |
687 return Handle<TYPE>(TYPE::cast(__object__), ISOLATE), \ | 686 return Handle<TYPE>(TYPE::cast(__object__), ISOLATE), \ |
688 return Handle<TYPE>()) \ | 687 return Handle<TYPE>()) \ |
689 | 688 |
690 | 689 |
691 #define CALL_HEAP_FUNCTION_VOID(ISOLATE, FUNCTION_CALL) \ | 690 #define CALL_HEAP_FUNCTION_VOID(ISOLATE, FUNCTION_CALL) \ |
692 CALL_AND_RETRY_OR_DIE(ISOLATE, FUNCTION_CALL, return, return) | 691 CALL_AND_RETRY_OR_DIE(ISOLATE, FUNCTION_CALL, return, return) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 #ifdef DEBUG | 833 #ifdef DEBUG |
835 Isolate* isolate = Isolate::Current(); | 834 Isolate* isolate = Isolate::Current(); |
836 isolate->heap()->disallow_allocation_failure_ = old_state_; | 835 isolate->heap()->disallow_allocation_failure_ = old_state_; |
837 #endif | 836 #endif |
838 } | 837 } |
839 | 838 |
840 | 839 |
841 } } // namespace v8::internal | 840 } } // namespace v8::internal |
842 | 841 |
843 #endif // V8_HEAP_INL_H_ | 842 #endif // V8_HEAP_INL_H_ |
OLD | NEW |