Commit 45535ba1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[ic][cleanup] Using 'using' instead of 'typedef'

Even though both are allowed in the style guide, it recommends to use
'using', as its syntax is more consistent with the rest of C++.
This CL turns all typedefs in ic code to 'using' declarations.

R=ishell@chromium.org

Bug: v8:8834
Change-Id: I70c74d3f20a6c15693157de5fc40bb769ef0599d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545895
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60520}
parent 98b87154
......@@ -3378,7 +3378,7 @@ void AccessorAssembler::StoreInArrayLiteralIC(const StoreICParameters* p) {
//////////////////// Public methods.
void AccessorAssembler::GenerateLoadIC() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3391,7 +3391,7 @@ void AccessorAssembler::GenerateLoadIC() {
}
void AccessorAssembler::GenerateLoadIC_Megamorphic() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3416,7 +3416,7 @@ void AccessorAssembler::GenerateLoadIC_Megamorphic() {
}
void AccessorAssembler::GenerateLoadIC_Noninlined() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3446,7 +3446,7 @@ void AccessorAssembler::GenerateLoadIC_Noninlined() {
}
void AccessorAssembler::GenerateLoadIC_Uninitialized() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3459,7 +3459,7 @@ void AccessorAssembler::GenerateLoadIC_Uninitialized() {
}
void AccessorAssembler::GenerateLoadICTrampoline() {
typedef LoadDescriptor Descriptor;
using Descriptor = LoadDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3471,7 +3471,7 @@ void AccessorAssembler::GenerateLoadICTrampoline() {
}
void AccessorAssembler::GenerateLoadICTrampoline_Megamorphic() {
typedef LoadDescriptor Descriptor;
using Descriptor = LoadDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3484,7 +3484,7 @@ void AccessorAssembler::GenerateLoadICTrampoline_Megamorphic() {
}
void AccessorAssembler::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
typedef LoadGlobalWithVectorDescriptor Descriptor;
using Descriptor = LoadGlobalWithVectorDescriptor;
Node* name = Parameter(Descriptor::kName);
Node* slot = Parameter(Descriptor::kSlot);
......@@ -3501,7 +3501,7 @@ void AccessorAssembler::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
}
void AccessorAssembler::GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode) {
typedef LoadGlobalDescriptor Descriptor;
using Descriptor = LoadGlobalDescriptor;
Node* name = Parameter(Descriptor::kName);
Node* slot = Parameter(Descriptor::kSlot);
......@@ -3514,7 +3514,7 @@ void AccessorAssembler::GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode) {
}
void AccessorAssembler::GenerateKeyedLoadIC() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3527,7 +3527,7 @@ void AccessorAssembler::GenerateKeyedLoadIC() {
}
void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3540,7 +3540,7 @@ void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
}
void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
typedef LoadDescriptor Descriptor;
using Descriptor = LoadDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3553,7 +3553,7 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
}
void AccessorAssembler::GenerateKeyedLoadICTrampoline_Megamorphic() {
typedef LoadDescriptor Descriptor;
using Descriptor = LoadDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3566,7 +3566,7 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline_Megamorphic() {
}
void AccessorAssembler::GenerateKeyedLoadIC_PolymorphicName() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3579,7 +3579,7 @@ void AccessorAssembler::GenerateKeyedLoadIC_PolymorphicName() {
}
void AccessorAssembler::GenerateStoreGlobalIC() {
typedef StoreGlobalWithVectorDescriptor Descriptor;
using Descriptor = StoreGlobalWithVectorDescriptor;
Node* name = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
......@@ -3592,7 +3592,7 @@ void AccessorAssembler::GenerateStoreGlobalIC() {
}
void AccessorAssembler::GenerateStoreGlobalICTrampoline() {
typedef StoreGlobalDescriptor Descriptor;
using Descriptor = StoreGlobalDescriptor;
Node* name = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
......@@ -3604,7 +3604,7 @@ void AccessorAssembler::GenerateStoreGlobalICTrampoline() {
}
void AccessorAssembler::GenerateStoreIC() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3618,7 +3618,7 @@ void AccessorAssembler::GenerateStoreIC() {
}
void AccessorAssembler::GenerateStoreICTrampoline() {
typedef StoreDescriptor Descriptor;
using Descriptor = StoreDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3632,7 +3632,7 @@ void AccessorAssembler::GenerateStoreICTrampoline() {
}
void AccessorAssembler::GenerateKeyedStoreIC() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3646,7 +3646,7 @@ void AccessorAssembler::GenerateKeyedStoreIC() {
}
void AccessorAssembler::GenerateKeyedStoreICTrampoline() {
typedef StoreDescriptor Descriptor;
using Descriptor = StoreDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3660,7 +3660,7 @@ void AccessorAssembler::GenerateKeyedStoreICTrampoline() {
}
void AccessorAssembler::GenerateStoreInArrayLiteralIC() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* array = Parameter(Descriptor::kReceiver);
Node* index = Parameter(Descriptor::kName);
......@@ -3674,7 +3674,7 @@ void AccessorAssembler::GenerateStoreInArrayLiteralIC() {
}
void AccessorAssembler::GenerateCloneObjectIC_Slow() {
typedef CloneObjectWithVectorDescriptor Descriptor;
using Descriptor = CloneObjectWithVectorDescriptor;
TNode<HeapObject> source = CAST(Parameter(Descriptor::kSource));
TNode<Smi> flags = CAST(Parameter(Descriptor::kFlags));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3744,7 +3744,7 @@ void AccessorAssembler::GenerateCloneObjectIC_Slow() {
}
void AccessorAssembler::GenerateCloneObjectIC() {
typedef CloneObjectWithVectorDescriptor Descriptor;
using Descriptor = CloneObjectWithVectorDescriptor;
TNode<HeapObject> source = CAST(Parameter(Descriptor::kSource));
Node* flags = Parameter(Descriptor::kFlags);
Node* slot = Parameter(Descriptor::kSlot);
......@@ -3898,7 +3898,7 @@ void AccessorAssembler::GenerateCloneObjectIC() {
}
void AccessorAssembler::GenerateKeyedHasIC() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3911,7 +3911,7 @@ void AccessorAssembler::GenerateKeyedHasIC() {
}
void AccessorAssembler::GenerateKeyedHasIC_Megamorphic() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -3922,7 +3922,7 @@ void AccessorAssembler::GenerateKeyedHasIC_Megamorphic() {
}
void AccessorAssembler::GenerateKeyedHasIC_PolymorphicName() {
typedef LoadWithVectorDescriptor Descriptor;
using Descriptor = LoadWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......
......@@ -282,9 +282,9 @@ class AccessorAssembler : public CodeStubAssembler {
// Low-level helpers.
typedef std::function<void(Node* code_handler)> OnCodeHandler;
typedef std::function<void(Node* properties, Node* name_index)>
OnFoundOnReceiver;
using OnCodeHandler = std::function<void(Node* code_handler)>;
using OnFoundOnReceiver =
std::function<void(Node* properties, Node* name_index)>;
template <typename ICHandler, typename ICParameters>
Node* HandleProtoHandler(const ICParameters* p, Node* handler,
......@@ -343,12 +343,12 @@ class AccessorAssembler : public CodeStubAssembler {
// and then jump to an exit label.
class ExitPoint {
private:
typedef compiler::Node Node;
typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
typedef compiler::CodeAssemblerVariable CodeAssemblerVariable;
using Node = compiler::Node;
using CodeAssemblerLabel = compiler::CodeAssemblerLabel;
using CodeAssemblerVariable = compiler::CodeAssemblerVariable;
public:
typedef std::function<void(Node* result)> IndirectReturnHandler;
using IndirectReturnHandler = std::function<void(Node* result)>;
explicit ExitPoint(CodeStubAssembler* assembler)
: ExitPoint(assembler, nullptr) {}
......
......@@ -17,7 +17,7 @@ class CodeAssemblerState;
class BinaryOpAssembler : public CodeStubAssembler {
public:
typedef compiler::Node Node;
using Node = compiler::Node;
explicit BinaryOpAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
......@@ -48,8 +48,8 @@ class BinaryOpAssembler : public CodeStubAssembler {
bool rhs_is_smi);
private:
typedef std::function<Node*(Node*, Node*, Variable*)> SmiOperation;
typedef std::function<Node*(Node*, Node*)> FloatOperation;
using SmiOperation = std::function<Node*(Node*, Node*, Variable*)>;
using FloatOperation = std::function<Node*(Node*, Node*)>;
Node* Generate_BinaryOperationWithFeedback(
Node* context, Node* lhs, Node* rhs, Node* slot_id, Node* feedback_vector,
......
......@@ -48,7 +48,7 @@ int InitPrototypeChecksImpl(Isolate* isolate, Handle<ICHandler> handler,
handler->set_data2(HeapObjectReference::Weak(*native_context));
} else {
// Enable access checks on receiver.
typedef typename ICHandler::DoAccessCheckOnReceiverBits Bit;
using Bit = typename ICHandler::DoAccessCheckOnReceiverBits;
*smi_handler = SetBitFieldValue<Bit>(isolate, *smi_handler, true);
}
checks_count++;
......@@ -56,7 +56,7 @@ int InitPrototypeChecksImpl(Isolate* isolate, Handle<ICHandler> handler,
!receiver_map->IsJSGlobalObjectMap()) {
if (!fill_handler) {
// Enable lookup on receiver.
typedef typename ICHandler::LookupOnReceiverBits Bit;
using Bit = typename ICHandler::LookupOnReceiverBits;
*smi_handler = SetBitFieldValue<Bit>(isolate, *smi_handler, true);
}
}
......
......@@ -27,7 +27,7 @@ enum class NamedPropertyType : bool { kNotOwn, kOwn };
class IC {
public:
// Alias the inline cache state type to make the IC code more readable.
typedef InlineCacheState State;
using State = InlineCacheState;
static constexpr int kMaxKeyedPolymorphism = 4;
......
......@@ -1014,7 +1014,7 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric(
}
void KeyedStoreGenericAssembler::KeyedStoreGeneric() {
typedef StoreDescriptor Descriptor;
using Descriptor = StoreDescriptor;
TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver));
TNode<Object> name = CAST(Parameter(Descriptor::kName));
......@@ -1033,7 +1033,7 @@ void KeyedStoreGenericAssembler::SetProperty(TNode<Context> context,
}
void KeyedStoreGenericAssembler::StoreIC_Uninitialized() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......
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