Commit 9299702a authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[iwyu] Split off allocation-builder-inl.h

allocation-builder.h was using methods defined in map-inl.h, which is
not allowed. Thus move the respective methods to
allocation-builder-inl.h.

R=mstarzinger@chromium.org

Bug: v8:7965
Change-Id: Idd040f624d7e9491bc3d4bbd1e6ab3e8cf051917
Reviewed-on: https://chromium-review.googlesource.com/c/1303297
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57069}
parent 321538c2
...@@ -1701,6 +1701,7 @@ v8_source_set("v8_base") { ...@@ -1701,6 +1701,7 @@ v8_source_set("v8_base") {
"src/compiler/access-info.h", "src/compiler/access-info.h",
"src/compiler/all-nodes.cc", "src/compiler/all-nodes.cc",
"src/compiler/all-nodes.h", "src/compiler/all-nodes.h",
"src/compiler/allocation-builder-inl.h",
"src/compiler/allocation-builder.h", "src/compiler/allocation-builder.h",
"src/compiler/basic-block-instrumentor.cc", "src/compiler/basic-block-instrumentor.cc",
"src/compiler/basic-block-instrumentor.h", "src/compiler/basic-block-instrumentor.h",
......
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_ALLOCATION_BUILDER_INL_H_
#define V8_COMPILER_ALLOCATION_BUILDER_INL_H_
#include "src/compiler/allocation-builder.h"
#include "src/compiler/access-builder.h"
#include "src/objects/map-inl.h"
namespace v8 {
namespace internal {
namespace compiler {
void AllocationBuilder::AllocateContext(int length, Handle<Map> map) {
DCHECK(map->instance_type() >= AWAIT_CONTEXT_TYPE &&
map->instance_type() <= WITH_CONTEXT_TYPE);
int size = FixedArray::SizeFor(length);
Allocate(size, NOT_TENURED, Type::OtherInternal());
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
}
// Compound allocation of a FixedArray.
void AllocationBuilder::AllocateArray(int length, Handle<Map> map,
PretenureFlag pretenure) {
DCHECK(map->instance_type() == FIXED_ARRAY_TYPE ||
map->instance_type() == FIXED_DOUBLE_ARRAY_TYPE);
int size = (map->instance_type() == FIXED_ARRAY_TYPE)
? FixedArray::SizeFor(length)
: FixedDoubleArray::SizeFor(length);
Allocate(size, pretenure, Type::OtherInternal());
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
}
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_ALLOCATION_BUILDER_INL_H_
...@@ -49,27 +49,11 @@ class AllocationBuilder final { ...@@ -49,27 +49,11 @@ class AllocationBuilder final {
} }
// Compound allocation of a context. // Compound allocation of a context.
void AllocateContext(int length, Handle<Map> map) { inline void AllocateContext(int length, Handle<Map> map);
DCHECK(map->instance_type() >= AWAIT_CONTEXT_TYPE &&
map->instance_type() <= WITH_CONTEXT_TYPE);
int size = FixedArray::SizeFor(length);
Allocate(size, NOT_TENURED, Type::OtherInternal());
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
}
// Compound allocation of a FixedArray. // Compound allocation of a FixedArray.
void AllocateArray(int length, Handle<Map> map, inline void AllocateArray(int length, Handle<Map> map,
PretenureFlag pretenure = NOT_TENURED) { PretenureFlag pretenure = NOT_TENURED);
DCHECK(map->instance_type() == FIXED_ARRAY_TYPE ||
map->instance_type() == FIXED_DOUBLE_ARRAY_TYPE);
int size = (map->instance_type() == FIXED_ARRAY_TYPE)
? FixedArray::SizeFor(length)
: FixedDoubleArray::SizeFor(length);
Allocate(size, pretenure, Type::OtherInternal());
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
}
// Compound store of a constant into a field. // Compound store of a constant into a field.
void Store(const FieldAccess& access, Handle<Object> value) { void Store(const FieldAccess& access, Handle<Object> value) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "src/code-factory.h" #include "src/code-factory.h"
#include "src/compiler/access-builder.h" #include "src/compiler/access-builder.h"
#include "src/compiler/allocation-builder.h" #include "src/compiler/allocation-builder-inl.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/compilation-dependencies.h" #include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
......
...@@ -29,7 +29,6 @@ AUTO_EXCLUDE = [ ...@@ -29,7 +29,6 @@ AUTO_EXCLUDE = [
# flag-definitions.h needs a mode set for being included. # flag-definitions.h needs a mode set for being included.
'src/flag-definitions.h', 'src/flag-definitions.h',
# blacklist of headers we need to fix (https://crbug.com/v8/7965). # blacklist of headers we need to fix (https://crbug.com/v8/7965).
'src/compiler/allocation-builder.h',
'src/compiler/js-context-specialization.h', 'src/compiler/js-context-specialization.h',
'src/compiler/raw-machine-assembler.h', 'src/compiler/raw-machine-assembler.h',
'src/dateparser-inl.h', 'src/dateparser-inl.h',
......
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