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" |
11 #include "vm/dart_api_impl.h" | |
12 #include "vm/globals.h" | 11 #include "vm/globals.h" |
13 #include "vm/heap.h" | 12 #include "vm/heap.h" |
14 #include "vm/isolate.h" | 13 #include "vm/isolate.h" |
15 #include "vm/object.h" | 14 #include "vm/object.h" |
16 #include "vm/zone.h" | 15 #include "vm/zone.h" |
17 | 16 |
18 namespace dart { | 17 namespace dart { |
19 | 18 |
20 DECLARE_FLAG(int, code_heap_size); | 19 DECLARE_FLAG(int, code_heap_size); |
21 DECLARE_FLAG(int, old_gen_growth_space_ratio); | 20 DECLARE_FLAG(int, old_gen_growth_space_ratio); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 tail_->next_ = this; | 70 tail_->next_ = this; |
72 } | 71 } |
73 tail_ = this; | 72 tail_ = this; |
74 } | 73 } |
75 | 74 |
76 // Accessors. | 75 // Accessors. |
77 const char* name() const { return name_; } | 76 const char* name() const { return name_; } |
78 const char* score_kind() const { return score_kind_; } | 77 const char* score_kind() const { return score_kind_; } |
79 void set_score(int64_t value) { score_ = value; } | 78 void set_score(int64_t value) { score_ = value; } |
80 int64_t score() const { return score_; } | 79 int64_t score() const { return score_; } |
81 Isolate* isolate() const { return Api::CastIsolate(isolate_); } | 80 Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); } |
82 | 81 |
83 Dart_Isolate CreateIsolate(const uint8_t* buffer) { | 82 Dart_Isolate CreateIsolate(const uint8_t* buffer) { |
84 char* err = NULL; | 83 char* err = NULL; |
85 isolate_ = Dart_CreateIsolate(NULL, NULL, buffer, NULL, &err); | 84 isolate_ = Dart_CreateIsolate(NULL, NULL, buffer, NULL, &err); |
86 EXPECT(isolate_ != DART_ILLEGAL_ISOLATE); | 85 EXPECT(isolate_ != NULL); |
87 free(err); | 86 free(err); |
88 return isolate_; | 87 return isolate_; |
89 } | 88 } |
90 | 89 |
91 void Run() { (*run_)(this); } | 90 void Run() { (*run_)(this); } |
92 void RunBenchmark(); | 91 void RunBenchmark(); |
93 | 92 |
94 static void RunAll(const char* executable); | 93 static void RunAll(const char* executable); |
95 static void SetExecutable(const char* arg) { executable_ = arg; } | 94 static void SetExecutable(const char* arg) { executable_ = arg; } |
96 static const char* Executable() { return executable_; } | 95 static const char* Executable() { return executable_; } |
(...skipping 30 matching lines...) Expand all Loading... |
127 | 126 |
128 private: | 127 private: |
129 Benchmark* benchmark_; | 128 Benchmark* benchmark_; |
130 | 129 |
131 DISALLOW_COPY_AND_ASSIGN(BenchmarkIsolateScope); | 130 DISALLOW_COPY_AND_ASSIGN(BenchmarkIsolateScope); |
132 }; | 131 }; |
133 | 132 |
134 } // namespace dart | 133 } // namespace dart |
135 | 134 |
136 #endif // VM_BENCHMARK_TEST_H_ | 135 #endif // VM_BENCHMARK_TEST_H_ |
OLD | NEW |