| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 645 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 646 } | 646 } |
| 647 | 647 |
| 648 // Generate code to call the stub with the supplied arguments. This will add | 648 // Generate code to call the stub with the supplied arguments. This will add |
| 649 // code at the call site to prepare arguments either in registers or on the | 649 // code at the call site to prepare arguments either in registers or on the |
| 650 // stack together with the actual call. | 650 // stack together with the actual call. |
| 651 void GenerateCall(MacroAssembler* masm, Register left, Register right); | 651 void GenerateCall(MacroAssembler* masm, Register left, Register right); |
| 652 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); | 652 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); |
| 653 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); | 653 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); |
| 654 | 654 |
| 655 Result GenerateCall(MacroAssembler* masm, |
| 656 VirtualFrame* frame, |
| 657 Result* left, |
| 658 Result* right); |
| 659 |
| 655 private: | 660 private: |
| 656 Token::Value op_; | 661 Token::Value op_; |
| 657 OverwriteMode mode_; | 662 OverwriteMode mode_; |
| 658 GenericBinaryFlags flags_; | 663 GenericBinaryFlags flags_; |
| 659 bool args_in_registers_; // Arguments passed in registers not on the stack. | 664 bool args_in_registers_; // Arguments passed in registers not on the stack. |
| 660 bool args_reversed_; // Left and right argument are swapped. | 665 bool args_reversed_; // Left and right argument are swapped. |
| 661 bool use_sse3_; | 666 bool use_sse3_; |
| 662 char* name_; | 667 char* name_; |
| 663 | 668 |
| 664 const char* GetName(); | 669 const char* GetName(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 693 | ArgsInRegistersBits::encode(args_in_registers_) | 698 | ArgsInRegistersBits::encode(args_in_registers_) |
| 694 | ArgsReversedBits::encode(args_reversed_); | 699 | ArgsReversedBits::encode(args_reversed_); |
| 695 } | 700 } |
| 696 | 701 |
| 697 void Generate(MacroAssembler* masm); | 702 void Generate(MacroAssembler* masm); |
| 698 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 703 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
| 699 void GenerateLoadArguments(MacroAssembler* masm); | 704 void GenerateLoadArguments(MacroAssembler* masm); |
| 700 void GenerateReturn(MacroAssembler* masm); | 705 void GenerateReturn(MacroAssembler* masm); |
| 701 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); | 706 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); |
| 702 | 707 |
| 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 | |
| 705 // we need to push args on stack anyway. | |
| 706 bool ArgsInRegistersSupported() { | 708 bool ArgsInRegistersSupported() { |
| 707 if (op_ == Token::ADD || op_ == Token::SUB) return true; | 709 return op_ == Token::ADD || op_ == Token::SUB |
| 708 if (op_ == Token::MUL || op_ == Token::DIV) { | 710 || op_ == Token::MUL || op_ == Token::DIV; |
| 709 return flags_ == NO_SMI_CODE_IN_STUB; | |
| 710 } | |
| 711 return false; | |
| 712 } | 711 } |
| 713 bool IsOperationCommutative() { | 712 bool IsOperationCommutative() { |
| 714 return (op_ == Token::ADD) || (op_ == Token::MUL); | 713 return (op_ == Token::ADD) || (op_ == Token::MUL); |
| 715 } | 714 } |
| 716 | 715 |
| 717 void SetArgsInRegisters() { args_in_registers_ = true; } | 716 void SetArgsInRegisters() { args_in_registers_ = true; } |
| 718 void SetArgsReversed() { args_reversed_ = true; } | 717 void SetArgsReversed() { args_reversed_ = true; } |
| 719 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 718 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
| 720 bool HasArgsInRegisters() { return args_in_registers_; } | 719 bool HasArgsInRegisters() { return args_in_registers_; } |
| 721 bool HasArgsReversed() { return args_reversed_; } | 720 bool HasArgsReversed() { return args_reversed_; } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 Major MajorKey() { return StringCompare; } | 800 Major MajorKey() { return StringCompare; } |
| 802 int MinorKey() { return 0; } | 801 int MinorKey() { return 0; } |
| 803 | 802 |
| 804 void Generate(MacroAssembler* masm); | 803 void Generate(MacroAssembler* masm); |
| 805 }; | 804 }; |
| 806 | 805 |
| 807 | 806 |
| 808 } } // namespace v8::internal | 807 } } // namespace v8::internal |
| 809 | 808 |
| 810 #endif // V8_IA32_CODEGEN_IA32_H_ | 809 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |