LCOV - code coverage report
Current view: top level - src/objects - frame-array-inl.h (source / functions) Hit Total Coverage
Test: app.info Lines: 12 12 100.0 %
Date: 2019-01-20 Functions: 13 13 100.0 %

          Line data    Source code
       1             : // Copyright 2017 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             : #ifndef V8_OBJECTS_FRAME_ARRAY_INL_H_
       6             : #define V8_OBJECTS_FRAME_ARRAY_INL_H_
       7             : 
       8             : #include "src/objects/frame-array.h"
       9             : 
      10             : #include "src/objects/foreign-inl.h"
      11             : #include "src/wasm/wasm-objects-inl.h"
      12             : 
      13             : // Has to be the last include (doesn't have include guards):
      14             : #include "src/objects/object-macros.h"
      15             : 
      16             : namespace v8 {
      17             : namespace internal {
      18             : 
      19    13008684 : OBJECT_CONSTRUCTORS_IMPL(FrameArray, FixedArray)
      20     6504342 : CAST_ACCESSOR(FrameArray)
      21             : 
      22             : #define DEFINE_FRAME_ARRAY_ACCESSORS(name, type)                              \
      23             :   type FrameArray::name(int frame_ix) const {                                 \
      24             :     Object obj =                                                              \
      25             :         get(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset);    \
      26             :     return type::cast(obj);                                                   \
      27             :   }                                                                           \
      28             :                                                                               \
      29             :   void FrameArray::Set##name(int frame_ix, type value) {                      \
      30             :     set(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset, value); \
      31             :   }
      32    39041500 : FRAME_ARRAY_FIELD_LIST(DEFINE_FRAME_ARRAY_ACCESSORS)
      33             : #undef DEFINE_FRAME_ARRAY_ACCESSORS
      34             : 
      35             : bool FrameArray::IsWasmFrame(int frame_ix) const {
      36        1652 :   const int flags = Flags(frame_ix)->value();
      37         826 :   return (flags & kIsWasmFrame) != 0;
      38             : }
      39             : 
      40             : bool FrameArray::IsWasmInterpretedFrame(int frame_ix) const {
      41        5466 :   const int flags = Flags(frame_ix)->value();
      42        2733 :   return (flags & kIsWasmInterpretedFrame) != 0;
      43             : }
      44             : 
      45             : bool FrameArray::IsAsmJsWasmFrame(int frame_ix) const {
      46        1652 :   const int flags = Flags(frame_ix)->value();
      47         826 :   return (flags & kIsAsmJsWasmFrame) != 0;
      48             : }
      49             : 
      50    20599291 : int FrameArray::FrameCount() const {
      51    20599291 :   const int frame_count = Smi::ToInt(get(kFrameCountIndex));
      52             :   DCHECK_LE(0, frame_count);
      53    20599291 :   return frame_count;
      54             : }
      55             : 
      56             : }  // namespace internal
      57             : }  // namespace v8
      58             : 
      59             : #include "src/objects/object-macros-undef.h"
      60             : 
      61             : #endif  // V8_OBJECTS_FRAME_ARRAY_INL_H_

Generated by: LCOV version 1.10