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

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

Issue 1138793002: Tag closures with their types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: More comment fixes Created 5 years, 7 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 | « test/codegen/expect/8invalid-chars.in+file_name.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/BenchmarkBase.js
diff --git a/test/codegen/expect/BenchmarkBase.js b/test/codegen/expect/BenchmarkBase.js
index 96e2fe3217fee7a91de5ace6c51c3a808a7649bb..a4a2c37ee954dda4f98235659a69e85bfa9e4a42 100644
--- a/test/codegen/expect/BenchmarkBase.js
+++ b/test/codegen/expect/BenchmarkBase.js
@@ -20,6 +20,14 @@ var core = dart.import(core);
throw message;
}
}
+ dart.setSignature(Expect, {
+ methods: () => ({fail: dart.functionType(dart.dynamic, [dart.dynamic])}),
+ statics: () => ({
+ equals: dart.functionType(dart.void, [dart.dynamic, dart.dynamic]),
+ listEquals: dart.functionType(dart.void, [core.List, core.List])
+ }),
+ names: ['equals', 'listEquals']
+ });
class BenchmarkBase extends core.Object {
BenchmarkBase(name) {
this.name = name;
@@ -50,12 +58,12 @@ var core = dart.import(core);
}
measure() {
this.setup();
- BenchmarkBase.measureFor((() => {
+ BenchmarkBase.measureFor(dart.fn((() => {
this.warmup();
- }).bind(this), 100);
- let result = BenchmarkBase.measureFor((() => {
+ }).bind(this)), 100);
+ let result = BenchmarkBase.measureFor(dart.fn((() => {
this.exercise();
- }).bind(this), 2000);
+ }).bind(this)), 2000);
this.teardown();
return result;
}
@@ -64,6 +72,19 @@ var core = dart.import(core);
core.print(`${this.name}(RunTime): ${score} us.`);
}
}
+ dart.setSignature(BenchmarkBase, {
+ methods: () => ({
+ run: dart.functionType(dart.void, []),
+ warmup: dart.functionType(dart.void, []),
+ exercise: dart.functionType(dart.void, []),
+ setup: dart.functionType(dart.void, []),
+ teardown: dart.functionType(dart.void, []),
+ measure: dart.functionType(core.double, []),
+ report: dart.functionType(dart.void, [])
+ }),
+ statics: () => ({measureFor: dart.functionType(core.double, [core.Function, core.int])}),
+ names: ['measureFor']
+ });
// Exports:
exports.Expect = Expect;
exports.BenchmarkBase = BenchmarkBase;
« no previous file with comments | « test/codegen/expect/8invalid-chars.in+file_name.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698