Revision: 19267
Author: [email protected]
Date: Tue Feb 11 10:48:37 2014 UTC
Log: Get rid of the function sorting in for polymorphic calls.
The idea of this code was to sort functions according to
ticks spend executing them, but now these ticks are always
zero and therefore we fall back to sorting by AST length (or
even worse by source length) all the time, which is a bad,
arbitrary measure.
[email protected]
Review URL: https://codereview.chromium.org/159653003
http://code.google.com/p/v8/source/detail?r=19267
Modified:
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Tue Feb 11 06:53:14 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Feb 11 10:48:37 2014 UTC
@@ -6770,37 +6770,6 @@
UNREACHABLE();
return NULL;
}
-
-
-class FunctionSorter {
- public:
- FunctionSorter() : index_(0), ticks_(0), ast_length_(0), src_length_(0)
{ }
- FunctionSorter(int index, int ticks, int ast_length, int src_length)
- : index_(index),
- ticks_(ticks),
- ast_length_(ast_length),
- src_length_(src_length) { }
-
- int index() const { return index_; }
- int ticks() const { return ticks_; }
- int ast_length() const { return ast_length_; }
- int src_length() const { return src_length_; }
-
- private:
- int index_;
- int ticks_;
- int ast_length_;
- int src_length_;
-};
-
-
-inline bool operator<(const FunctionSorter& lhs, const FunctionSorter&
rhs) {
- int diff = lhs.ticks() - rhs.ticks();
- if (diff != 0) return diff > 0;
- diff = lhs.ast_length() - rhs.ast_length();
- if (diff != 0) return diff < 0;
- return lhs.src_length() < rhs.src_length();
-}
void HOptimizedGraphBuilder::HandlePolymorphicCallNamed(
@@ -6809,7 +6778,7 @@
SmallMapList* types,
Handle<String> name) {
int argument_count = expr->arguments()->length() + 1; // Includes
receiver.
- FunctionSorter order[kMaxCallPolymorphism];
+ int order[kMaxCallPolymorphism];
bool handle_smi = false;
bool handled_string = false;
@@ -6831,15 +6800,9 @@
handle_smi = true;
}
expr->set_target(target);
- order[ordered_functions++] =
- FunctionSorter(i,
- expr->target()->shared()->profiler_ticks(),
- InliningAstSize(expr->target()),
- expr->target()->shared()->SourceSize());
+ order[ordered_functions++] = i;
}
}
-
- std::sort(order, order + ordered_functions);
HBasicBlock* number_block = NULL;
HBasicBlock* join = NULL;
@@ -6847,7 +6810,7 @@
int count = 0;
for (int fn = 0; fn < ordered_functions; ++fn) {
- int i = order[fn].index();
+ int i = order[fn];
PropertyAccessInfo info(this, LOAD, ToType(types->at(i)), name);
if (info.type()->Is(Type::String())) {
if (handled_string) continue;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.