Line data Source code
1 : // Copyright 2015 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/interpreter/interpreter-intrinsics.h"
6 :
7 : #include "src/base/logging.h"
8 :
9 : namespace v8 {
10 : namespace internal {
11 : namespace interpreter {
12 :
13 : // static
14 1247182 : bool IntrinsicsHelper::IsSupported(Runtime::FunctionId function_id) {
15 : switch (function_id) {
16 : #define SUPPORTED(name, lower_case, count) case Runtime::kInline##name:
17 : INTRINSICS_LIST(SUPPORTED)
18 : return true;
19 : #undef SUPPORTED
20 : default:
21 1176000 : return false;
22 : }
23 : }
24 :
25 : // static
26 70952 : IntrinsicsHelper::IntrinsicId IntrinsicsHelper::FromRuntimeId(
27 : Runtime::FunctionId function_id) {
28 70952 : switch (function_id) {
29 : #define TO_RUNTIME_ID(name, lower_case, count) \
30 : case Runtime::kInline##name: \
31 : return IntrinsicId::k##name;
32 13019 : INTRINSICS_LIST(TO_RUNTIME_ID)
33 : #undef TO_RUNTIME_ID
34 : default:
35 0 : UNREACHABLE();
36 : }
37 : }
38 :
39 : // static
40 16353 : Runtime::FunctionId IntrinsicsHelper::ToRuntimeId(
41 : IntrinsicsHelper::IntrinsicId intrinsic_id) {
42 16353 : switch (intrinsic_id) {
43 : #define TO_INTRINSIC_ID(name, lower_case, count) \
44 : case IntrinsicId::k##name: \
45 : return Runtime::kInline##name;
46 2615 : INTRINSICS_LIST(TO_INTRINSIC_ID)
47 : #undef TO_INTRINSIC_ID
48 : default:
49 0 : UNREACHABLE();
50 : }
51 : }
52 :
53 : } // namespace interpreter
54 : } // namespace internal
55 122036 : } // namespace v8
|