OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 void Generate(MacroAssembler* masm); | 697 void Generate(MacroAssembler* masm); |
698 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 698 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
699 void GenerateLoadArguments(MacroAssembler* masm); | 699 void GenerateLoadArguments(MacroAssembler* masm); |
700 void GenerateReturn(MacroAssembler* masm); | 700 void GenerateReturn(MacroAssembler* masm); |
701 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); | 701 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); |
702 | 702 |
703 // Args in registers are always OK for ADD and SUB. Floating-point MUL and DIV | 703 // Args in registers are always OK for ADD and SUB. Floating-point MUL and DIV |
704 // are also OK. Though MUL and DIV on SMIs modify the original registers so | 704 // are also OK. Though MUL and DIV on SMIs modify the original registers so |
705 // we need to push args on stack anyway. | 705 // we need to push args on stack anyway. |
706 bool ArgsInRegistersSupported() { | 706 bool ArgsInRegistersSupported() { |
707 return ((op_ == Token::ADD) || (op_ == Token::SUB)) || | 707 if (op_ == Token::ADD || op_ == Token::SUB) return true; |
708 (((op_ == Token::MUL) || (op_ == Token::DIV)) | 708 if (op_ == Token::MUL || op_ == Token::DIV) { |
709 && (flags_ == NO_SMI_CODE_IN_STUB)); | 709 return flags_ == NO_SMI_CODE_IN_STUB; |
| 710 } |
| 711 return false; |
710 } | 712 } |
711 bool IsOperationCommutative() { | 713 bool IsOperationCommutative() { |
712 return (op_ == Token::ADD) || (op_ == Token::MUL); | 714 return (op_ == Token::ADD) || (op_ == Token::MUL); |
713 } | 715 } |
714 | 716 |
715 void SetArgsInRegisters() { args_in_registers_ = true; } | 717 void SetArgsInRegisters() { args_in_registers_ = true; } |
716 void SetArgsReversed() { args_reversed_ = true; } | 718 void SetArgsReversed() { args_reversed_ = true; } |
717 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 719 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
718 bool HasArgumentsInRegisters() { return args_in_registers_; } | 720 bool HasArgsInRegisters() { return args_in_registers_; } |
719 bool HasArgumentsReversed() { return args_reversed_; } | 721 bool HasArgsReversed() { return args_reversed_; } |
720 }; | 722 }; |
721 | 723 |
722 | 724 |
723 // Flag that indicates how to generate code for the stub StringAddStub. | 725 // Flag that indicates how to generate code for the stub StringAddStub. |
724 enum StringAddFlags { | 726 enum StringAddFlags { |
725 NO_STRING_ADD_FLAGS = 0, | 727 NO_STRING_ADD_FLAGS = 0, |
726 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. | 728 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
727 }; | 729 }; |
728 | 730 |
729 | 731 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 Major MajorKey() { return StringCompare; } | 801 Major MajorKey() { return StringCompare; } |
800 int MinorKey() { return 0; } | 802 int MinorKey() { return 0; } |
801 | 803 |
802 void Generate(MacroAssembler* masm); | 804 void Generate(MacroAssembler* masm); |
803 }; | 805 }; |
804 | 806 |
805 | 807 |
806 } } // namespace v8::internal | 808 } } // namespace v8::internal |
807 | 809 |
808 #endif // V8_IA32_CODEGEN_IA32_H_ | 810 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |