| 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/interpreter-assembler.h" | 5 #include "src/compiler/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta)); | 646 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta)); |
| 647 } | 647 } |
| 648 | 648 |
| 649 | 649 |
| 650 Node* InterpreterAssembler::Advance(Node* delta) { | 650 Node* InterpreterAssembler::Advance(Node* delta) { |
| 651 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); | 651 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); |
| 652 } | 652 } |
| 653 | 653 |
| 654 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } | 654 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } |
| 655 | 655 |
| 656 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { | 656 void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) { |
| 657 RawMachineLabel match, no_match; | 657 RawMachineLabel match, no_match; |
| 658 Node* condition = raw_assembler_->WordEqual(lhs, rhs); | |
| 659 raw_assembler_->Branch(condition, &match, &no_match); | 658 raw_assembler_->Branch(condition, &match, &no_match); |
| 660 raw_assembler_->Bind(&match); | 659 raw_assembler_->Bind(&match); |
| 661 DispatchTo(Advance(delta)); | 660 DispatchTo(Advance(delta)); |
| 662 raw_assembler_->Bind(&no_match); | 661 raw_assembler_->Bind(&no_match); |
| 663 Dispatch(); | 662 Dispatch(); |
| 664 } | 663 } |
| 665 | 664 |
| 665 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { |
| 666 JumpConditional(raw_assembler_->WordEqual(lhs, rhs), delta); |
| 667 } |
| 668 |
| 669 void InterpreterAssembler::JumpIfWordNotEqual(Node* lhs, Node* rhs, |
| 670 Node* delta) { |
| 671 JumpConditional(raw_assembler_->WordNotEqual(lhs, rhs), delta); |
| 672 } |
| 666 | 673 |
| 667 void InterpreterAssembler::Dispatch() { | 674 void InterpreterAssembler::Dispatch() { |
| 668 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_))); | 675 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_))); |
| 669 } | 676 } |
| 670 | 677 |
| 671 | 678 |
| 672 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { | 679 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { |
| 673 if (FLAG_trace_ignition) { | 680 if (FLAG_trace_ignition) { |
| 674 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); | 681 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); |
| 675 } | 682 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 return raw_assembler_->call_descriptor(); | 755 return raw_assembler_->call_descriptor(); |
| 749 } | 756 } |
| 750 | 757 |
| 751 | 758 |
| 752 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 759 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 753 | 760 |
| 754 | 761 |
| 755 } // namespace compiler | 762 } // namespace compiler |
| 756 } // namespace internal | 763 } // namespace internal |
| 757 } // namespace v8 | 764 } // namespace v8 |
| OLD | NEW |