[cleanup] Move WriteBarrierKind to v8::internal::compiler namespace

... to minimize pollution of v8::internal namespace.
This CL also removes usages of WriteBarrierKind from CodeAssembler interface.

Bug: v8:9183
Change-Id: I7e87c0a98cfd08b3740a022cf12d3aab415da67a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599176
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61301}
This commit is contained in:
Igor Sheludko 2019-05-07 17:51:52 +02:00 committed by Commit Bot
parent 19dfa835a7
commit 47a302f398
12 changed files with 77 additions and 46 deletions

View File

@ -1899,6 +1899,7 @@ v8_compiler_sources = [
"src/compiler/verifier.h",
"src/compiler/wasm-compiler.cc",
"src/compiler/wasm-compiler.h",
"src/compiler/write-barrier-kind.h",
"src/compiler/zone-stats.cc",
"src/compiler/zone-stats.h",
]

View File

@ -2721,8 +2721,7 @@ void CodeStubAssembler::StoreObjectField(Node* object, int offset,
DCHECK_NE(HeapObject::kMapOffset, offset); // Use StoreMap instead.
OptimizedStoreField(MachineRepresentation::kTagged,
UncheckedCast<HeapObject>(object), offset, value,
WriteBarrierKind::kFullWriteBarrier);
UncheckedCast<HeapObject>(object), offset, value);
}
void CodeStubAssembler::StoreObjectField(Node* object, Node* offset,
@ -2737,8 +2736,8 @@ void CodeStubAssembler::StoreObjectField(Node* object, Node* offset,
void CodeStubAssembler::StoreObjectFieldNoWriteBarrier(
Node* object, int offset, Node* value, MachineRepresentation rep) {
OptimizedStoreField(rep, UncheckedCast<HeapObject>(object), offset, value,
WriteBarrierKind::kNoWriteBarrier);
OptimizedStoreFieldNoWriteBarrier(rep, UncheckedCast<HeapObject>(object),
offset, value);
}
void CodeStubAssembler::StoreObjectFieldNoWriteBarrier(
@ -2762,9 +2761,9 @@ void CodeStubAssembler::StoreMapNoWriteBarrier(Node* object,
void CodeStubAssembler::StoreMapNoWriteBarrier(Node* object, Node* map) {
CSA_SLOW_ASSERT(this, IsMap(map));
OptimizedStoreField(MachineRepresentation::kTaggedPointer,
UncheckedCast<HeapObject>(object), HeapObject::kMapOffset,
map, WriteBarrierKind::kNoWriteBarrier);
OptimizedStoreFieldNoWriteBarrier(MachineRepresentation::kTaggedPointer,
UncheckedCast<HeapObject>(object),
HeapObject::kMapOffset, map);
}
void CodeStubAssembler::StoreObjectFieldRoot(Node* object, int offset,

View File

@ -7,8 +7,8 @@
#include "src/base/compiler-specific.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/elements-kind.h"
#include "src/globals.h"
#include "src/objects/js-objects.h"
namespace v8 {

View File

@ -27,7 +27,7 @@
#define TARGET_ARCH_OPCODE_LIST(V)
#define TARGET_ADDRESSING_MODE_LIST(V)
#endif
#include "src/globals.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/utils.h"
namespace v8 {

View File

@ -994,11 +994,18 @@ Node* CodeAssembler::Store(Node* base, Node* value) {
void CodeAssembler::OptimizedStoreField(MachineRepresentation rep,
TNode<HeapObject> object, int offset,
Node* value,
WriteBarrierKind write_barrier) {
Node* value) {
raw_assembler()->OptimizedStoreField(rep, object, offset, value,
write_barrier);
WriteBarrierKind::kFullWriteBarrier);
}
void CodeAssembler::OptimizedStoreFieldNoWriteBarrier(MachineRepresentation rep,
TNode<HeapObject> object,
int offset, Node* value) {
raw_assembler()->OptimizedStoreField(rep, object, offset, value,
WriteBarrierKind::kNoWriteBarrier);
}
void CodeAssembler::OptimizedStoreMap(TNode<HeapObject> object,
TNode<Map> map) {
raw_assembler()->OptimizedStoreMap(object, map);

View File

@ -15,7 +15,6 @@
#include "src/base/macros.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/globals.h"
#include "src/heap/heap.h"
#include "src/machine-type.h"
#include "src/objects.h"
@ -973,8 +972,10 @@ class V8_EXPORT_PRIVATE CodeAssembler {
AllocationType allocation,
AllowLargeObjects allow_large_objects);
void OptimizedStoreField(MachineRepresentation rep, TNode<HeapObject> object,
int offset, Node* value,
WriteBarrierKind write_barrier);
int offset, Node* value);
void OptimizedStoreFieldNoWriteBarrier(MachineRepresentation rep,
TNode<HeapObject> object, int offset,
Node* value);
void OptimizedStoreMap(TNode<HeapObject> object, TNode<Map>);
// {value_high} is used for 64-bit stores on 32-bit platforms, must be
// nullptr in other cases.

View File

@ -8,7 +8,7 @@
#include "src/base/compiler-specific.h"
#include "src/base/enum-set.h"
#include "src/base/flags.h"
#include "src/globals.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/machine-type.h"
#include "src/zone/zone.h"

View File

@ -16,6 +16,7 @@
#include "src/compiler/node.h"
#include "src/compiler/operator.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/globals.h"
#include "src/heap/factory.h"
#include "src/isolate.h"

View File

@ -10,6 +10,7 @@
#include "src/base/compiler-specific.h"
#include "src/compiler/operator.h"
#include "src/compiler/types.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/deoptimize-reason.h"
#include "src/globals.h"
#include "src/handles.h"

View File

@ -0,0 +1,49 @@
// Copyright 2019 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_WRITE_BARRIER_KIND_H_
#define V8_COMPILER_WRITE_BARRIER_KIND_H_
#include <ostream>
#include "src/base/logging.h"
namespace v8 {
namespace internal {
namespace compiler {
// Write barrier kinds supported by compiler.
enum WriteBarrierKind : uint8_t {
kNoWriteBarrier,
kMapWriteBarrier,
kPointerWriteBarrier,
kEphemeronKeyWriteBarrier,
kFullWriteBarrier
};
inline size_t hash_value(WriteBarrierKind kind) {
return static_cast<uint8_t>(kind);
}
inline std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) {
switch (kind) {
case kNoWriteBarrier:
return os << "NoWriteBarrier";
case kMapWriteBarrier:
return os << "MapWriteBarrier";
case kPointerWriteBarrier:
return os << "PointerWriteBarrier";
case kEphemeronKeyWriteBarrier:
return os << "EphemeronKeyWriteBarrier";
case kFullWriteBarrier:
return os << "FullWriteBarrier";
}
UNREACHABLE();
}
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_WRITE_BARRIER_KIND_H_

View File

@ -732,35 +732,6 @@ enum AllocationAlignment { kWordAligned, kDoubleAligned, kDoubleUnaligned };
enum class AccessMode { ATOMIC, NON_ATOMIC };
// Supported write barrier modes.
enum WriteBarrierKind : uint8_t {
kNoWriteBarrier,
kMapWriteBarrier,
kPointerWriteBarrier,
kEphemeronKeyWriteBarrier,
kFullWriteBarrier
};
inline size_t hash_value(WriteBarrierKind kind) {
return static_cast<uint8_t>(kind);
}
inline std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) {
switch (kind) {
case kNoWriteBarrier:
return os << "NoWriteBarrier";
case kMapWriteBarrier:
return os << "MapWriteBarrier";
case kPointerWriteBarrier:
return os << "PointerWriteBarrier";
case kEphemeronKeyWriteBarrier:
return os << "EphemeronKeyWriteBarrier";
case kFullWriteBarrier:
return os << "FullWriteBarrier";
}
UNREACHABLE();
}
enum class AllowLargeObjects { kFalse, kTrue };
enum MinimumCapacity {

View File

@ -415,7 +415,8 @@ void WasmFunctionWrapper::Init(CallDescriptor* call_descriptor,
if (!return_type.IsNone()) {
effect = graph()->NewNode(
machine()->Store(compiler::StoreRepresentation(
return_type.representation(), WriteBarrierKind::kNoWriteBarrier)),
return_type.representation(),
compiler::WriteBarrierKind::kNoWriteBarrier)),
graph()->NewNode(common()->Parameter(param_types.length()),
graph()->start()),
graph()->NewNode(common()->Int32Constant(0)), call, effect,