#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) { … }
}
TEST(CallCFunction) { … }
TEST(CallCFunctionWithCallerSavedRegisters) { … }
TEST(NumberToString) { … }
namespace {
void CheckToUint32Result(uint32_t expected, DirectHandle<Object> result) { … }
}
TEST(ToUint32) { … }
namespace {
void IsValidPositiveSmiCase(Isolate* isolate, intptr_t value) { … }
}
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 {
template <typename Dictionary>
void TestNameDictionaryLookup() { … }
}
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) { … }
}
TEST(TryHasOwnProperty) { … }
TEST(TryGetOwnProperty) { … }
namespace {
void AddElement(Handle<JSObject> object, uint32_t index,
DirectHandle<Object> value,
PropertyAttributes attributes = NONE) { … }
}
TEST(TryLookupElement) { … }
TEST(AllocateJSObjectFromMap) { … }
TEST(AllocationFoldingCSA) { … }
namespace {
CSAAllocator;
Allocator;
template <typename Dictionary>
void TestDictionaryAllocation(CSAAllocator<Dictionary> csa_alloc,
Allocator<Dictionary> alloc, int max_capacity) { … }
}
TEST(AllocateNameDictionary) { … }
TEST(AllocateOrderedNameDictionary) { … }
TEST(AllocateOrderedHashSet) { … }
TEST(AllocateOrderedHashMap) { … }
TEST(PopAndReturnFromJSBuiltinWithStackParameters) { … }
TEST(PopAndReturnFromTFCBuiltinWithStackParameters) { … }
namespace {
TNode<Object> MakeConstantNode(CodeStubAssembler& m, Handle<Object> value) { … }
template <typename... Args>
void CallFunctionWithStackPointerChecks(Isolate* isolate,
Handle<Object> expected_result,
Handle<Object> target,
Handle<Object> receiver, Args... args) { … }
}
TEST(PopAndReturnConstant) { … }
TEST(PopAndReturnVariable) { … }
TEST(OneToTwoByteStringCopy) { … }
TEST(OneToOneByteStringCopy) { … }
TEST(OneToOneByteStringCopyNonZeroStart) { … }
TEST(TwoToTwoByteStringCopy) { … }
TEST(Arguments) { … }
TEST(ArgumentsForEach) { … }
TEST(IsDebugActive) { … }
#if !defined(V8_OS_ANDROID)
TEST(ShortBuiltinCallsThreshold) { … }
#endif
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) { … }
}
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) { … }
}
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
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"
}
}
}