| 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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
| 6 | 6 |
| 7 #include <fstream> | 7 #include <fstream> |
| 8 | 8 |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 } | 762 } |
| 763 | 763 |
| 764 | 764 |
| 765 // ShiftLeft <src> | 765 // ShiftLeft <src> |
| 766 // | 766 // |
| 767 // Left shifts register <src> by the count specified in the accumulator. | 767 // Left shifts register <src> by the count specified in the accumulator. |
| 768 // Register <src> is converted to an int32 and the accumulator to uint32 | 768 // Register <src> is converted to an int32 and the accumulator to uint32 |
| 769 // before the operation. 5 lsb bits from the accumulator are used as count | 769 // before the operation. 5 lsb bits from the accumulator are used as count |
| 770 // i.e. <src> << (accumulator & 0x1F). | 770 // i.e. <src> << (accumulator & 0x1F). |
| 771 void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) { | 771 void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) { |
| 772 DoBinaryOp(CodeFactory::ShiftLeft(isolate_), assembler); | 772 DoBinaryOp(Runtime::kShiftLeft, assembler); |
| 773 } | 773 } |
| 774 | 774 |
| 775 | 775 |
| 776 // ShiftRight <src> | 776 // ShiftRight <src> |
| 777 // | 777 // |
| 778 // Right shifts register <src> by the count specified in the accumulator. | 778 // Right shifts register <src> by the count specified in the accumulator. |
| 779 // Result is sign extended. Register <src> is converted to an int32 and the | 779 // Result is sign extended. Register <src> is converted to an int32 and the |
| 780 // accumulator to uint32 before the operation. 5 lsb bits from the accumulator | 780 // accumulator to uint32 before the operation. 5 lsb bits from the accumulator |
| 781 // are used as count i.e. <src> >> (accumulator & 0x1F). | 781 // are used as count i.e. <src> >> (accumulator & 0x1F). |
| 782 void Interpreter::DoShiftRight(InterpreterAssembler* assembler) { | 782 void Interpreter::DoShiftRight(InterpreterAssembler* assembler) { |
| 783 DoBinaryOp(CodeFactory::ShiftRight(isolate_), assembler); | 783 DoBinaryOp(Runtime::kShiftRight, assembler); |
| 784 } | 784 } |
| 785 | 785 |
| 786 | 786 |
| 787 // ShiftRightLogical <src> | 787 // ShiftRightLogical <src> |
| 788 // | 788 // |
| 789 // Right Shifts register <src> by the count specified in the accumulator. | 789 // Right Shifts register <src> by the count specified in the accumulator. |
| 790 // Result is zero-filled. The accumulator and register <src> are converted to | 790 // Result is zero-filled. The accumulator and register <src> are converted to |
| 791 // uint32 before the operation 5 lsb bits from the accumulator are used as | 791 // uint32 before the operation 5 lsb bits from the accumulator are used as |
| 792 // count i.e. <src> << (accumulator & 0x1F). | 792 // count i.e. <src> << (accumulator & 0x1F). |
| 793 void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) { | 793 void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) { |
| 794 DoBinaryOp(CodeFactory::ShiftRightLogical(isolate_), assembler); | 794 DoBinaryOp(Runtime::kShiftRightLogical, assembler); |
| 795 } | 795 } |
| 796 | 796 |
| 797 void Interpreter::DoCountOp(Runtime::FunctionId function_id, | 797 void Interpreter::DoCountOp(Runtime::FunctionId function_id, |
| 798 InterpreterAssembler* assembler) { | 798 InterpreterAssembler* assembler) { |
| 799 Node* value = __ GetAccumulator(); | 799 Node* value = __ GetAccumulator(); |
| 800 Node* one = __ NumberConstant(1); | 800 Node* one = __ NumberConstant(1); |
| 801 Node* context = __ GetContext(); | 801 Node* context = __ GetContext(); |
| 802 Node* result = __ CallRuntime(function_id, context, value, one); | 802 Node* result = __ CallRuntime(function_id, context, value, one); |
| 803 __ SetAccumulator(result); | 803 __ SetAccumulator(result); |
| 804 __ Dispatch(); | 804 __ Dispatch(); |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 // Illegal | 1671 // Illegal |
| 1672 // | 1672 // |
| 1673 // An invalid bytecode aborting execution if dispatched. | 1673 // An invalid bytecode aborting execution if dispatched. |
| 1674 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { | 1674 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { |
| 1675 __ Abort(kInvalidBytecode); | 1675 __ Abort(kInvalidBytecode); |
| 1676 } | 1676 } |
| 1677 | 1677 |
| 1678 } // namespace interpreter | 1678 } // namespace interpreter |
| 1679 } // namespace internal | 1679 } // namespace internal |
| 1680 } // namespace v8 | 1680 } // namespace v8 |
| OLD | NEW |