| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 9b8f86f4687e8bb72a82166f7cc9f8376a483cee..7212475383a848c9c99fe7577cb4ac27364a5da4 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -260,10 +260,9 @@ void OptimizingCompiler::RecordOptimizationStats() {
|
| Handle<JSFunction> function = info()->closure();
|
| int opt_count = function->shared()->opt_count();
|
| function->shared()->set_opt_count(opt_count + 1);
|
| - double ms_creategraph =
|
| - static_cast<double>(time_taken_to_create_graph_) / 1000;
|
| - double ms_optimize = static_cast<double>(time_taken_to_optimize_) / 1000;
|
| - double ms_codegen = static_cast<double>(time_taken_to_codegen_) / 1000;
|
| + double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF();
|
| + double ms_optimize = time_taken_to_optimize_.InMillisecondsF();
|
| + double ms_codegen = time_taken_to_codegen_.InMillisecondsF();
|
| if (FLAG_trace_opt) {
|
| PrintF("[optimizing ");
|
| function->ShortPrint();
|
| @@ -382,9 +381,9 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| // performance of the hydrogen-based compiler.
|
| bool should_recompile = !info()->shared_info()->has_deoptimization_support();
|
| if (should_recompile || FLAG_hydrogen_stats) {
|
| - int64_t start_ticks = 0;
|
| + ElapsedTimer timer;
|
| if (FLAG_hydrogen_stats) {
|
| - start_ticks = OS::Ticks();
|
| + timer.Start();
|
| }
|
| CompilationInfoWithZone unoptimized(info()->shared_info());
|
| // Note that we use the same AST that we will use for generating the
|
| @@ -403,8 +402,7 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| Logger::LAZY_COMPILE_TAG, &unoptimized, shared);
|
| }
|
| if (FLAG_hydrogen_stats) {
|
| - int64_t ticks = OS::Ticks() - start_ticks;
|
| - isolate()->GetHStatistics()->IncrementFullCodeGen(ticks);
|
| + isolate()->GetHStatistics()->IncrementFullCodeGen(timer.Elapsed());
|
| }
|
| }
|
|
|
| @@ -856,7 +854,7 @@ static bool InstallFullCode(CompilationInfo* info) {
|
| // version of the function right away - unless the debugger is
|
| // active as it makes no sense to compile optimized code then.
|
| if (FLAG_always_opt &&
|
| - !Isolate::Current()->DebuggerHasBreakPoints()) {
|
| + !info->isolate()->DebuggerHasBreakPoints()) {
|
| CompilationInfoWithZone optimized(function);
|
| optimized.SetOptimizing(BailoutId::None());
|
| return Compiler::CompileLazy(&optimized);
|
| @@ -1035,13 +1033,7 @@ void Compiler::RecompileConcurrent(Handle<JSFunction> closure) {
|
| // aborted optimization. In either case we want to continue executing
|
| // the unoptimized code without running into OSR. If the unoptimized
|
| // code has been patched for OSR, unpatch it.
|
| - InterruptStub interrupt_stub;
|
| - Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate);
|
| - Handle<Code> replacement_code =
|
| - isolate->builtins()->OnStackReplacement();
|
| - Deoptimizer::RevertInterruptCode(shared->code(),
|
| - *interrupt_code,
|
| - *replacement_code);
|
| + Deoptimizer::RevertInterruptCode(isolate, shared->code());
|
| }
|
|
|
| if (isolate->has_pending_exception()) isolate->clear_pending_exception();
|
| @@ -1253,7 +1245,7 @@ CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
|
| : name_(name), info_(info), zone_(info->isolate()) {
|
| if (FLAG_hydrogen_stats) {
|
| info_zone_start_allocation_size_ = info->zone()->allocation_size();
|
| - start_ticks_ = OS::Ticks();
|
| + timer_.Start();
|
| }
|
| }
|
|
|
| @@ -1262,8 +1254,7 @@ CompilationPhase::~CompilationPhase() {
|
| if (FLAG_hydrogen_stats) {
|
| unsigned size = zone()->allocation_size();
|
| size += info_->zone()->allocation_size() - info_zone_start_allocation_size_;
|
| - int64_t ticks = OS::Ticks() - start_ticks_;
|
| - isolate()->GetHStatistics()->SaveTiming(name_, ticks, size);
|
| + isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(), size);
|
| }
|
| }
|
|
|
|
|