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) { |
| 8757 isolate->heap()->EnableInlineAllocation(); |
| 8758 } else { |
| 8759 isolate->heap()->DisableInlineAllocation(); |
| 8760 } |
| 8761 } |
8753 #endif | 8762 #endif |
8754 return isolate->heap()->undefined_value(); | 8763 return isolate->heap()->undefined_value(); |
8755 } | 8764 } |
8756 | 8765 |
8757 | 8766 |
8758 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) { | 8767 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) { |
8759 SealHandleScope shs(isolate); | 8768 SealHandleScope shs(isolate); |
8760 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); | 8769 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); |
8761 return isolate->heap()->undefined_value(); | 8770 return isolate->heap()->undefined_value(); |
8762 } | 8771 } |
(...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 | 14900 // Handle last resort GC and make sure to allow future allocations |
14892 // to grow the heap without causing GCs (if possible). | 14901 // to grow the heap without causing GCs (if possible). |
14893 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14902 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14903 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14895 "Runtime::PerformGC"); | 14904 "Runtime::PerformGC"); |
14896 } | 14905 } |
14897 } | 14906 } |
14898 | 14907 |
14899 | 14908 |
14900 } } // namespace v8::internal | 14909 } } // namespace v8::internal |
OLD | NEW |