Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_BENCHMARK_TEST_H_ | 5 #ifndef VM_BENCHMARK_TEST_H_ |
| 6 #define VM_BENCHMARK_TEST_H_ | 6 #define VM_BENCHMARK_TEST_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 void Dart_Benchmark##name(Benchmark* benchmark) { \ | 28 void Dart_Benchmark##name(Benchmark* benchmark) { \ |
| 29 FLAG_heap_growth_space_ratio = 100; \ | 29 FLAG_heap_growth_space_ratio = 100; \ |
| 30 BenchmarkIsolateScope __isolate__(benchmark); \ | 30 BenchmarkIsolateScope __isolate__(benchmark); \ |
| 31 StackZone __zone__(benchmark->isolate()); \ | 31 StackZone __zone__(benchmark->isolate()); \ |
| 32 HandleScope __hs__(benchmark->isolate()); \ | 32 HandleScope __hs__(benchmark->isolate()); \ |
| 33 Dart_BenchmarkHelper##name(benchmark); \ | 33 Dart_BenchmarkHelper##name(benchmark); \ |
| 34 } \ | 34 } \ |
| 35 static void Dart_BenchmarkHelper##name(Benchmark* benchmark) | 35 static void Dart_BenchmarkHelper##name(Benchmark* benchmark) |
| 36 | 36 |
| 37 | 37 |
| 38 #define NewString(str) Dart_NewStringFromCString(str) | |
|
cshapiro
2012/10/24 23:52:29
This macro seems unnecessary. Make this a static
siva
2012/10/26 21:38:29
Made an inline function doing a string replace res
| |
| 39 | |
| 40 | |
| 38 class Benchmark { | 41 class Benchmark { |
| 39 public: | 42 public: |
| 40 typedef void (RunEntry)(Benchmark* benchmark); | 43 typedef void (RunEntry)(Benchmark* benchmark); |
| 41 | 44 |
| 42 Benchmark(RunEntry* run, const char* name) : | 45 Benchmark(RunEntry* run, const char* name) : |
| 43 run_(run), | 46 run_(run), |
| 44 name_(name), | 47 name_(name), |
| 45 score_(0), | 48 score_(0), |
| 46 isolate_(NULL), | 49 isolate_(NULL), |
| 47 next_(NULL) { | 50 next_(NULL) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 | 108 |
| 106 private: | 109 private: |
| 107 Benchmark* benchmark_; | 110 Benchmark* benchmark_; |
| 108 | 111 |
| 109 DISALLOW_COPY_AND_ASSIGN(BenchmarkIsolateScope); | 112 DISALLOW_COPY_AND_ASSIGN(BenchmarkIsolateScope); |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 } // namespace dart | 115 } // namespace dart |
| 113 | 116 |
| 114 #endif // VM_BENCHMARK_TEST_H_ | 117 #endif // VM_BENCHMARK_TEST_H_ |
| OLD | NEW |