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