[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: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#57069}
This commit is contained in:
parent
321538c206
commit
9299702afc
1
BUILD.gn
1
BUILD.gn
@ -1701,6 +1701,7 @@ v8_source_set("v8_base") {
|
||||
"src/compiler/access-info.h",
|
||||
"src/compiler/all-nodes.cc",
|
||||
"src/compiler/all-nodes.h",
|
||||
"src/compiler/allocation-builder-inl.h",
|
||||
"src/compiler/allocation-builder.h",
|
||||
"src/compiler/basic-block-instrumentor.cc",
|
||||
"src/compiler/basic-block-instrumentor.h",
|
||||
|
43
src/compiler/allocation-builder-inl.h
Normal file
43
src/compiler/allocation-builder-inl.h
Normal file
@ -0,0 +1,43 @@
|
||||
// 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 {
|
||||
}
|
||||
|
||||
// Compound allocation of a context.
|
||||
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));
|
||||
}
|
||||
inline void AllocateContext(int length, Handle<Map> map);
|
||||
|
||||
// Compound allocation of a FixedArray.
|
||||
void AllocateArray(int length, Handle<Map> map,
|
||||
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));
|
||||
}
|
||||
inline void AllocateArray(int length, Handle<Map> map,
|
||||
PretenureFlag pretenure = NOT_TENURED);
|
||||
|
||||
// Compound store of a constant into a field.
|
||||
void Store(const FieldAccess& access, Handle<Object> value) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "src/code-factory.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/compilation-dependencies.h"
|
||||
#include "src/compiler/js-graph.h"
|
||||
|
@ -29,7 +29,6 @@ AUTO_EXCLUDE = [
|
||||
# flag-definitions.h needs a mode set for being included.
|
||||
'src/flag-definitions.h',
|
||||
# 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/raw-machine-assembler.h',
|
||||
'src/dateparser-inl.h',
|
||||
|
Loading…
Reference in New Issue
Block a user