From 9889994c08d46a8587763905fd1a69d1be78b466 Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Tue, 8 May 2012 12:30:36 +0000 Subject: [PATCH] Fix function sorter from 11482 with correct fix. The sorter was reverted from trunk 3.10.8.1, with this change we can repush it. Review URL: https://chromiumcodereview.appspot.com/10377043 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen.cc | 2 +- src/objects-inl.h | 7 ++++++- src/objects.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index a179e80..3be001e 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -5713,7 +5713,7 @@ void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr, if (expr->ComputeTarget(map, name)) { order[ordered_functions++] = FunctionSorter(i, - expr->target()->shared()->code()->profiler_ticks(), + expr->target()->shared()->profiler_ticks(), InliningAstSize(expr->target()), expr->target()->shared()->SourceSize()); } diff --git a/src/objects-inl.h b/src/objects-inl.h index 96ad792..3aa3942 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -3082,7 +3082,6 @@ void Code::set_allow_osr_at_loop_nesting_level(int level) { int Code::profiler_ticks() { - if (kind() == OPTIMIZED_FUNCTION) return 0; ASSERT_EQ(FUNCTION, kind()); return READ_BYTE_FIELD(this, kProfilerTicksOffset); } @@ -3673,6 +3672,12 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) { } +int SharedFunctionInfo::profiler_ticks() { + if (code()->kind() != Code::FUNCTION) return 0; + return code()->profiler_ticks(); +} + + LanguageMode SharedFunctionInfo::language_mode() { int hints = compiler_hints(); if (BooleanBit::get(hints, kExtendedModeFunction)) { diff --git a/src/objects.h b/src/objects.h index e3a1fd0..ba0f41a 100644 --- a/src/objects.h +++ b/src/objects.h @@ -5351,6 +5351,8 @@ class SharedFunctionInfo: public HeapObject { inline int deopt_counter(); inline void set_deopt_counter(int counter); + inline int profiler_ticks(); + // Inline cache age is used to infer whether the function survived a context // disposal or not. In the former case we reset the opt_count. inline int ic_age(); -- 2.7.4