Chromium Code Reviews| 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 8726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8737 PrintF(" at AST id %d]\n", ast_id.ToInt()); | 8737 PrintF(" at AST id %d]\n", ast_id.ToInt()); |
| 8738 } | 8738 } |
| 8739 | 8739 |
| 8740 function->ReplaceCode(function->shared()->code()); | 8740 function->ReplaceCode(function->shared()->code()); |
| 8741 return NULL; | 8741 return NULL; |
| 8742 } | 8742 } |
| 8743 | 8743 |
| 8744 | 8744 |
| 8745 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetAllocationTimeout) { | 8745 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetAllocationTimeout) { |
| 8746 SealHandleScope shs(isolate); | 8746 SealHandleScope shs(isolate); |
| 8747 ASSERT(args.length() == 2); | 8747 ASSERT(args.length() == 2 || args.length() == 3); |
| 8748 #ifdef DEBUG | 8748 #ifdef DEBUG |
| 8749 CONVERT_SMI_ARG_CHECKED(interval, 0); | 8749 CONVERT_SMI_ARG_CHECKED(interval, 0); |
| 8750 CONVERT_SMI_ARG_CHECKED(timeout, 1); | 8750 CONVERT_SMI_ARG_CHECKED(timeout, 1); |
| 8751 isolate->heap()->set_allocation_timeout(timeout); | 8751 isolate->heap()->set_allocation_timeout(timeout); |
| 8752 FLAG_gc_interval = interval; | 8752 FLAG_gc_interval = interval; |
| 8753 if (args.length() == 3) { | |
| 8754 // Enable/disable inline allocation if requested. | |
| 8755 CONVERT_BOOLEAN_ARG_CHECKED(inline_allocation, 2); | |
| 8756 if (inline_allocation && isolate->heap()->inline_allocation_disabled()) { | |
| 8757 isolate->heap()->EnableInlineAllocation(); | |
|
Michael Starzinger
2014/01/23 15:52:19
As discussed offline: We could turn the ASSERT wit
| |
| 8758 } else if (!inline_allocation && | |
| 8759 !isolate->heap()->inline_allocation_disabled()) { | |
| 8760 isolate->heap()->DisableInlineAllocation(); | |
| 8761 } | |
| 8762 } | |
| 8753 #endif | 8763 #endif |
| 8754 return isolate->heap()->undefined_value(); | 8764 return isolate->heap()->undefined_value(); |
| 8755 } | 8765 } |
| 8756 | 8766 |
| 8757 | 8767 |
| 8758 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) { | 8768 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) { |
| 8759 SealHandleScope shs(isolate); | 8769 SealHandleScope shs(isolate); |
| 8760 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); | 8770 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); |
| 8761 return isolate->heap()->undefined_value(); | 8771 return isolate->heap()->undefined_value(); |
| 8762 } | 8772 } |
| (...skipping 6128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14891 // Handle last resort GC and make sure to allow future allocations | 14901 // Handle last resort GC and make sure to allow future allocations |
| 14892 // to grow the heap without causing GCs (if possible). | 14902 // to grow the heap without causing GCs (if possible). |
| 14893 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14903 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14904 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14895 "Runtime::PerformGC"); | 14905 "Runtime::PerformGC"); |
| 14896 } | 14906 } |
| 14897 } | 14907 } |
| 14898 | 14908 |
| 14899 | 14909 |
| 14900 } } // namespace v8::internal | 14910 } } // namespace v8::internal |
| OLD | NEW |