Allow to enable/disable inline allocation via runtime function.

This will allow to artificially trigger GCs on all allocations for testing purposes.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/144543005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18787 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7fd59e52
...@@ -6397,7 +6397,7 @@ int64_t Heap::PromotedExternalMemorySize() { ...@@ -6397,7 +6397,7 @@ int64_t Heap::PromotedExternalMemorySize() {
void Heap::EnableInlineAllocation() { void Heap::EnableInlineAllocation() {
ASSERT(inline_allocation_disabled_); if (!inline_allocation_disabled_) return;
inline_allocation_disabled_ = false; inline_allocation_disabled_ = false;
// Update inline allocation limit for new space. // Update inline allocation limit for new space.
...@@ -6406,7 +6406,7 @@ void Heap::EnableInlineAllocation() { ...@@ -6406,7 +6406,7 @@ void Heap::EnableInlineAllocation() {
void Heap::DisableInlineAllocation() { void Heap::DisableInlineAllocation() {
ASSERT(!inline_allocation_disabled_); if (inline_allocation_disabled_) return;
inline_allocation_disabled_ = true; inline_allocation_disabled_ = true;
// Update inline allocation limit for new space. // Update inline allocation limit for new space.
......
...@@ -8744,12 +8744,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) { ...@@ -8744,12 +8744,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetAllocationTimeout) { RUNTIME_FUNCTION(MaybeObject*, Runtime_SetAllocationTimeout) {
SealHandleScope shs(isolate); SealHandleScope shs(isolate);
ASSERT(args.length() == 2); ASSERT(args.length() == 2 || args.length() == 3);
#ifdef DEBUG #ifdef DEBUG
CONVERT_SMI_ARG_CHECKED(interval, 0); CONVERT_SMI_ARG_CHECKED(interval, 0);
CONVERT_SMI_ARG_CHECKED(timeout, 1); CONVERT_SMI_ARG_CHECKED(timeout, 1);
isolate->heap()->set_allocation_timeout(timeout); isolate->heap()->set_allocation_timeout(timeout);
FLAG_gc_interval = interval; FLAG_gc_interval = interval;
if (args.length() == 3) {
// Enable/disable inline allocation if requested.
CONVERT_BOOLEAN_ARG_CHECKED(inline_allocation, 2);
if (inline_allocation) {
isolate->heap()->EnableInlineAllocation();
} else {
isolate->heap()->DisableInlineAllocation();
}
}
#endif #endif
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment