Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: src/x64/code-stubs-x64.cc

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 55eede68930bdb0772d66f1f489a3308394662c7..396a3a3d9049feb98e280e0ec21265bb74e7f6cf 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -23,7 +23,7 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rbx };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry);
}
@@ -31,14 +31,14 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
void FastNewContextStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rdi };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers);
}
void ToNumberStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers);
}
@@ -46,7 +46,7 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry);
}
@@ -61,7 +61,7 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Representation::Tagged() };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry,
representations);
}
@@ -71,7 +71,7 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax, rbx, rcx, rdx };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry);
}
@@ -79,14 +79,14 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rbx, rdx };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers);
}
void CallFunctionStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = {rsi, rdi};
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers);
}
@@ -100,7 +100,7 @@ void CallConstructStub::InitializeInterfaceDescriptor(
// TODO(turbofan): So far we don't gather type feedback and hence skip the
// slot parameter, but ArrayConstructStub needs the vector to be undefined.
Register registers[] = {rsi, rax, rdi, rbx};
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers);
}
@@ -108,7 +108,7 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rcx, rbx, rax };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry);
}
@@ -117,7 +117,7 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax, rbx };
descriptor->Initialize(
- MajorKey(), ARRAY_SIZE(registers), registers,
+ MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry);
}
@@ -137,7 +137,7 @@ static void InitializeArrayConstructorDescriptor(
if (constant_stack_parameter_count == 0) {
Register registers[] = { rsi, rdi, rbx };
- descriptor->Initialize(major, ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(major, arraysize(registers), registers,
deopt_handler, NULL, constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE);
} else {
@@ -148,7 +148,7 @@ static void InitializeArrayConstructorDescriptor(
Representation::Tagged(),
Representation::Tagged(),
Representation::Integer32() };
- descriptor->Initialize(major, ARRAY_SIZE(registers), registers, rax,
+ descriptor->Initialize(major, arraysize(registers), registers, rax,
deopt_handler, representations,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
@@ -168,7 +168,7 @@ static void InitializeInternalArrayConstructorDescriptor(
if (constant_stack_parameter_count == 0) {
Register registers[] = { rsi, rdi };
- descriptor->Initialize(major, ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(major, arraysize(registers), registers,
deopt_handler, NULL, constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE);
} else {
@@ -178,7 +178,7 @@ static void InitializeInternalArrayConstructorDescriptor(
Representation::Tagged(),
Representation::Tagged(),
Representation::Integer32() };
- descriptor->Initialize(major, ARRAY_SIZE(registers), registers, rax,
+ descriptor->Initialize(major, arraysize(registers), registers, rax,
deopt_handler, representations,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
@@ -225,7 +225,7 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
void CompareNilICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers,
FUNCTION_ADDR(CompareNilIC_Miss));
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
@@ -235,7 +235,7 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
void ToBooleanStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers,
FUNCTION_ADDR(ToBooleanIC_Miss));
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
@@ -245,7 +245,7 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rdx, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers,
FUNCTION_ADDR(BinaryOpIC_Miss));
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
@@ -255,7 +255,7 @@ void BinaryOpICStub::InitializeInterfaceDescriptor(
void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rcx, rdx, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers,
FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
}
@@ -263,7 +263,7 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
void StringAddStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rsi, rdx, rax };
- descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
+ descriptor->Initialize(MajorKey(), arraysize(registers), registers,
Runtime::FunctionForId(Runtime::kStringAdd)->entry);
}
@@ -283,7 +283,7 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
Representation::Integer32(), // actual number of arguments
Representation::Integer32(), // expected number of arguments
};
- descriptor->Initialize(ARRAY_SIZE(registers), registers, representations);
+ descriptor->Initialize(arraysize(registers), registers, representations);
}
{
CallInterfaceDescriptor* descriptor =
@@ -295,7 +295,7 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
Representation::Tagged(), // context
Representation::Tagged(), // key
};
- descriptor->Initialize(ARRAY_SIZE(registers), registers, representations);
+ descriptor->Initialize(arraysize(registers), registers, representations);
}
{
CallInterfaceDescriptor* descriptor =
@@ -307,7 +307,7 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
Representation::Tagged(), // context
Representation::Tagged(), // name
};
- descriptor->Initialize(ARRAY_SIZE(registers), registers, representations);
+ descriptor->Initialize(arraysize(registers), registers, representations);
}
{
CallInterfaceDescriptor* descriptor =
@@ -319,7 +319,7 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
Representation::Tagged(), // context
Representation::Tagged(), // receiver
};
- descriptor->Initialize(ARRAY_SIZE(registers), registers, representations);
+ descriptor->Initialize(arraysize(registers), registers, representations);
}
{
CallInterfaceDescriptor* descriptor =
@@ -337,7 +337,7 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
Representation::Tagged(), // holder
Representation::External(), // api_function_address
};
- descriptor->Initialize(ARRAY_SIZE(registers), registers, representations);
+ descriptor->Initialize(arraysize(registers), registers, representations);
}
}
« src/base/macros.h ('K') | « src/vector.h ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698