v8/src/deoptimize-reason.cc
hablich 4f8e0fa685 Reland of Fix compiler warnings on "make android_arm" (patchset #1 id:1 of https://codereview.chromium.org/2286163002/ )
Reason for revert:
Roll was unstuck before the revert landed => reland

Original issue's description:
> Revert of Fix compiler warnings on "make android_arm" (patchset #1 id:1 of https://codereview.chromium.org/2264283007/ )
>
> Reason for revert:
> Speculative revert because of roll blocker https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20debug/builds/2241
>
> Original issue's description:
> > Fix compiler warnings on "make android_arm"
> >
> > Committed: https://crrev.com/3e809a6129d0097529c885579ac46e4acf4e99f6
> > Cr-Commit-Position: refs/heads/master@{#38937}
>
> TBR=bmeurer@chromium.org,jkummerow@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
>
> Committed: https://crrev.com/d992c1f52f116930239ed90cc033442047e789b4
> Cr-Commit-Position: refs/heads/master@{#38961}

TBR=bmeurer@chromium.org,jkummerow@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2285113002
Cr-Commit-Position: refs/heads/master@{#38962}
2016-08-28 21:03:32 +00:00

39 lines
1.1 KiB
C++

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/deoptimize-reason.h"
namespace v8 {
namespace internal {
std::ostream& operator<<(std::ostream& os, DeoptimizeReason reason) {
switch (reason) {
#define DEOPTIMIZE_REASON(Name, message) \
case DeoptimizeReason::k##Name: \
return os << #Name;
DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
#undef DEOPTIMIZE_REASON
}
UNREACHABLE();
return os;
}
size_t hash_value(DeoptimizeReason reason) {
return static_cast<uint8_t>(reason);
}
char const* DeoptimizeReasonToString(DeoptimizeReason reason) {
static char const* kDeoptimizeReasonStrings[] = {
#define DEOPTIMIZE_REASON(Name, message) message,
DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
#undef DEOPTIMIZE_REASON
};
size_t const index = static_cast<size_t>(reason);
DCHECK_LT(index, arraysize(kDeoptimizeReasonStrings));
return kDeoptimizeReasonStrings[index];
}
} // namespace internal
} // namespace v8