Lines Matching refs:candidate

174   // Check if the {node} is an appropriate candidate for inlining.
175 Candidate candidate = CollectFunctions(node, kMaxCallPolymorphism);
176 if (candidate.num_functions == 0) {
178 } else if (candidate.num_functions > 1 && !FLAG_polymorphic_inlining) {
186 candidate.total_size = 0;
190 for (int i = 0; i < candidate.num_functions; ++i) {
191 if (!candidate.bytecode[i].has_value()) {
192 candidate.can_inline_function[i] = false;
196 SharedFunctionInfoRef shared = candidate.functions[i].has_value()
197 ? candidate.functions[i].value().shared()
198 : candidate.shared_info.value();
199 candidate.can_inline_function[i] = candidate.bytecode[i].has_value();
201 // candidate could have been disabled meanwhile.
204 CHECK_IMPLIES(candidate.can_inline_function[i],
222 candidate.can_inline_function[i] = false;
224 if (candidate.can_inline_function[i]) {
226 BytecodeArrayRef bytecode = candidate.bytecode[i].value();
227 candidate.total_size += bytecode.length();
229 if (candidate.functions[i].has_value()) {
230 JSFunctionRef function = candidate.functions[i].value();
232 candidate.total_size += inlined_bytecode_size;
243 candidate.frequency = p.frequency();
246 candidate.frequency = p.frequency();
249 // Don't consider a {candidate} whose frequency is below the
252 if (candidate.frequency.IsKnown() &&
253 candidate.frequency.value() < FLAG_min_inlining_frequency) {
257 // Found a candidate. Insert it into the set of seen nodes s.t. we don't
260 // candidate when first seen, but later reductions may turn it into a valid
261 // candidate. In that case, the node should be revisited by
270 return InlineCandidate(candidate, true);
273 // In the general case we remember the candidate for later.
274 candidates_.insert(candidate);
282 // We inline at most one candidate in every iteration of the fixpoint.
288 Candidate candidate = *i;
291 // Ignore this candidate if it's no longer valid.
292 if (!IrOpcode::IsInlineeOpcode(candidate.node->opcode())) continue;
293 if (candidate.node->IsDead()) continue;
298 candidate.total_size * FLAG_reserve_inline_budget_scale_factor;
306 Reduction const reduction = InlineCandidate(candidate, false);
649 Candidate const& candidate,
663 int const num_calls = candidate.num_functions;
669 Node* target = jsgraph()->Constant(candidate.functions[i].value());
701 Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate,
703 int const num_calls = candidate.num_functions;
704 Node* const node = candidate.node;
711 total_inlined_bytecode_size_ += candidate.bytecode[0].value().length();
731 CreateOrReuseDispatch(node, callee, candidate, if_successes, calls, inputs,
772 if (candidate.can_inline_function[i] &&
778 total_inlined_bytecode_size_ += candidate.bytecode[i]->length();
812 os << candidates_.size() << " candidate(s) for inlining:" << std::endl;
813 for (const Candidate& candidate : candidates_) {
814 os << "- candidate: " << candidate.node->op()->mnemonic() << " node #"
815 << candidate.node->id() << " with frequency " << candidate.frequency
816 << ", " << candidate.num_functions << " target(s):" << std::endl;
817 for (int i = 0; i < candidate.num_functions; ++i) {
818 SharedFunctionInfoRef shared = candidate.functions[i].has_value()
819 ? candidate.functions[i]->shared()
820 : candidate.shared_info.value();
822 if (candidate.bytecode[i].has_value()) {
823 os << ", bytecode size: " << candidate.bytecode[i]->length();
824 if (candidate.functions[i].has_value()) {
825 JSFunctionRef function = candidate.functions[i].value();