| 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta)); | 654 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta)); |
| 655 } | 655 } |
| 656 | 656 |
| 657 | 657 |
| 658 Node* InterpreterAssembler::Advance(Node* delta) { | 658 Node* InterpreterAssembler::Advance(Node* delta) { |
| 659 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); | 659 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); |
| 660 } | 660 } |
| 661 | 661 |
| 662 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } | 662 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } |
| 663 | 663 |
| 664 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { | 664 void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) { |
| 665 RawMachineLabel match, no_match; | 665 RawMachineLabel match, no_match; |
| 666 Node* condition = raw_assembler_->WordEqual(lhs, rhs); | |
| 667 raw_assembler_->Branch(condition, &match, &no_match); | 666 raw_assembler_->Branch(condition, &match, &no_match); |
| 668 raw_assembler_->Bind(&match); | 667 raw_assembler_->Bind(&match); |
| 669 DispatchTo(Advance(delta)); | 668 DispatchTo(Advance(delta)); |
| 670 raw_assembler_->Bind(&no_match); | 669 raw_assembler_->Bind(&no_match); |
| 671 Dispatch(); | 670 Dispatch(); |
| 672 } | 671 } |
| 673 | 672 |
| 673 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { |
| 674 JumpConditional(raw_assembler_->WordEqual(lhs, rhs), delta); |
| 675 } |
| 676 |
| 677 void InterpreterAssembler::JumpIfWordNotEqual(Node* lhs, Node* rhs, |
| 678 Node* delta) { |
| 679 JumpConditional(raw_assembler_->WordNotEqual(lhs, rhs), delta); |
| 680 } |
| 674 | 681 |
| 675 void InterpreterAssembler::Dispatch() { | 682 void InterpreterAssembler::Dispatch() { |
| 676 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_))); | 683 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_))); |
| 677 } | 684 } |
| 678 | 685 |
| 679 | 686 |
| 680 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { | 687 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { |
| 681 if (FLAG_trace_ignition) { | 688 if (FLAG_trace_ignition) { |
| 682 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); | 689 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); |
| 683 } | 690 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 return raw_assembler_->call_descriptor(); | 779 return raw_assembler_->call_descriptor(); |
| 773 } | 780 } |
| 774 | 781 |
| 775 | 782 |
| 776 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 783 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 777 | 784 |
| 778 | 785 |
| 779 } // namespace compiler | 786 } // namespace compiler |
| 780 } // namespace internal | 787 } // namespace internal |
| 781 } // namespace v8 | 788 } // namespace v8 |
| OLD | NEW |