OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 608 } |
609 break; | 609 break; |
610 case kX87And: | 610 case kX87And: |
611 if (HasImmediateInput(instr, 1)) { | 611 if (HasImmediateInput(instr, 1)) { |
612 __ and_(i.InputOperand(0), i.InputImmediate(1)); | 612 __ and_(i.InputOperand(0), i.InputImmediate(1)); |
613 } else { | 613 } else { |
614 __ and_(i.InputRegister(0), i.InputOperand(1)); | 614 __ and_(i.InputRegister(0), i.InputOperand(1)); |
615 } | 615 } |
616 break; | 616 break; |
617 case kX87Cmp: | 617 case kX87Cmp: |
618 if (HasImmediateInput(instr, 1)) { | 618 if (AddressingModeField::decode(instr->opcode()) != kMode_None) { |
619 __ cmp(i.InputOperand(0), i.InputImmediate(1)); | 619 size_t index = 0; |
| 620 Operand operand = i.MemoryOperand(&index); |
| 621 if (HasImmediateInput(instr, index)) { |
| 622 __ cmp(operand, i.InputImmediate(index)); |
| 623 } else { |
| 624 __ cmp(operand, i.InputRegister(index)); |
| 625 } |
620 } else { | 626 } else { |
621 __ cmp(i.InputRegister(0), i.InputOperand(1)); | 627 if (HasImmediateInput(instr, 1)) { |
| 628 __ cmp(i.InputOperand(0), i.InputImmediate(1)); |
| 629 } else { |
| 630 __ cmp(i.InputRegister(0), i.InputOperand(1)); |
| 631 } |
622 } | 632 } |
623 break; | 633 break; |
624 case kX87Test: | 634 case kX87Test: |
625 if (HasImmediateInput(instr, 1)) { | 635 if (AddressingModeField::decode(instr->opcode()) != kMode_None) { |
626 __ test(i.InputOperand(0), i.InputImmediate(1)); | 636 size_t index = 0; |
| 637 Operand operand = i.MemoryOperand(&index); |
| 638 if (HasImmediateInput(instr, index)) { |
| 639 __ test(operand, i.InputImmediate(index)); |
| 640 } else { |
| 641 __ test(i.InputRegister(index), operand); |
| 642 } |
627 } else { | 643 } else { |
628 __ test(i.InputRegister(0), i.InputOperand(1)); | 644 if (HasImmediateInput(instr, 1)) { |
| 645 __ test(i.InputOperand(0), i.InputImmediate(1)); |
| 646 } else { |
| 647 __ test(i.InputRegister(0), i.InputOperand(1)); |
| 648 } |
629 } | 649 } |
630 break; | 650 break; |
631 case kX87Imul: | 651 case kX87Imul: |
632 if (HasImmediateInput(instr, 1)) { | 652 if (HasImmediateInput(instr, 1)) { |
633 __ imul(i.OutputRegister(), i.InputOperand(0), i.InputInt32(1)); | 653 __ imul(i.OutputRegister(), i.InputOperand(0), i.InputInt32(1)); |
634 } else { | 654 } else { |
635 __ imul(i.OutputRegister(), i.InputOperand(1)); | 655 __ imul(i.OutputRegister(), i.InputOperand(1)); |
636 } | 656 } |
637 break; | 657 break; |
638 case kX87ImulHigh: | 658 case kX87ImulHigh: |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2250 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2231 __ Nop(padding_size); | 2251 __ Nop(padding_size); |
2232 } | 2252 } |
2233 } | 2253 } |
2234 | 2254 |
2235 #undef __ | 2255 #undef __ |
2236 | 2256 |
2237 } // namespace compiler | 2257 } // namespace compiler |
2238 } // namespace internal | 2258 } // namespace internal |
2239 } // namespace v8 | 2259 } // namespace v8 |
OLD | NEW |