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

Unified Diff: src/parser.cc

Issue 23710002: Revert "Cross-compiling from Linux to Android requires -lrt for the host toolset.", "Fix Visual Stu… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/optimizing-compiler-thread.cc ('k') | src/platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index e4a6bb2d3a643ba4455a96c881299016db95cd67..ccab7ec64c1a697d5f36aa59152dec389f9f4e25 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -569,13 +569,10 @@ Parser::Parser(CompilationInfo* info)
FunctionLiteral* Parser::ParseProgram() {
- HistogramTimerScope timer_scope(isolate()->counters()->parse());
+ HistogramTimerScope timer(isolate()->counters()->parse());
Handle<String> source(String::cast(script_->source()));
isolate()->counters()->total_parse_size()->Increment(source->length());
- ElapsedTimer timer;
- if (FLAG_trace_parse) {
- timer.Start();
- }
+ int64_t start = FLAG_trace_parse ? OS::Ticks() : 0;
fni_ = new(zone()) FuncNameInferrer(isolate(), zone());
// Initialize parser state.
@@ -596,7 +593,7 @@ FunctionLiteral* Parser::ParseProgram() {
}
if (FLAG_trace_parse && result != NULL) {
- double ms = timer.Elapsed().InMillisecondsF();
+ double ms = static_cast<double>(OS::Ticks() - start) / 1000;
if (info()->is_eval()) {
PrintF("[parsing eval");
} else if (info()->script()->name()->IsString()) {
@@ -700,13 +697,10 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
FunctionLiteral* Parser::ParseLazy() {
- HistogramTimerScope timer_scope(isolate()->counters()->parse_lazy());
+ HistogramTimerScope timer(isolate()->counters()->parse_lazy());
Handle<String> source(String::cast(script_->source()));
isolate()->counters()->total_parse_size()->Increment(source->length());
- ElapsedTimer timer;
- if (FLAG_trace_parse) {
- timer.Start();
- }
+ int64_t start = FLAG_trace_parse ? OS::Ticks() : 0;
Handle<SharedFunctionInfo> shared_info = info()->shared_info();
// Initialize parser state.
@@ -726,7 +720,7 @@ FunctionLiteral* Parser::ParseLazy() {
}
if (FLAG_trace_parse && result != NULL) {
- double ms = timer.Elapsed().InMillisecondsF();
+ double ms = static_cast<double>(OS::Ticks() - start) / 1000;
SmartArrayPointer<char> name_chars = result->debug_name()->ToCString();
PrintF("[parsing function: %s - took %0.3f ms]\n", *name_chars, ms);
}
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698