LCOV - code coverage report
Current view: top level - src - bailout-reason.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 2 7 28.6 %
Date: 2019-04-17 Functions: 1 3 33.3 %

          Line data    Source code
       1             : // Copyright 2014 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/bailout-reason.h"
       6             : #include "src/base/logging.h"
       7             : 
       8             : namespace v8 {
       9             : namespace internal {
      10             : 
      11             : #define ERROR_MESSAGES_TEXTS(C, T) T,
      12             : 
      13        3097 : const char* GetBailoutReason(BailoutReason reason) {
      14             :   DCHECK_LT(reason, BailoutReason::kLastErrorMessage);
      15             :   DCHECK_GE(reason, BailoutReason::kNoReason);
      16             :   static const char* error_messages_[] = {
      17             :       BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
      18        3097 :   return error_messages_[static_cast<int>(reason)];
      19             : }
      20             : 
      21           0 : const char* GetAbortReason(AbortReason reason) {
      22             :   DCHECK_LT(reason, AbortReason::kLastErrorMessage);
      23             :   DCHECK_GE(reason, AbortReason::kNoReason);
      24             :   static const char* error_messages_[] = {
      25             :       ABORT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
      26           0 :   return error_messages_[static_cast<int>(reason)];
      27             : }
      28             : 
      29           0 : bool IsValidAbortReason(int reason_id) {
      30           0 :   return reason_id >= static_cast<int>(AbortReason::kNoReason) &&
      31           0 :          reason_id < static_cast<int>(AbortReason::kLastErrorMessage);
      32             : }
      33             : 
      34             : #undef ERROR_MESSAGES_TEXTS
      35             : }  // namespace internal
      36             : }  // namespace v8

Generated by: LCOV version 1.10