OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 7 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
8 #include "src/interpreter/bytecode-label.h" | 8 #include "src/interpreter/bytecode-label.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override { | 27 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override { |
28 write_count_++; | 28 write_count_++; |
29 last_written_.Clone(node); | 29 last_written_.Clone(node); |
30 } | 30 } |
31 | 31 |
32 void BindLabel(BytecodeLabel* label) override {} | 32 void BindLabel(BytecodeLabel* label) override {} |
33 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {} | 33 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {} |
34 Handle<BytecodeArray> ToBytecodeArray( | 34 Handle<BytecodeArray> ToBytecodeArray( |
35 int fixed_register_count, int parameter_count, | 35 Isolate* isolate, int fixed_register_count, int parameter_count, |
36 Handle<FixedArray> handle_table) override { | 36 Handle<FixedArray> handle_table) override { |
37 return Handle<BytecodeArray>(); | 37 return Handle<BytecodeArray>(); |
38 } | 38 } |
39 | 39 |
40 BytecodeDeadCodeOptimizer* optimizer() { return &dead_code_optimizer_; } | 40 BytecodeDeadCodeOptimizer* optimizer() { return &dead_code_optimizer_; } |
41 | 41 |
42 int write_count() const { return write_count_; } | 42 int write_count() const { return write_count_; } |
43 const BytecodeNode& last_written() const { return last_written_; } | 43 const BytecodeNode& last_written() const { return last_written_; } |
44 | 44 |
45 private: | 45 private: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 BytecodeNode add(Bytecode::kAdd, Register(0).ToOperand(), 1); | 141 BytecodeNode add(Bytecode::kAdd, Register(0).ToOperand(), 1); |
142 optimizer()->Write(&add); | 142 optimizer()->Write(&add); |
143 CHECK_EQ(write_count(), 2); | 143 CHECK_EQ(write_count(), 2); |
144 CHECK_EQ(add, last_written()); | 144 CHECK_EQ(add, last_written()); |
145 } | 145 } |
146 | 146 |
147 } // namespace interpreter | 147 } // namespace interpreter |
148 } // namespace internal | 148 } // namespace internal |
149 } // namespace v8 | 149 } // namespace v8 |
OLD | NEW |