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

Unified Diff: runtime/vm/benchmark_test.cc

Issue 1310463005: - Ensure that HandleScope is initialized with a thread. (Remove (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments Created 5 years, 4 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/vm/benchmark_test.h ('k') | runtime/vm/bit_vector_test.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 b65d6391519ceb62b5b9ca0e51a6f1ea7c0ad636..6e2761b660763d020c65ee977d1b66259230d06e 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -353,8 +353,7 @@ BENCHMARK(Dart2JSCompileAll) {
char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
char* script = NULL;
if (dart_root != NULL) {
- Isolate* isolate = Isolate::Current();
- HANDLESCOPE(isolate);
+ HANDLESCOPE(thread);
const char* kFormatStr =
"import '%s/pkg/compiler/lib/compiler.dart';";
intptr_t len = OS::SNPrint(NULL, 0, kFormatStr, dart_root) + 1;
@@ -595,7 +594,7 @@ static uint8_t* message_allocator(
BENCHMARK(SerializeNull) {
const Object& null_object = Object::Handle();
const intptr_t kLoopCount = 1000000;
- Isolate* isolate = Isolate::Current();
+ Isolate* isolate = thread->isolate();
uint8_t* buffer;
Timer timer(true, "Serialize Null");
timer.Start();
@@ -608,8 +607,7 @@ BENCHMARK(SerializeNull) {
// Read object back from the snapshot.
MessageSnapshotReader reader(buffer,
buffer_len,
- isolate,
- zone.GetZone());
+ thread);
reader.ReadObject();
}
timer.Stop();
@@ -621,7 +619,7 @@ BENCHMARK(SerializeNull) {
BENCHMARK(SerializeSmi) {
const Integer& smi_object = Integer::Handle(Smi::New(42));
const intptr_t kLoopCount = 1000000;
- Isolate* isolate = Isolate::Current();
+ Isolate* isolate = thread->isolate();
uint8_t* buffer;
Timer timer(true, "Serialize Smi");
timer.Start();
@@ -634,8 +632,7 @@ BENCHMARK(SerializeSmi) {
// Read object back from the snapshot.
MessageSnapshotReader reader(buffer,
buffer_len,
- isolate,
- zone.GetZone());
+ thread);
reader.ReadObject();
}
timer.Stop();
@@ -649,7 +646,7 @@ BENCHMARK(SimpleMessage) {
array_object.SetAt(0, Integer::Handle(Smi::New(42)));
array_object.SetAt(1, Object::Handle());
const intptr_t kLoopCount = 1000000;
- Isolate* isolate = Isolate::Current();
+ Isolate* isolate = thread->isolate();
uint8_t* buffer;
Timer timer(true, "Simple Message");
timer.Start();
@@ -662,8 +659,7 @@ BENCHMARK(SimpleMessage) {
// Read object back from the snapshot.
MessageSnapshotReader reader(buffer,
buffer_len,
- isolate,
- zone.GetZone());
+ thread);
reader.ReadObject();
free(buffer);
}
@@ -680,6 +676,7 @@ BENCHMARK(LargeMap) {
" for (int i = 0; i < 100000; ++i) m[i*13+i*(i>>7)] = i;\n"
" return m;\n"
"}";
+ Isolate* isolate = thread->isolate();
Dart_Handle h_lib = TestCase::LoadTestScript(kScript, NULL);
EXPECT_VALID(h_lib);
Dart_Handle h_result = Dart_Invoke(h_lib, NewString("makeMap"), 0, NULL);
@@ -687,7 +684,6 @@ BENCHMARK(LargeMap) {
Instance& map = Instance::Handle();
map ^= Api::UnwrapHandle(h_result);
const intptr_t kLoopCount = 100;
- Isolate* isolate = Isolate::Current();
uint8_t* buffer;
Timer timer(true, "Large Map");
timer.Start();
@@ -700,8 +696,7 @@ BENCHMARK(LargeMap) {
// Read object back from the snapshot.
MessageSnapshotReader reader(buffer,
buffer_len,
- isolate,
- zone.GetZone());
+ thread);
reader.ReadObject();
free(buffer);
}
« no previous file with comments | « runtime/vm/benchmark_test.h ('k') | runtime/vm/bit_vector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698