OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 660 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
661 } | 661 } |
662 | 662 |
663 // Generate code to call the stub with the supplied arguments. This will add | 663 // Generate code to call the stub with the supplied arguments. This will add |
664 // code at the call site to prepare arguments either in registers or on the | 664 // code at the call site to prepare arguments either in registers or on the |
665 // stack together with the actual call. | 665 // stack together with the actual call. |
666 void GenerateCall(MacroAssembler* masm, Register left, Register right); | 666 void GenerateCall(MacroAssembler* masm, Register left, Register right); |
667 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); | 667 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); |
668 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); | 668 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); |
669 | 669 |
| 670 Result GenerateCall(MacroAssembler* masm, |
| 671 VirtualFrame* frame, |
| 672 Result* left, |
| 673 Result* right); |
| 674 |
670 private: | 675 private: |
671 Token::Value op_; | 676 Token::Value op_; |
672 OverwriteMode mode_; | 677 OverwriteMode mode_; |
673 GenericBinaryFlags flags_; | 678 GenericBinaryFlags flags_; |
674 bool args_in_registers_; // Arguments passed in registers not on the stack. | 679 bool args_in_registers_; // Arguments passed in registers not on the stack. |
675 bool args_reversed_; // Left and right argument are swapped. | 680 bool args_reversed_; // Left and right argument are swapped. |
676 bool use_sse3_; | 681 bool use_sse3_; |
677 char* name_; | 682 char* name_; |
678 | 683 |
679 const char* GetName(); | 684 const char* GetName(); |
(...skipping 28 matching lines...) Expand all Loading... |
708 | ArgsInRegistersBits::encode(args_in_registers_) | 713 | ArgsInRegistersBits::encode(args_in_registers_) |
709 | ArgsReversedBits::encode(args_reversed_); | 714 | ArgsReversedBits::encode(args_reversed_); |
710 } | 715 } |
711 | 716 |
712 void Generate(MacroAssembler* masm); | 717 void Generate(MacroAssembler* masm); |
713 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 718 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
714 void GenerateLoadArguments(MacroAssembler* masm); | 719 void GenerateLoadArguments(MacroAssembler* masm); |
715 void GenerateReturn(MacroAssembler* masm); | 720 void GenerateReturn(MacroAssembler* masm); |
716 | 721 |
717 bool ArgsInRegistersSupported() { | 722 bool ArgsInRegistersSupported() { |
718 return ((op_ == Token::ADD) || (op_ == Token::SUB) | 723 return (op_ == Token::ADD) || (op_ == Token::SUB) |
719 || (op_ == Token::MUL) || (op_ == Token::DIV)) | 724 || (op_ == Token::MUL) || (op_ == Token::DIV); |
720 && flags_ != NO_SMI_CODE_IN_STUB; | |
721 } | 725 } |
722 bool IsOperationCommutative() { | 726 bool IsOperationCommutative() { |
723 return (op_ == Token::ADD) || (op_ == Token::MUL); | 727 return (op_ == Token::ADD) || (op_ == Token::MUL); |
724 } | 728 } |
725 | 729 |
726 void SetArgsInRegisters() { args_in_registers_ = true; } | 730 void SetArgsInRegisters() { args_in_registers_ = true; } |
727 void SetArgsReversed() { args_reversed_ = true; } | 731 void SetArgsReversed() { args_reversed_ = true; } |
728 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 732 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
729 bool HasArgumentsInRegisters() { return args_in_registers_; } | 733 bool HasArgsInRegisters() { return args_in_registers_; } |
730 bool HasArgumentsReversed() { return args_reversed_; } | 734 bool HasArgsReversed() { return args_reversed_; } |
731 }; | 735 }; |
732 | 736 |
733 | 737 |
734 class StringStubBase: public CodeStub { | 738 class StringStubBase: public CodeStub { |
735 public: | 739 public: |
736 // Generate code for copying characters using a simple loop. This should only | 740 // Generate code for copying characters using a simple loop. This should only |
737 // be used in places where the number of characters is small and the | 741 // be used in places where the number of characters is small and the |
738 // additional setup and checking in GenerateCopyCharactersREP adds too much | 742 // additional setup and checking in GenerateCopyCharactersREP adds too much |
739 // overhead. Copying of overlapping regions is not supported. | 743 // overhead. Copying of overlapping regions is not supported. |
740 void GenerateCopyCharacters(MacroAssembler* masm, | 744 void GenerateCopyCharacters(MacroAssembler* masm, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 Major MajorKey() { return StringCompare; } | 812 Major MajorKey() { return StringCompare; } |
809 int MinorKey() { return 0; } | 813 int MinorKey() { return 0; } |
810 | 814 |
811 void Generate(MacroAssembler* masm); | 815 void Generate(MacroAssembler* masm); |
812 }; | 816 }; |
813 | 817 |
814 | 818 |
815 } } // namespace v8::internal | 819 } } // namespace v8::internal |
816 | 820 |
817 #endif // V8_X64_CODEGEN_X64_H_ | 821 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |