chromium/v8/test/cctest/test-code-stub-assembler.cc

// Copyright 2015 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 <cmath>
#include <optional>

#include "src/api/api-inl.h"
#include "src/base/strings.h"
#include "src/base/utils/random-number-generator.h"
#include "src/builtins/builtins-promise-gen.h"
#include "src/builtins/builtins-promise.h"
#include "src/builtins/builtins-string-gen.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/codegen/code-stub-assembler-inl.h"
#include "src/codegen/interface-descriptors-inl.h"
#include "src/compiler/node.h"
#include "src/debug/debug.h"
#include "src/execution/isolate.h"
#include "src/heap/heap-inl.h"
#include "src/heap/heap-verifier.h"
#include "src/numbers/hash-seed-inl.h"
#include "src/objects/js-array-inl.h"
#include "src/objects/js-promise-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/ordered-hash-table-inl.h"
#include "src/objects/promise-inl.h"
#include "src/objects/smi.h"
#include "src/objects/transitions-inl.h"
#include "src/strings/char-predicates.h"
#include "test/cctest/cctest-utils.h"
#include "test/cctest/compiler/function-tester.h"
#include "test/common/code-assembler-tester.h"

namespace v8 {
namespace internal {
namespace compiler {

#include "src/codegen/define-code-stub-assembler-macros.inc"

namespace {

Label;
TVariable;
PromiseResolvingFunctions;

intptr_t sum10(intptr_t a0, intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4,
               intptr_t a5, intptr_t a6, intptr_t a7, intptr_t a8,
               intptr_t a9) {}

static int sum3(int a0, int a1, int a2) {}

}  // namespace

TEST(CallCFunction) {}

TEST(CallCFunctionWithCallerSavedRegisters) {}

TEST(NumberToString) {}

namespace {

void CheckToUint32Result(uint32_t expected, DirectHandle<Object> result) {}

}  // namespace

TEST(ToUint32) {}

namespace {
void IsValidPositiveSmiCase(Isolate* isolate, intptr_t value) {}
}  // namespace

TEST(IsValidPositiveSmi) {}

TEST(ConvertAndClampRelativeIndex) {}

TEST(FixedArrayAccessSmiIndex) {}

TEST(LoadHeapNumberValue) {}

TEST(LoadInstanceType) {}

TEST(DecodeWordFromWord32) {}

TEST(JSFunction) {}

TEST(ComputeIntegerHash) {}

TEST(ToString) {}

TEST(TryToName) {}

namespace {

template <typename Dictionary>
void TestEntryToIndex() {}

TEST(NameDictionaryEntryToIndex) {}
TEST(GlobalDictionaryEntryToIndex) {}

}  // namespace

namespace {

template <typename Dictionary>
void TestNameDictionaryLookup() {}

}  // namespace

TEST(NameDictionaryLookup) {}

TEST(GlobalDictionaryLookup) {}

TEST(NumberDictionaryLookup) {}

TEST(TransitionLookup) {}

namespace {

void AddProperties(Handle<JSObject> object, Handle<Name> names[],
                   size_t count) {}

Handle<AccessorPair> CreateAccessorPair(FunctionTester* ft,
                                        const char* getter_body,
                                        const char* setter_body) {}

void AddProperties(Handle<JSObject> object, Handle<Name> names[],
                   size_t names_count, Handle<Object> values[],
                   size_t values_count, int seed = 0) {}

}  // namespace

TEST(TryHasOwnProperty) {}

TEST(TryGetOwnProperty) {}

namespace {

void AddElement(Handle<JSObject> object, uint32_t index,
                DirectHandle<Object> value,
                PropertyAttributes attributes = NONE) {}

}  // namespace

TEST(TryLookupElement) {}

TEST(AllocateJSObjectFromMap) {}

TEST(AllocationFoldingCSA) {}

namespace {

CSAAllocator;

Allocator;

// Tests that allocation code emitted by {csa_alloc} yields ordered hash tables
// identical to those produced by {alloc}.
template <typename Dictionary>
void TestDictionaryAllocation(CSAAllocator<Dictionary> csa_alloc,
                              Allocator<Dictionary> alloc, int max_capacity) {}

}  // namespace

TEST(AllocateNameDictionary) {}

TEST(AllocateOrderedNameDictionary) {}

TEST(AllocateOrderedHashSet) {}

TEST(AllocateOrderedHashMap) {}

TEST(PopAndReturnFromJSBuiltinWithStackParameters) {}

TEST(PopAndReturnFromTFCBuiltinWithStackParameters) {}

namespace {

TNode<Object> MakeConstantNode(CodeStubAssembler& m, Handle<Object> value) {}

// Buids a CSA function that calls |target| function with given arguments
// |number_of_iterations| times and checks that the stack pointer values before
// the calls and after the calls are the same.
// Then this new function is called multiple times.
template <typename... Args>
void CallFunctionWithStackPointerChecks(Isolate* isolate,
                                        Handle<Object> expected_result,
                                        Handle<Object> target,
                                        Handle<Object> receiver, Args... args) {}

}  // namespace

TEST(PopAndReturnConstant) {}

TEST(PopAndReturnVariable) {}

TEST(OneToTwoByteStringCopy) {}

TEST(OneToOneByteStringCopy) {}

TEST(OneToOneByteStringCopyNonZeroStart) {}

TEST(TwoToTwoByteStringCopy) {}

TEST(Arguments) {}

TEST(ArgumentsForEach) {}

TEST(IsDebugActive) {}

#if !defined(V8_OS_ANDROID)
// Ensure that the kShortBuiltinCallsOldSpaceSizeThreshold constant can be used
// for detecting whether the machine has >= 4GB of physical memory by checking
// the max old space size.
//
// Not on Android as short builtins do not depend on RAM on this platform, see
// comment in isolate.cc.
TEST(ShortBuiltinCallsThreshold) {}
#endif  // !defined(V8_OS_ANDROID)

TEST(CallBuiltin) {}

TEST(TailCallBuiltin) {}

class AppendJSArrayCodeStubAssembler : public CodeStubAssembler {};

TEST(BuildAppendJSArrayFastElement) {}

TEST(BuildAppendJSArrayFastElementGrow) {}

TEST(BuildAppendJSArrayFastSmiElement) {}

TEST(BuildAppendJSArrayFastSmiElementGrow) {}

TEST(BuildAppendJSArrayFastSmiElementObject) {}

TEST(BuildAppendJSArrayFastSmiElementObjectGrow) {}

TEST(BuildAppendJSArrayFastDoubleElements) {}

TEST(BuildAppendJSArrayFastDoubleElementsGrow) {}

TEST(BuildAppendJSArrayFastDoubleElementsObject) {}

namespace {

template <typename Stub, typename... Args>
void Recompile(Args... args) {}

}  // namespace

void CustomPromiseHook(v8::PromiseHookType type, v8::Local<v8::Promise> promise,
                       v8::Local<v8::Value> parentPromise) {}

TEST(IsPromiseHookEnabled) {}

TEST(NewJSPromise) {}

TEST(NewJSPromise2) {}

TEST(IsSymbol) {}

TEST(IsPrivateSymbol) {}

TEST(PromiseHasHandler) {}

TEST(CreatePromiseResolvingFunctionsContext) {}

TEST(CreatePromiseResolvingFunctions) {}

TEST(NewElementsCapacity) {}

TEST(NewElementsCapacitySmi) {}

TEST(AllocateRootFunctionWithContext) {}

TEST(CreatePromiseGetCapabilitiesExecutorContext) {}

TEST(NewPromiseCapability) {}

TEST(DirectMemoryTest8BitWord32Immediate) {}

TEST(DirectMemoryTest16BitWord32Immediate) {}

TEST(DirectMemoryTest8BitWord32) {}

TEST(DirectMemoryTest16BitWord32) {}

TEST(LoadJSArrayElementsMap) {}

TEST(IsWhiteSpaceOrLineTerminator) {}

TEST(BranchIfNumberRelationalComparison) {}

TEST(IsNumberArrayIndex) {}

TEST(NumberMinMax) {}

TEST(NumberAddSub) {}

TEST(CloneEmptyFixedArray) {}

TEST(CloneFixedArray) {}

TEST(CloneFixedArrayCOW) {}

TEST(ExtractFixedArrayCOWForceCopy) {}

TEST(ExtractFixedArraySimple) {}

TEST(ExtractFixedArraySimpleSmiConstant) {}

TEST(ExtractFixedArraySimpleIntPtrConstant) {}

TEST(ExtractFixedArraySimpleIntPtrConstantNoDoubles) {}

TEST(ExtractFixedArraySimpleIntPtrParameters) {}

TEST(SingleInputPhiElimination) {}

TEST(SmallOrderedHashMapAllocate) {}

TEST(SmallOrderedHashSetAllocate) {}

TEST(IsDoubleElementsKind) {}

namespace {

enum CallJumpMode {};

void TestCallJumpBuiltin(CallJumpMode mode,
                         BuiltinCallJumpMode builtin_call_jump_mode) {}

}  // namespace

TEST(TestCallBuiltinAbsolute) {}

TEST(TestCallBuiltinPCRelative) {}

TEST(TestCallBuiltinIndirect) {}

TEST(TestTailCallBuiltinAbsolute) {}

TEST(TestTailCallBuiltinPCRelative) {}

TEST(TestTailCallBuiltinIndirect) {}

TEST(InstructionSchedulingCallerSavedRegisters) {}

#if V8_ENABLE_WEBASSEMBLY
TEST(WasmInt32ToHeapNumber) {}

int32_t NumberToInt32(DirectHandle<Object> number) {}

TEST(WasmTaggedNonSmiToInt32) {}

TEST(WasmFloat32ToNumber) {}

TEST(WasmFloat64ToNumber) {}

double NumberToFloat64(DirectHandle<Object> number) {}

TEST(WasmTaggedToFloat64) {}
#endif  // V8_ENABLE_WEBASSEMBLY

TEST(SmiUntagLeftShiftOptimization) {}

TEST(UnsignedSmiShiftLeft) {}

TEST(SmiUntagComparisonOptimization) {}

TEST(PopCount) {}

TEST(CountTrailingZeros) {}

TEST(IntPtrMulHigh) {}

TEST(IntPtrMulHighConstantFoldable) {}

TEST(UintPtrMulHigh) {}

TEST(UintPtrMulHighConstantFoldable) {}

TEST(IntPtrMulWithOverflow) {}

#include "src/codegen/undef-code-stub-assembler-macros.inc"

}  // namespace compiler
}  // namespace internal
}  // namespace v8