chromium/v8/src/d8/d8-test.cc

// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/d8/d8.h"

#include "include/v8-fast-api-calls.h"
#include "include/v8-template.h"
#include "src/api/api-inl.h"

// This file exposes a d8.test.fast_c_api object, which adds testing facility
// for writing mjsunit tests that exercise fast API calls.
// The fast_c_api object also supports querying the number of fast/slow calls
// and resetting these counters.

namespace v8 {
namespace {

#define CHECK_SELF_OR_THROW_FAST_OPTIONS

#define CHECK_SELF_OR_THROW_FAST

#define CHECK_SELF_OR_THROW_SLOW

class FastCApiObject {};

#undef CHECK_SELF_OR_THROW_SLOW
#undef CHECK_SELF_OR_THROW_FAST
#undef CHECK_SELF_OR_THROW_FAST_OPTIONS

// The object is statically initialized for simplicity, typically the embedder
// will take care of managing their C++ objects lifetime.
thread_local FastCApiObject kFastCApiObject;
}  // namespace

// static
FastCApiObject& FastCApiObject::instance() {}

void CreateFastCAPIObject(const FunctionCallbackInfo<Value>& info) {}

Local<FunctionTemplate> Shell::CreateTestFastCApiTemplate(Isolate* isolate) {}

void CreateLeafInterfaceObject(const FunctionCallbackInfo<Value>& info) {}

Local<FunctionTemplate> Shell::CreateLeafInterfaceTypeTemplate(
    Isolate* isolate) {}

}  // namespace v8