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

[cleanup] Fix (D)CHECK macro usages in src/ic

Use the (D)CHECK_{EQ,NE,GT,...} macros instead of (D)CHECK with an
embedded comparison. This gives better error messages and also does the
right comparison for signed/unsigned mismatches.

This will allow us to reenable the readability/check cpplint check.

R=ishell@chromium.org

Bug: v8:6837, v8:6921
Change-Id: If44435035d234e90c1dc306a306832c9d36013a2
Reviewed-on: https://chromium-review.googlesource.com/723019Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48729}
parent 2551f73e
......@@ -790,7 +790,7 @@ Handle<Object> LoadIC::GetMapIndependentHandler(LookupIterator* lookup) {
int entry = exports->FindEntry(isolate(), lookup->name(),
Smi::ToInt(lookup->name()->GetHash()));
// We found the accessor, so the entry must exist.
DCHECK(entry != ObjectHashTable::kNotFound);
DCHECK_NE(entry, ObjectHashTable::kNotFound);
int index = ObjectHashTable::EntryToValueIndex(entry);
return LoadHandler::LoadModuleExport(isolate(), index);
}
......@@ -1529,7 +1529,7 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup) {
if (accessors->IsAccessorInfo()) {
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
DCHECK(v8::ToCData<Address>(info->setter()) != 0);
DCHECK_NOT_NULL(v8::ToCData<Address>(info->setter()));
DCHECK(!AccessorInfo::cast(*accessors)->is_special_data_property() ||
lookup->HolderIsReceiverOrHiddenPrototype());
DCHECK(
......@@ -2268,7 +2268,7 @@ RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) {
Address setter_address = v8::ToCData<Address>(callback->setter());
v8::AccessorNameSetterCallback fun =
FUNCTION_CAST<v8::AccessorNameSetterCallback>(setter_address);
DCHECK(fun != nullptr);
DCHECK_NOT_NULL(fun);
Object::ShouldThrow should_throw =
is_sloppy(language_mode) ? Object::DONT_THROW : Object::THROW_ON_ERROR;
......@@ -2384,7 +2384,7 @@ RUNTIME_FUNCTION(Runtime_LoadElementWithInterceptor) {
// TODO(verwaest): This should probably get the holder and receiver as input.
HandleScope scope(isolate);
Handle<JSObject> receiver = args.at<JSObject>(0);
DCHECK(args.smi_at(1) >= 0);
DCHECK_GE(args.smi_at(1), 0);
uint32_t index = args.smi_at(1);
InterceptorInfo* interceptor = receiver->GetIndexedInterceptor();
......
......@@ -218,7 +218,7 @@ class CallIC : public IC {
public:
CallIC(Isolate* isolate, CallICNexus* nexus)
: IC(EXTRA_CALL_FRAME, isolate, nexus) {
DCHECK(nexus != nullptr);
DCHECK_NOT_NULL(nexus);
}
};
......@@ -227,7 +227,7 @@ class LoadIC : public IC {
public:
LoadIC(Isolate* isolate, FeedbackNexus* nexus)
: IC(NO_EXTRA_FRAME, isolate, nexus) {
DCHECK(nexus != nullptr);
DCHECK_NOT_NULL(nexus);
DCHECK(IsAnyLoad());
}
......@@ -280,7 +280,7 @@ class KeyedLoadIC : public LoadIC {
public:
KeyedLoadIC(Isolate* isolate, KeyedLoadICNexus* nexus)
: LoadIC(isolate, nexus) {
DCHECK(nexus != nullptr);
DCHECK_NOT_NULL(nexus);
}
MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object,
......
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