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