v8/src/interpreter/interpreter-intrinsics.cc
Wiktor Garbacz 9a8efd8a4e [cleanup] Remove return after UNREACHABLE
Change-Id: I20ed35a7fb5104a9cc66bb54fa8966589c43d7f9
Reviewed-on: https://chromium-review.googlesource.com/507287
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Wiktor Garbacz <wiktorg@google.com>
Cr-Commit-Position: refs/heads/master@{#45458}
2017-05-22 13:10:01 +00:00

56 lines
1.4 KiB
C++

// Copyright 2015 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/interpreter/interpreter-intrinsics.h"
#include "src/base/logging.h"
namespace v8 {
namespace internal {
namespace interpreter {
// static
bool IntrinsicsHelper::IsSupported(Runtime::FunctionId function_id) {
switch (function_id) {
#define SUPPORTED(name, lower_case, count) case Runtime::kInline##name:
INTRINSICS_LIST(SUPPORTED)
return true;
#undef SUPPORTED
default:
return false;
}
}
// static
IntrinsicsHelper::IntrinsicId IntrinsicsHelper::FromRuntimeId(
Runtime::FunctionId function_id) {
switch (function_id) {
#define TO_RUNTIME_ID(name, lower_case, count) \
case Runtime::kInline##name: \
return IntrinsicId::k##name;
INTRINSICS_LIST(TO_RUNTIME_ID)
#undef TO_RUNTIME_ID
default:
UNREACHABLE();
}
}
// static
Runtime::FunctionId IntrinsicsHelper::ToRuntimeId(
IntrinsicsHelper::IntrinsicId intrinsic_id) {
switch (intrinsic_id) {
#define TO_INTRINSIC_ID(name, lower_case, count) \
case IntrinsicId::k##name: \
return Runtime::kInline##name;
INTRINSICS_LIST(TO_INTRINSIC_ID)
#undef TO_INTRINSIC_ID
default:
UNREACHABLE();
}
}
} // namespace interpreter
} // namespace internal
} // namespace v8