#include <utility>
#include "include/v8-function.h"
#include "src/api/api-inl.h"
#include "src/codegen/optimized-compilation-info.h"
#include "src/compiler/pipeline.h"
#include "src/debug/debug-interface.h"
#include "src/execution/execution.h"
#include "src/handles/handles.h"
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/interpreter.h"
#include "src/objects/objects-inl.h"
#include "src/parsing/parse-info.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace compiler {
#define SHARD_TEST_BY_2 …
#define SHARD_TEST_BY_4 …
static const char kFunctionName[] = …;
static const Token::Value kCompareOperators[] = …;
static const int SMI_MAX = …;
static const int SMI_MIN = …;
static MaybeHandle<Object> CallFunction(Isolate* isolate,
Handle<JSFunction> function) { … }
template <class... A>
static MaybeHandle<Object> CallFunction(Isolate* isolate,
Handle<JSFunction> function,
A... args) { … }
static v8::Local<v8::Value> CompileRun(v8::Isolate* isolate,
const char* source) { … }
template <class... A>
class BytecodeGraphCallable { … };
class BytecodeGraphTester { … };
#define SPACE …
#define REPEAT_2 …
#define REPEAT_4 …
#define REPEAT_8 …
#define REPEAT_16 …
#define REPEAT_32 …
#define REPEAT_64 …
#define REPEAT_128 …
#define REPEAT_256 …
#define REPEAT_127 …
template <int N, typename T = Handle<Object>>
struct ExpectedSnippet {
const char* code_snippet;
T return_value_and_parameters[N + 1];
inline T return_value() const { … }
inline T parameter(int i) const { … }
};
class RunBytecodeGraphBuilderTest : public TestWithNativeContext { … };
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderReturnStatements) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderPrimitiveExpressions) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTwoParameterTests) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderNamedLoad) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderKeyedLoad) { … }
SHARD_TEST_BY_2
SHARD_TEST_BY_2
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderPropertyCall) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCallNew) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCreateClosure) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCallRuntime) { … }
SHARD_TEST_BY_2
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderToObject) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderToName) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLogicalNot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTypeOf) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCompareTypeOf) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCountOperation) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderDelete) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderDeleteGlobal) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderDeleteLookupSlot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLookupSlot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLookupContextSlot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLookupGlobalSlot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLookupSlotWide) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCallLookupSlot) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderEval) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderEvalParams) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderEvalGlobal) { … }
bool get_compare_result(Isolate* isolate, Token::Value opcode,
Handle<Object> lhs_value, Handle<Object> rhs_value) { … }
const char* get_code_snippet(Token::Value opcode) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCompare) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTestIn) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTestInstanceOf) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTryCatch) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTryFinally1) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderTryFinally2) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderThrow) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderContext) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderLoadContext) { … }
TEST_F(RunBytecodeGraphBuilderTest,
BytecodeGraphBuilderCreateArgumentsNoParameters) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCreateArguments) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderCreateRestArguments) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderRegExpLiterals) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderArrayLiterals) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderObjectLiterals) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderIf) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderConditionalOperator) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderSwitch) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderSwitchMerge) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderNestedSwitch) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderBreakableBlocks) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderWhile) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderDo) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderFor) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderForIn) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderForOf) { … }
SHARD_TEST_BY_4
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderWithStatement) { … }
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderConstDeclaration) { … }
TEST_F(RunBytecodeGraphBuilderTest,
BytecodeGraphBuilderConstDeclarationLookupSlots) { … }
TEST_F(RunBytecodeGraphBuilderTest,
BytecodeGraphBuilderConstInLookupContextChain) { … }
TEST_F(RunBytecodeGraphBuilderTest,
BytecodeGraphBuilderIllegalConstDeclaration) { … }
class CountBreakDebugDelegate : public v8::debug::DebugDelegate { … };
TEST_F(RunBytecodeGraphBuilderTest, BytecodeGraphBuilderDebuggerStatement) { … }
#undef SHARD_TEST_BY_2
#undef SHARD_TEST_BY_4
#undef SPACE
#undef REPEAT_2
#undef REPEAT_4
#undef REPEAT_8
#undef REPEAT_16
#undef REPEAT_32
#undef REPEAT_64
#undef REPEAT_128
#undef REPEAT_256
#undef REPEAT_127
}
}
}