LCOV - code coverage report
Current view: top level - src - api-arguments.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 9 9 100.0 %
Date: 2019-03-21 Functions: 3 3 100.0 %

          Line data    Source code
       1             : // Copyright 2018 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/api-arguments.h"
       6             : 
       7             : #include "src/api-arguments-inl.h"
       8             : 
       9             : namespace v8 {
      10             : namespace internal {
      11             : 
      12     2683391 : PropertyCallbackArguments::PropertyCallbackArguments(
      13             :     Isolate* isolate, Object data, Object self, JSObject holder,
      14             :     Maybe<ShouldThrow> should_throw)
      15     2683391 :     : Super(isolate) {
      16             :   slot_at(T::kThisIndex).store(self);
      17             :   slot_at(T::kHolderIndex).store(holder);
      18             :   slot_at(T::kDataIndex).store(data);
      19     2683391 :   slot_at(T::kIsolateIndex).store(Object(reinterpret_cast<Address>(isolate)));
      20             :   int value = Internals::kInferShouldThrowMode;
      21     2683391 :   if (should_throw.IsJust()) {
      22     1901023 :     value = should_throw.FromJust();
      23             :   }
      24             :   slot_at(T::kShouldThrowOnErrorIndex).store(Smi::FromInt(value));
      25             : 
      26             :   // Here the hole is set as default value.
      27             :   // It cannot escape into js as it's removed in Call below.
      28             :   HeapObject the_hole = ReadOnlyRoots(isolate).the_hole_value();
      29             :   slot_at(T::kReturnValueDefaultValueIndex).store(the_hole);
      30             :   slot_at(T::kReturnValueIndex).store(the_hole);
      31             :   DCHECK((*slot_at(T::kHolderIndex))->IsHeapObject());
      32             :   DCHECK((*slot_at(T::kIsolateIndex))->IsSmi());
      33             : }
      34             : 
      35     2680413 : FunctionCallbackArguments::FunctionCallbackArguments(
      36             :     internal::Isolate* isolate, internal::Object data,
      37             :     internal::HeapObject callee, internal::Object holder,
      38             :     internal::HeapObject new_target, internal::Address* argv, int argc)
      39             :     : Super(isolate), argv_(argv), argc_(argc) {
      40             :   slot_at(T::kDataIndex).store(data);
      41             :   slot_at(T::kHolderIndex).store(holder);
      42             :   slot_at(T::kNewTargetIndex).store(new_target);
      43     2680413 :   slot_at(T::kIsolateIndex).store(Object(reinterpret_cast<Address>(isolate)));
      44             :   // Here the hole is set as default value.
      45             :   // It cannot escape into js as it's remove in Call below.
      46             :   HeapObject the_hole = ReadOnlyRoots(isolate).the_hole_value();
      47             :   slot_at(T::kReturnValueDefaultValueIndex).store(the_hole);
      48             :   slot_at(T::kReturnValueIndex).store(the_hole);
      49             :   DCHECK((*slot_at(T::kHolderIndex))->IsHeapObject());
      50             :   DCHECK((*slot_at(T::kIsolateIndex))->IsSmi());
      51     2680413 : }
      52             : 
      53             : }  // namespace internal
      54      120216 : }  // namespace v8

Generated by: LCOV version 1.10