aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/bytecode-branch-analysis.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/bytecode-branch-analysis.cc')
-rw-r--r--src/compiler/bytecode-branch-analysis.cc43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/compiler/bytecode-branch-analysis.cc b/src/compiler/bytecode-branch-analysis.cc
deleted file mode 100644
index 4e96a53a..00000000
--- a/src/compiler/bytecode-branch-analysis.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/compiler/bytecode-branch-analysis.h"
-
-#include "src/interpreter/bytecode-array-iterator.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-BytecodeBranchAnalysis::BytecodeBranchAnalysis(
- Handle<BytecodeArray> bytecode_array, Zone* zone)
- : bytecode_array_(bytecode_array),
- is_backward_target_(bytecode_array->length(), zone),
- is_forward_target_(bytecode_array->length(), zone),
- zone_(zone) {}
-
-void BytecodeBranchAnalysis::Analyze() {
- interpreter::BytecodeArrayIterator iterator(bytecode_array());
- while (!iterator.done()) {
- interpreter::Bytecode bytecode = iterator.current_bytecode();
- int current_offset = iterator.current_offset();
- if (interpreter::Bytecodes::IsJump(bytecode)) {
- AddBranch(current_offset, iterator.GetJumpTargetOffset());
- }
- iterator.Advance();
- }
-}
-
-void BytecodeBranchAnalysis::AddBranch(int source_offset, int target_offset) {
- if (source_offset < target_offset) {
- is_forward_target_.Add(target_offset);
- } else {
- is_backward_target_.Add(target_offset);
- }
-}
-
-} // namespace compiler
-} // namespace internal
-} // namespace v8