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

Side by Side Diff: src/compiler/js-inlining.cc

Issue 2856103002: [turbofan] Introduce dedicated CallFrequency class. (Closed)
Patch Set: Address offline feedback from jarin@. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-inlining-heuristic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-inlining.h" 5 #include "src/compiler/js-inlining.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/compilation-info.h" 8 #include "src/compilation-info.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/all-nodes.h" 10 #include "src/compiler/all-nodes.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return NodeProperties::GetFrameStateInput(call_); 59 return NodeProperties::GetFrameStateInput(call_);
60 } 60 }
61 61
62 int formal_arguments() { 62 int formal_arguments() {
63 // Both, {JSCall} and {JSConstruct}, have two extra inputs: 63 // Both, {JSCall} and {JSConstruct}, have two extra inputs:
64 // - JSConstruct: Includes target function and new target. 64 // - JSConstruct: Includes target function and new target.
65 // - JSCall: Includes target function and receiver. 65 // - JSCall: Includes target function and receiver.
66 return call_->op()->ValueInputCount() - 2; 66 return call_->op()->ValueInputCount() - 2;
67 } 67 }
68 68
69 float frequency() const { 69 CallFrequency frequency() const {
70 return (call_->opcode() == IrOpcode::kJSCall) 70 return (call_->opcode() == IrOpcode::kJSCall)
71 ? CallParametersOf(call_->op()).frequency() 71 ? CallParametersOf(call_->op()).frequency()
72 : ConstructParametersOf(call_->op()).frequency(); 72 : ConstructParametersOf(call_->op()).frequency();
73 } 73 }
74 74
75 private: 75 private:
76 Node* call_; 76 Node* call_;
77 }; 77 };
78 78
79 Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context, 79 Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context,
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 745
746 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } 746 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); }
747 747
748 SimplifiedOperatorBuilder* JSInliner::simplified() const { 748 SimplifiedOperatorBuilder* JSInliner::simplified() const {
749 return jsgraph()->simplified(); 749 return jsgraph()->simplified();
750 } 750 }
751 751
752 } // namespace compiler 752 } // namespace compiler
753 } // namespace internal 753 } // namespace internal
754 } // namespace v8 754 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-inlining-heuristic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698