Commit ee8a33b0 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Fix --inline_new and --turbo_allocation_folding flags

Now heap checks for the --inline-new flag immediately after setup
before creating the initial objects.

Disabled inline allocation also disables allocation folding.

Additionally, the memory optimizer is changed to not update the
linear allocation area if allocation folding is disabled.

Change-Id: Ie43fe2d1b92c8e86204ee72a273dcf42ac89da59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624803
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61870}
parent 123b0ba2
......@@ -305,7 +305,7 @@ void MemoryOptimizer::VisitAllocateRaw(Node* node,
// Check if we can fold this allocation into a previous allocation represented
// by the incoming {state}.
IntPtrMatcher m(size);
if (m.IsInRange(0, kMaxRegularHeapObjectSize)) {
if (m.IsInRange(0, kMaxRegularHeapObjectSize) && FLAG_inline_new) {
intptr_t const object_size = m.Value();
if (allocation_folding_ == AllocationFolding::kDoAllocationFolding &&
state->size() <= kMaxRegularHeapObjectSize - object_size &&
......
......@@ -3361,6 +3361,8 @@ bool Isolate::Init(ReadOnlyDeserializer* read_only_deserializer,
setup_delegate_ = new SetupIsolateDelegate(create_heap_objects);
}
if (!FLAG_inline_new) heap_.DisableInlineAllocation();
if (!setup_delegate_->SetupHeap(&heap_)) {
V8::FatalProcessOutOfMemory(this, "heap object creation");
return false;
......@@ -3501,8 +3503,6 @@ bool Isolate::Init(ReadOnlyDeserializer* read_only_deserializer,
initialized_from_snapshot_ = !create_heap_objects;
if (!FLAG_inline_new) heap_.DisableInlineAllocation();
if (FLAG_stress_sampling_allocation_profiler > 0) {
uint64_t sample_interval = FLAG_stress_sampling_allocation_profiler;
int stack_depth = 128;
......
......@@ -976,8 +976,8 @@ DEFINE_BOOL(test_small_max_function_context_stub_size, false,
"enable testing the function context size overflow path "
"by making the maximum size smaller")
// builtins-ia32.cc
DEFINE_BOOL(inline_new, true, "use fast inline allocation")
DEFINE_NEG_NEG_IMPLICATION(inline_new, turbo_allocation_folding)
// codegen-ia32.cc / codegen-arm.cc
DEFINE_BOOL(trace, false, "trace function calls")
......
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