Commit c2ef5fa9 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[compiler] Remove unused parameter

The {alignment} parameter in {UnalignedLoadSupported} and
{UnalignedStoreSupported} is never being used.
This CL removes it from several interfaces and users.

R=mstarzinger@chromium.org

Change-Id: Iad5a638b7ed358beeed42f0ea7308dc04f1ed23e
Reviewed-on: https://chromium-review.googlesource.com/598788Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47115}
parent 7d38ee30
......@@ -273,11 +273,9 @@ TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
CSA_ASSERT(this, IsRegularHeapObjectSize(var_total_size.value()));
Node* elements;
int heap_alignment =
ElementSizeLog2Of(MachineType::PointerRepresentation());
if (UnalignedLoadSupported(MachineType::Float64(), heap_alignment) &&
UnalignedStoreSupported(MachineType::Float64(), heap_alignment)) {
if (UnalignedLoadSupported(MachineType::Float64()) &&
UnalignedStoreSupported(MachineType::Float64())) {
elements = AllocateInNewSpace(var_total_size.value());
} else {
elements = AllocateInNewSpace(var_total_size.value(), kDoubleAlignment);
......
......@@ -801,15 +801,13 @@ void CodeAssembler::Switch(Node* index, Label* default_label,
labels, case_count);
}
bool CodeAssembler::UnalignedLoadSupported(const MachineType& machineType,
uint8_t alignment) const {
return raw_assembler()->machine()->UnalignedLoadSupported(machineType,
alignment);
}
bool CodeAssembler::UnalignedStoreSupported(const MachineType& machineType,
uint8_t alignment) const {
return raw_assembler()->machine()->UnalignedStoreSupported(machineType,
alignment);
bool CodeAssembler::UnalignedLoadSupported(
const MachineType& machineType) const {
return raw_assembler()->machine()->UnalignedLoadSupported(machineType);
}
bool CodeAssembler::UnalignedStoreSupported(
const MachineType& machineType) const {
return raw_assembler()->machine()->UnalignedStoreSupported(machineType);
}
// RawMachineAssembler delegate helpers:
......
......@@ -452,10 +452,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void BreakOnNode(int node_id);
bool UnalignedLoadSupported(const MachineType& machineType,
uint8_t alignment) const;
bool UnalignedStoreSupported(const MachineType& machineType,
uint8_t alignment) const;
bool UnalignedLoadSupported(const MachineType& machineType) const;
bool UnalignedStoreSupported(const MachineType& machineType) const;
protected:
void RegisterCallGenerationCallbacks(
......
......@@ -167,16 +167,12 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
public:
enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport };
bool IsUnalignedLoadSupported(const MachineType& machineType,
uint8_t alignment) const {
return IsUnalignedSupported(unalignedLoadUnsupportedTypes_, machineType,
alignment);
bool IsUnalignedLoadSupported(const MachineType& machineType) const {
return IsUnalignedSupported(unalignedLoadUnsupportedTypes_, machineType);
}
bool IsUnalignedStoreSupported(const MachineType& machineType,
uint8_t alignment) const {
return IsUnalignedSupported(unalignedStoreUnsupportedTypes_, machineType,
alignment);
bool IsUnalignedStoreSupported(const MachineType& machineType) const {
return IsUnalignedSupported(unalignedStoreUnsupportedTypes_, machineType);
}
static AlignmentRequirements FullUnalignedAccessSupport() {
......@@ -204,8 +200,7 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
unalignedStoreUnsupportedTypes_(unalignedStoreUnsupportedTypes) {}
bool IsUnalignedSupported(const Vector<MachineType>& unsupported,
const MachineType& machineType,
uint8_t alignment) const {
const MachineType& machineType) const {
// All accesses of bytes in memory are aligned.
DCHECK_NE(machineType.representation(), MachineRepresentation::kWord8);
if (unalignedSupport_ == kFullSupport) {
......@@ -637,16 +632,12 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
bool Is64() const { return word() == MachineRepresentation::kWord64; }
MachineRepresentation word() const { return word_; }
bool UnalignedLoadSupported(const MachineType& machineType,
uint8_t alignment) {
return alignment_requirements_.IsUnalignedLoadSupported(machineType,
alignment);
bool UnalignedLoadSupported(const MachineType& machineType) {
return alignment_requirements_.IsUnalignedLoadSupported(machineType);
}
bool UnalignedStoreSupported(const MachineType& machineType,
uint8_t alignment) {
return alignment_requirements_.IsUnalignedStoreSupported(machineType,
alignment);
bool UnalignedStoreSupported(const MachineType& machineType) {
return alignment_requirements_.IsUnalignedStoreSupported(machineType);
}
// Pseudo operators that translate to 32/64-bit operators depending on the
......
......@@ -143,7 +143,7 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
return UnalignedLoad(rep, base, IntPtrConstant(0));
}
Node* UnalignedLoad(MachineType rep, Node* base, Node* index) {
if (machine()->UnalignedLoadSupported(rep, 1)) {
if (machine()->UnalignedLoadSupported(rep)) {
return AddNode(machine()->Load(rep), base, index);
} else {
return AddNode(machine()->UnalignedLoad(rep), base, index);
......@@ -155,7 +155,7 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
Node* UnalignedStore(MachineRepresentation rep, Node* base, Node* index,
Node* value) {
MachineType t = MachineType::TypeForRepresentation(rep);
if (machine()->UnalignedStoreSupported(t, 1)) {
if (machine()->UnalignedStoreSupported(t)) {
return AddNode(machine()->Store(StoreRepresentation(
rep, WriteBarrierKind::kNoWriteBarrier)),
base, index, value);
......
......@@ -3191,7 +3191,7 @@ const Operator* WasmGraphBuilder::GetSafeStoreOperator(int offset,
wasm::ValueType type) {
int alignment = offset % (1 << ElementSizeLog2Of(type));
if (alignment == 0 || jsgraph()->machine()->UnalignedStoreSupported(
MachineType::TypeForRepresentation(type), 0)) {
MachineType::TypeForRepresentation(type))) {
StoreRepresentation rep(type, WriteBarrierKind::kNoWriteBarrier);
return jsgraph()->machine()->Store(rep);
}
......@@ -3211,7 +3211,7 @@ Node* WasmGraphBuilder::LoadMem(wasm::ValueType type, MachineType memtype,
}
if (memtype.representation() == MachineRepresentation::kWord8 ||
jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) {
jsgraph()->machine()->UnalignedLoadSupported(memtype)) {
if (FLAG_wasm_trap_handler && V8_TRAP_HANDLER_SUPPORTED) {
DCHECK(FLAG_wasm_guard_pages);
Node* position_node = jsgraph()->Int32Constant(position);
......@@ -3267,7 +3267,7 @@ Node* WasmGraphBuilder::StoreMem(MachineType memtype, Node* index,
#endif
if (memtype.representation() == MachineRepresentation::kWord8 ||
jsgraph()->machine()->UnalignedStoreSupported(memtype, alignment)) {
jsgraph()->machine()->UnalignedStoreSupported(memtype)) {
if (FLAG_wasm_trap_handler && V8_TRAP_HANDLER_SUPPORTED) {
Node* position_node = jsgraph()->Int32Constant(position);
store = graph()->NewNode(
......
......@@ -1120,7 +1120,7 @@ TEST_P(InstructionSelectorMemoryAccessUnalignedImmTest, StoreZero) {
TRACED_FOREACH(int32_t, index, memacc.immediates) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer());
bool unaligned_store_supported = m.machine()->UnalignedStoreSupported(
MachineType::TypeForRepresentation(memacc.type.representation()), 1);
MachineType::TypeForRepresentation(memacc.type.representation()));
m.UnalignedStore(memacc.type.representation(), m.Parameter(0),
m.Int32Constant(index), m.Int32Constant(0));
m.Return(m.Int32Constant(0));
......
......@@ -1562,7 +1562,7 @@ TEST_P(InstructionSelectorMemoryAccessUnalignedImmTest, StoreZero) {
TRACED_FOREACH(int32_t, index, memacc.immediates) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer());
bool unaligned_store_supported = m.machine()->UnalignedStoreSupported(
MachineType::TypeForRepresentation(memacc.type.representation()), 1);
MachineType::TypeForRepresentation(memacc.type.representation()));
m.UnalignedStore(memacc.type.representation(), m.Parameter(0),
m.Int32Constant(index), m.Int32Constant(0));
m.Return(m.Int32Constant(0));
......
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