5#ifndef RUNTIME_VM_BENCHMARK_TEST_H_
6#define RUNTIME_VM_BENCHMARK_TEST_H_
32#define BENCHMARK_HELPER(name, kind) \
33 void Dart_Benchmark##name(Benchmark* benchmark); \
34 static Benchmark kRegister##name(Dart_Benchmark##name, #name, kind); \
35 static void Dart_BenchmarkHelper##name(Benchmark* benchmark, \
37 void Dart_Benchmark##name(Benchmark* benchmark) { \
38 FLAG_old_gen_growth_space_ratio = 100; \
39 BenchmarkIsolateScope __isolate__(benchmark); \
40 Thread* __thread__ = Thread::Current(); \
41 ASSERT(__thread__->isolate() == benchmark->isolate()); \
42 Dart_BenchmarkHelper##name(benchmark, __thread__); \
44 static void Dart_BenchmarkHelper##name(Benchmark* benchmark, Thread* thread)
46#define BENCHMARK(name) BENCHMARK_HELPER(name, "RunTime")
47#define BENCHMARK_SIZE(name) BENCHMARK_HELPER(name, "CodeSize")
48#define BENCHMARK_MEMORY(name) BENCHMARK_HELPER(name, "MemoryUse")
65 if (first_ ==
nullptr) {
74 const char*
name()
const {
return name_; }
77 int64_t
score()
const {
return score_; }
80 void Run() { (*run_)(
this); }
83 static void RunAll(
const char* executable);
89 EXPECT(isolate_ !=
nullptr);
95 static const char* executable_;
99 const char* score_kind_;
117 benchmark_ =
nullptr;
Benchmark * benchmark() const
BenchmarkIsolateScope(Benchmark *benchmark)
static const char * Executable()
Benchmark(RunEntry *run, const char *name, const char *score_kind)
void set_score(int64_t value)
const char * name() const
void() RunEntry(Benchmark *benchmark)
const char * score_kind() const
static void RunAll(const char *executable)
Isolate * isolate() const
static void SetExecutable(const char *arg)
static Isolate * Current()
static Dart_Isolate CreateTestIsolate(const char *name=nullptr, void *isolate_group_data=nullptr, void *isolate_data=nullptr)
struct _Dart_Handle * Dart_Handle
struct _Dart_Isolate * Dart_Isolate
const uint8_t * vm_snapshot_data
const uint8_t * vm_snapshot_instructions
const uint8_t * core_isolate_snapshot_data
const uint8_t * core_isolate_snapshot_instructions
DART_EXPORT void Dart_EnterScope()
Dart_Handle NewString(const char *str)
DART_EXPORT void Dart_ExitScope()
DART_EXPORT void Dart_ShutdownIsolate()
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
DECLARE_FLAG(bool, show_invisible_frames)