Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: runtime/vm/benchmark_test.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-typo Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/vmservice.cc ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/benchmark_test.cc
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index dc2fcdf89fa0573d50ea4751a4f9302b1f6e06c0..90cf8e682ce4c9eb81fccde7e501196f2670cd5e 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -39,6 +39,7 @@ void Benchmark::RunAll(const char* executable) {
BENCHMARK(CorelibCompileAll) {
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
+ TransitionNativeToVM transition(thread);
Timer timer(true, "Compile all of Core lib benchmark");
timer.Start();
const Error& error = Error::Handle(Library::CompileAll());
@@ -55,6 +56,7 @@ BENCHMARK(CorelibCompileAll) {
BENCHMARK(CorelibCompilerStats) {
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
+ TransitionNativeToVM transition(thread);
CompilerStats* stats = thread->isolate()->compiler_stats();
ASSERT(stats != NULL);
stats->EnableBenchmark();
@@ -78,7 +80,7 @@ BENCHMARK(CorelibIsolateStartup) {
const int kNumIterations = 1000;
Timer timer(true, "CorelibIsolateStartup");
Isolate* isolate = thread->isolate();
- Thread::ExitIsolate();
+ Dart_ExitIsolate();
for (int i = 0; i < kNumIterations; i++) {
timer.Start();
TestCase::CreateTestIsolate();
@@ -86,7 +88,7 @@ BENCHMARK(CorelibIsolateStartup) {
Dart_ShutdownIsolate();
}
benchmark->set_score(timer.TotalElapsedTime() / kNumIterations);
- Thread::EnterIsolate(isolate);
+ Dart_EnterIsolate(reinterpret_cast<Dart_Isolate>(isolate));
}
@@ -142,7 +144,7 @@ static Dart_NativeFunction bm_uda_lookup(Dart_Handle name,
int argument_count,
bool* auto_setup_scope) {
ASSERT(auto_setup_scope != NULL);
- *auto_setup_scope = false;
+ *auto_setup_scope = true;
const char* cstr = NULL;
Dart_Handle result = Dart_StringToCString(name, &cstr);
EXPECT_VALID(result);
@@ -693,6 +695,7 @@ BENCHMARK(SerializeSmi) {
BENCHMARK(SimpleMessage) {
+ TransitionNativeToVM transition(thread);
const Array& array_object = Array::Handle(Array::New(2));
array_object.SetAt(0, Integer::Handle(Smi::New(42)));
array_object.SetAt(1, Object::Handle());
« no previous file with comments | « runtime/lib/vmservice.cc ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698