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

Unified Diff: tools/parser-shell.cc

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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
« src/base/macros.h ('K') | « tools/lexer-shell.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/parser-shell.cc
diff --git a/tools/parser-shell.cc b/tools/parser-shell.cc
index f14c0008b42b1fa5794803f534b9acd4c920d8db..dbac64ab8f226c1cdc8c6ae3f406b14834ba6eac 100644
--- a/tools/parser-shell.cc
+++ b/tools/parser-shell.cc
@@ -56,7 +56,7 @@ class StringResource8 : public v8::String::ExternalAsciiStringResource {
int length_;
};
-std::pair<TimeDelta, TimeDelta> RunBaselineParser(
+std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
v8::Handle<v8::Context> context) {
int length = 0;
@@ -81,7 +81,7 @@ std::pair<TimeDelta, TimeDelta> RunBaselineParser(
break;
}
}
- TimeDelta parse_time1, parse_time2;
+ v8::base::TimeDelta parse_time1, parse_time2;
Handle<Script> script = Isolate::Current()->factory()->NewScript(
v8::Utils::OpenHandle(*source_handle));
i::ScriptData* cached_data_impl = NULL;
@@ -90,14 +90,14 @@ std::pair<TimeDelta, TimeDelta> RunBaselineParser(
CompilationInfoWithZone info(script);
info.MarkAsGlobal();
info.SetCachedData(&cached_data_impl, i::PRODUCE_CACHED_DATA);
- ElapsedTimer timer;
+ v8::base::ElapsedTimer timer;
timer.Start();
// Allow lazy parsing; otherwise we won't produce cached data.
bool success = Parser::Parse(&info, true);
parse_time1 = timer.Elapsed();
if (!success) {
fprintf(stderr, "Parsing failed\n");
- return std::make_pair(TimeDelta(), TimeDelta());
+ return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
}
}
// Second round of parsing (consume cached data).
@@ -105,14 +105,14 @@ std::pair<TimeDelta, TimeDelta> RunBaselineParser(
CompilationInfoWithZone info(script);
info.MarkAsGlobal();
info.SetCachedData(&cached_data_impl, i::CONSUME_CACHED_DATA);
- ElapsedTimer timer;
+ v8::base::ElapsedTimer timer;
timer.Start();
// Allow lazy parsing; otherwise cached data won't help.
bool success = Parser::Parse(&info, true);
parse_time2 = timer.Elapsed();
if (!success) {
fprintf(stderr, "Parsing failed\n");
- return std::make_pair(TimeDelta(), TimeDelta());
+ return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
}
}
return std::make_pair(parse_time1, parse_time2);
@@ -154,8 +154,9 @@ int main(int argc, char* argv[]) {
double first_parse_total = 0;
double second_parse_total = 0;
for (size_t i = 0; i < fnames.size(); i++) {
- std::pair<TimeDelta, TimeDelta> time = RunBaselineParser(
- fnames[i].c_str(), encoding, repeat, isolate, context);
+ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> time =
+ RunBaselineParser(fnames[i].c_str(), encoding, repeat, isolate,
+ context);
first_parse_total += time.first.InMillisecondsF();
second_parse_total += time.second.InMillisecondsF();
}
« src/base/macros.h ('K') | « tools/lexer-shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698