Reviewers: Michael Starzinger,

Description:
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.

Please review this at https://chromiumcodereview.appspot.com/10377043/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/hydrogen.cc
  M     src/objects-inl.h
  M     src/objects.h


Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc     (revision 11523)
+++ src/hydrogen.cc     (working copy)
@@ -5713,7 +5713,7 @@
     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());
     }
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h   (revision 11523)
+++ src/objects-inl.h   (working copy)
@@ -3082,7 +3082,6 @@


 int Code::profiler_ticks() {
-  if (kind() == OPTIMIZED_FUNCTION) return 0;
   ASSERT_EQ(FUNCTION, kind());
   return READ_BYTE_FIELD(this, kProfilerTicksOffset);
 }
@@ -3673,6 +3672,12 @@
 }


+int SharedFunctionInfo::profiler_ticks() {
+  if (Code::FUNCTION != code()->kind()) return 0;
+  return code()->profiler_ticks();
+}
+
+
 LanguageMode SharedFunctionInfo::language_mode() {
   int hints = compiler_hints();
   if (BooleanBit::get(hints, kExtendedModeFunction)) {
Index: src/objects.h
===================================================================
--- src/objects.h       (revision 11523)
+++ src/objects.h       (working copy)
@@ -5351,6 +5351,8 @@
   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();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to