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

Unified Diff: src/compiler/js-call-reducer.cc

Issue 2330883002: [turbofan] Call frequencies for JSCallFunction and JSCallConstruct. (Closed)
Patch Set: Rebase onto the correct CL. Created 4 years, 3 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/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-inlining-heuristic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-call-reducer.cc
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
index cfee70a6df3ae041a8049088c072694f30776409..dcce497447cc504c1dc7d7803dd3528da9fcf53e 100644
--- a/src/compiler/js-call-reducer.cc
+++ b/src/compiler/js-call-reducer.cc
@@ -14,30 +14,6 @@ namespace v8 {
namespace internal {
namespace compiler {
-namespace {
-
-VectorSlotPair CallCountFeedback(VectorSlotPair p) {
- // Extract call count from {p}.
- if (!p.IsValid()) return VectorSlotPair();
- CallICNexus n(p.vector(), p.slot());
- int const call_count = n.ExtractCallCount();
- if (call_count <= 0) return VectorSlotPair();
-
- // Create megamorphic CallIC feedback with the given {call_count}.
- StaticFeedbackVectorSpec spec;
- FeedbackVectorSlot slot = spec.AddCallICSlot();
- Handle<TypeFeedbackMetadata> metadata =
- TypeFeedbackMetadata::New(n.GetIsolate(), &spec);
- Handle<TypeFeedbackVector> vector =
- TypeFeedbackVector::New(n.GetIsolate(), metadata);
- CallICNexus nexus(vector, slot);
- nexus.ConfigureMegamorphic(call_count);
- return VectorSlotPair(vector, slot);
-}
-
-} // namespace
-
-
Reduction JSCallReducer::Reduce(Node* node) {
switch (node->opcode()) {
case IrOpcode::kJSCallConstruct:
@@ -166,7 +142,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) {
}
// Change {node} to the new {JSCallFunction} operator.
NodeProperties::ChangeOp(
- node, javascript()->CallFunction(arity, CallCountFeedback(p.feedback()),
+ node, javascript()->CallFunction(arity, p.frequency(), VectorSlotPair(),
convert_mode, p.tail_call_mode()));
// Change context of {node} to the Function.prototype.apply context,
// to ensure any exception is thrown in the correct context.
@@ -206,7 +182,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) {
--arity;
}
NodeProperties::ChangeOp(
- node, javascript()->CallFunction(arity, CallCountFeedback(p.feedback()),
+ node, javascript()->CallFunction(arity, p.frequency(), VectorSlotPair(),
convert_mode, p.tail_call_mode()));
// Try to further reduce the JSCallFunction {node}.
Reduction const reduction = ReduceJSCallFunction(node);
@@ -287,7 +263,7 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
arity++;
}
NodeProperties::ChangeOp(node, javascript()->CallFunction(
- arity, CallCountFeedback(p.feedback()),
+ arity, p.frequency(), VectorSlotPair(),
convert_mode, p.tail_call_mode()));
// Try to further reduce the JSCallFunction {node}.
Reduction const reduction = ReduceJSCallFunction(node);
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-inlining-heuristic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698