LCOV - code coverage report
Current view: top level - src/objects - frame-array-inl.h (source / functions) Hit Total Coverage
Test: app.info Lines: 7 7 100.0 %
Date: 2017-10-20 Functions: 4 4 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             : #include "src/wasm/wasm-objects-inl.h"
      10             : 
      11             : // Has to be the last include (doesn't have include guards):
      12             : #include "src/objects/object-macros.h"
      13             : 
      14             : namespace v8 {
      15             : namespace internal {
      16             : 
      17             : CAST_ACCESSOR(FrameArray)
      18             : 
      19             : #define DEFINE_FRAME_ARRAY_ACCESSORS(name, type)                              \
      20             :   type* FrameArray::name(int frame_ix) const {                                \
      21             :     Object* obj =                                                             \
      22             :         get(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset);    \
      23             :     return type::cast(obj);                                                   \
      24             :   }                                                                           \
      25             :                                                                               \
      26             :   void FrameArray::Set##name(int frame_ix, type* value) {                     \
      27             :     set(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset, value); \
      28             :   }
      29    24476139 : FRAME_ARRAY_FIELD_LIST(DEFINE_FRAME_ARRAY_ACCESSORS)
      30             : #undef DEFINE_FRAME_ARRAY_ACCESSORS
      31             : 
      32         220 : bool FrameArray::IsWasmFrame(int frame_ix) const {
      33             :   const int flags = Flags(frame_ix)->value();
      34         220 :   return (flags & kIsWasmFrame) != 0;
      35             : }
      36             : 
      37        2990 : bool FrameArray::IsWasmInterpretedFrame(int frame_ix) const {
      38             :   const int flags = Flags(frame_ix)->value();
      39        2990 :   return (flags & kIsWasmInterpretedFrame) != 0;
      40             : }
      41             : 
      42         220 : bool FrameArray::IsAsmJsWasmFrame(int frame_ix) const {
      43             :   const int flags = Flags(frame_ix)->value();
      44         220 :   return (flags & kIsAsmJsWasmFrame) != 0;
      45             : }
      46             : 
      47             : int FrameArray::FrameCount() const {
      48             :   const int frame_count = Smi::ToInt(get(kFrameCountIndex));
      49             :   DCHECK_LE(0, frame_count);
      50             :   return frame_count;
      51             : }
      52             : 
      53             : }  // namespace internal
      54             : }  // namespace v8
      55             : 
      56             : #include "src/objects/object-macros-undef.h"
      57             : 
      58             : #endif  // V8_OBJECTS_FRAME_ARRAY_INL_H_

Generated by: LCOV version 1.10