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/factory.h" | 7 #include "src/factory.h" |
8 #include "src/interpreter/bytecode-label.h" | 8 #include "src/interpreter/bytecode-label.h" |
9 #include "src/interpreter/bytecode-peephole-optimizer.h" | 9 #include "src/interpreter/bytecode-peephole-optimizer.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override { | 34 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override { |
35 write_count_++; | 35 write_count_++; |
36 last_written_.Clone(node); | 36 last_written_.Clone(node); |
37 } | 37 } |
38 | 38 |
39 void BindLabel(BytecodeLabel* label) override {} | 39 void BindLabel(BytecodeLabel* label) override {} |
40 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {} | 40 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {} |
41 Handle<BytecodeArray> ToBytecodeArray( | 41 Handle<BytecodeArray> ToBytecodeArray( |
42 int fixed_register_count, int parameter_count, | 42 Isolate* isolate, int fixed_register_count, int parameter_count, |
43 Handle<FixedArray> handle_table) override { | 43 Handle<FixedArray> handle_table) override { |
44 return Handle<BytecodeArray>(); | 44 return Handle<BytecodeArray>(); |
45 } | 45 } |
46 | 46 |
47 void Flush() { | 47 void Flush() { |
48 optimizer()->ToBytecodeArray(0, 0, factory()->empty_fixed_array()); | 48 optimizer()->ToBytecodeArray(isolate(), 0, 0, |
| 49 factory()->empty_fixed_array()); |
49 } | 50 } |
50 | 51 |
51 BytecodePeepholeOptimizer* optimizer() { return &peephole_optimizer_; } | 52 BytecodePeepholeOptimizer* optimizer() { return &peephole_optimizer_; } |
52 | 53 |
53 int write_count() const { return write_count_; } | 54 int write_count() const { return write_count_; } |
54 const BytecodeNode& last_written() const { return last_written_; } | 55 const BytecodeNode& last_written() const { return last_written_; } |
55 | 56 |
56 private: | 57 private: |
57 BytecodePeepholeOptimizer peephole_optimizer_; | 58 BytecodePeepholeOptimizer peephole_optimizer_; |
58 | 59 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 CHECK_EQ(last_written().operand_count(), 2); | 518 CHECK_EQ(last_written().operand_count(), 2); |
518 CHECK_EQ(last_written().operand(0), 0); | 519 CHECK_EQ(last_written().operand(0), 0); |
519 CHECK_EQ(last_written().operand(1), reg_operand); | 520 CHECK_EQ(last_written().operand(1), reg_operand); |
520 Reset(); | 521 Reset(); |
521 } | 522 } |
522 } | 523 } |
523 | 524 |
524 } // namespace interpreter | 525 } // namespace interpreter |
525 } // namespace internal | 526 } // namespace internal |
526 } // namespace v8 | 527 } // namespace v8 |
OLD | NEW |