LCOV - code coverage report
Current view: top level - src/interpreter - interpreter-intrinsics.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 9 11 81.8 %
Date: 2017-04-26 Functions: 3 3 100.0 %

          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     1794024 : bool IntrinsicsHelper::IsSupported(Runtime::FunctionId function_id) {
      15     1794024 :   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     1465374 :       return false;
      22             :   }
      23             : }
      24             : 
      25             : // static
      26      328181 : IntrinsicsHelper::IntrinsicId IntrinsicsHelper::FromRuntimeId(
      27             :     Runtime::FunctionId function_id) {
      28      328181 :   switch (function_id) {
      29             : #define TO_RUNTIME_ID(name, lower_case, count) \
      30             :   case Runtime::kInline##name:                 \
      31             :     return IntrinsicId::k##name;
      32        1098 :     INTRINSICS_LIST(TO_RUNTIME_ID)
      33             : #undef TO_RUNTIME_ID
      34             :     default:
      35           0 :       UNREACHABLE();
      36             :       return static_cast<IntrinsicsHelper::IntrinsicId>(-1);
      37             :   }
      38             : }
      39             : 
      40             : // static
      41       57674 : Runtime::FunctionId IntrinsicsHelper::ToRuntimeId(
      42             :     IntrinsicsHelper::IntrinsicId intrinsic_id) {
      43       57674 :   switch (intrinsic_id) {
      44             : #define TO_INTRINSIC_ID(name, lower_case, count) \
      45             :   case IntrinsicId::k##name:                     \
      46             :     return Runtime::kInline##name;
      47          50 :     INTRINSICS_LIST(TO_INTRINSIC_ID)
      48             : #undef TO_INTRINSIC_ID
      49             :     default:
      50           0 :       UNREACHABLE();
      51             :       return static_cast<Runtime::FunctionId>(-1);
      52             :   }
      53             : }
      54             : 
      55             : }  // namespace interpreter
      56             : }  // namespace internal
      57             : }  // namespace v8

Generated by: LCOV version 1.10