| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler/bytecode-branch-analysis.h" | 10 #include "src/compiler/bytecode-branch-analysis.h" |
| (...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 } | 1520 } |
| 1521 FeedbackVectorSlot slot = | 1521 FeedbackVectorSlot slot = |
| 1522 feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); | 1522 feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); |
| 1523 DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC, | 1523 DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC, |
| 1524 feedback_vector()->GetKind(slot)); | 1524 feedback_vector()->GetKind(slot)); |
| 1525 CompareICNexus nexus(feedback_vector(), slot); | 1525 CompareICNexus nexus(feedback_vector(), slot); |
| 1526 return nexus.GetCompareOperationFeedback(); | 1526 return nexus.GetCompareOperationFeedback(); |
| 1527 } | 1527 } |
| 1528 | 1528 |
| 1529 float BytecodeGraphBuilder::ComputeCallFrequency(int slot_id) const { | 1529 float BytecodeGraphBuilder::ComputeCallFrequency(int slot_id) const { |
| 1530 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { | 1530 CallICNexus nexus(feedback_vector(), feedback_vector()->ToSlot(slot_id)); |
| 1531 CallICNexus nexus(feedback_vector(), feedback_vector()->ToSlot(slot_id)); | 1531 return nexus.ComputeCallFrequency() * invocation_frequency_; |
| 1532 return nexus.ComputeCallFrequency() * invocation_frequency_; | |
| 1533 } | |
| 1534 return 0.0f; | |
| 1535 } | 1532 } |
| 1536 | 1533 |
| 1537 void BytecodeGraphBuilder::VisitAdd() { | 1534 void BytecodeGraphBuilder::VisitAdd() { |
| 1538 BuildBinaryOp( | 1535 BuildBinaryOp( |
| 1539 javascript()->Add(GetBinaryOperationHint(kBinaryOperationHintIndex))); | 1536 javascript()->Add(GetBinaryOperationHint(kBinaryOperationHintIndex))); |
| 1540 } | 1537 } |
| 1541 | 1538 |
| 1542 void BytecodeGraphBuilder::VisitSub() { | 1539 void BytecodeGraphBuilder::VisitSub() { |
| 1543 BuildBinaryOp(javascript()->Subtract( | 1540 BuildBinaryOp(javascript()->Subtract( |
| 1544 GetBinaryOperationHint(kBinaryOperationHintIndex))); | 1541 GetBinaryOperationHint(kBinaryOperationHintIndex))); |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2281 source_positions_->set_current_position(it->source_position()); | 2278 source_positions_->set_current_position(it->source_position()); |
| 2282 it->Advance(); | 2279 it->Advance(); |
| 2283 } else { | 2280 } else { |
| 2284 DCHECK_GT(it->code_offset(), offset); | 2281 DCHECK_GT(it->code_offset(), offset); |
| 2285 } | 2282 } |
| 2286 } | 2283 } |
| 2287 | 2284 |
| 2288 } // namespace compiler | 2285 } // namespace compiler |
| 2289 } // namespace internal | 2286 } // namespace internal |
| 2290 } // namespace v8 | 2287 } // namespace v8 |
| OLD | NEW |