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

Unified Diff: vm/benchmark_test.cc

Issue 10911025: Get rid of support for string interpolation in #import strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « tests/vm/vm.status ('k') | vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/benchmark_test.cc
===================================================================
--- vm/benchmark_test.cc (revision 11672)
+++ vm/benchmark_test.cc (working copy)
@@ -279,21 +279,23 @@
BENCHMARK(Dart2JSCompileAll) {
char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
- Dart_Handle import_map;
+ char* script = NULL;
if (dart_root != NULL) {
- import_map = Dart_NewList(2);
- Dart_ListSetAt(import_map, 0, Dart_NewString("DART_ROOT"));
- Dart_ListSetAt(import_map, 1, Dart_NewString(dart_root));
+ const char* kFormatStr ="#import('%s/lib/compiler/compiler.dart');";
+ intptr_t len = OS::SNPrint(NULL, 0, kFormatStr, dart_root) + 1;
+ script = reinterpret_cast<char*>(malloc(len));
+ EXPECT(script != NULL);
+ OS::SNPrint(script, len, kFormatStr, dart_root);
+ Dart_Handle lib = TestCase::LoadTestScript(
+ script,
+ reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+ EXPECT_VALID(lib);
} else {
- import_map = Dart_NewList(0);
+ Dart_Handle lib = TestCase::LoadTestScript(
+ "#import('lib/compiler/compiler.dart');",
+ reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+ EXPECT_VALID(lib);
}
- const char* kScriptChars =
- "#import('${DART_ROOT}/lib/compiler/compiler.dart');";
- Dart_Handle lib = TestCase::LoadTestScript(
- kScriptChars,
- reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver),
- import_map);
- EXPECT_VALID(lib);
Timer timer(true, "Compile all of dart2js benchmark");
timer.Start();
Dart_Handle result = Dart_CompileAll();
@@ -302,6 +304,7 @@
int64_t elapsed_time = timer.TotalElapsedTime();
benchmark->set_score(elapsed_time);
free(dart_root);
+ free(script);
}
« no previous file with comments | « tests/vm/vm.status ('k') | vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698