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

Unified Diff: test/codegen/expect/BenchmarkBase.js

Issue 1355893003: Rewire DDC to use the analyzer task model (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 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
Index: test/codegen/expect/BenchmarkBase.js
diff --git a/test/codegen/expect/BenchmarkBase.js b/test/codegen/expect/BenchmarkBase.js
index 1915751d9e8c935c0ad5efa508d127779c80cd45..33ae76ed7388443e412f65854c8b5838e83cd301 100644
--- a/test/codegen/expect/BenchmarkBase.js
+++ b/test/codegen/expect/BenchmarkBase.js
@@ -16,7 +16,7 @@ dart_library.library('BenchmarkBase', null, /* Imports */[
dart.throw(`Lists have different lengths: ${expected[dartx.length]} vs ${actual[dartx.length]}`);
}
for (let i = 0; dart.notNull(i) < dart.notNull(actual[dartx.length]); i = dart.notNull(i) + 1) {
- Expect.equals(expected[dartx.get](i), actual[dartx.get](i));
+ dart.dcall(Expect.equals, expected[dartx.get](i), actual[dartx.get](i));
}
}
fail(message) {
@@ -37,11 +37,11 @@ dart_library.library('BenchmarkBase', null, /* Imports */[
}
run() {}
warmup() {
- this.run();
+ dart.dcall(this.run);
}
exercise() {
for (let i = 0; dart.notNull(i) < 10; i = dart.notNull(i) + 1) {
- this.run();
+ dart.dcall(this.run);
}
}
setup() {}
@@ -50,7 +50,7 @@ dart_library.library('BenchmarkBase', null, /* Imports */[
let time = 0;
let iter = 0;
let watch = new core.Stopwatch();
- watch.start();
+ dart.dcall(watch.start);
let elapsed = 0;
while (dart.notNull(elapsed) < dart.notNull(timeMinimum)) {
dart.dcall(f);
@@ -60,19 +60,19 @@ dart_library.library('BenchmarkBase', null, /* Imports */[
return 1000.0 * dart.notNull(elapsed) / dart.notNull(iter);
}
measure() {
- this.setup();
- BenchmarkBase.measureFor(dart.fn(() => {
- this.warmup();
+ dart.dcall(this.setup);
+ dart.dcall(BenchmarkBase.measureFor, dart.fn(() => {
+ dart.dcall(this.warmup);
}), 100);
- let result = BenchmarkBase.measureFor(dart.fn(() => {
- this.exercise();
+ let result = dart.dcall(BenchmarkBase.measureFor, dart.fn(() => {
+ dart.dcall(this.exercise);
}), 2000);
- this.teardown();
+ dart.dcall(this.teardown);
return result;
}
report() {
- let score = this.measure();
- core.print(`${this.name}(RunTime): ${score} us.`);
+ let score = dart.dcall(this.measure);
+ dart.dcall(core.print, `${this.name}(RunTime): ${score} us.`);
}
}
dart.setSignature(BenchmarkBase, {
« pubspec.yaml ('K') | « pubspec.yaml ('k') | test/codegen/expect/BenchmarkBase.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698