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