| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // stack together with the actual call. | 105 // stack together with the actual call. |
| 106 void GenerateCall(MacroAssembler* masm, Register left, Register right); | 106 void GenerateCall(MacroAssembler* masm, Register left, Register right); |
| 107 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); | 107 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); |
| 108 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); | 108 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); |
| 109 | 109 |
| 110 Result GenerateCall(MacroAssembler* masm, | 110 Result GenerateCall(MacroAssembler* masm, |
| 111 VirtualFrame* frame, | 111 VirtualFrame* frame, |
| 112 Result* left, | 112 Result* left, |
| 113 Result* right); | 113 Result* right); |
| 114 | 114 |
| 115 bool ArgsInRegistersSupported() { |
| 116 return (op_ == Token::ADD) || (op_ == Token::SUB) |
| 117 || (op_ == Token::MUL) || (op_ == Token::DIV); |
| 118 } |
| 119 |
| 115 private: | 120 private: |
| 116 Token::Value op_; | 121 Token::Value op_; |
| 117 OverwriteMode mode_; | 122 OverwriteMode mode_; |
| 118 GenericBinaryFlags flags_; | 123 GenericBinaryFlags flags_; |
| 119 bool args_in_registers_; // Arguments passed in registers not on the stack. | 124 bool args_in_registers_; // Arguments passed in registers not on the stack. |
| 120 bool args_reversed_; // Left and right argument are swapped. | 125 bool args_reversed_; // Left and right argument are swapped. |
| 121 | 126 |
| 122 // Number type information of operands, determined by code generator. | 127 // Number type information of operands, determined by code generator. |
| 123 TypeInfo static_operands_type_; | 128 TypeInfo static_operands_type_; |
| 124 | 129 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | RuntimeTypeInfoBits::encode(runtime_operands_type_); | 170 | RuntimeTypeInfoBits::encode(runtime_operands_type_); |
| 166 } | 171 } |
| 167 | 172 |
| 168 void Generate(MacroAssembler* masm); | 173 void Generate(MacroAssembler* masm); |
| 169 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 174 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
| 170 void GenerateLoadArguments(MacroAssembler* masm); | 175 void GenerateLoadArguments(MacroAssembler* masm); |
| 171 void GenerateReturn(MacroAssembler* masm); | 176 void GenerateReturn(MacroAssembler* masm); |
| 172 void GenerateRegisterArgsPush(MacroAssembler* masm); | 177 void GenerateRegisterArgsPush(MacroAssembler* masm); |
| 173 void GenerateTypeTransition(MacroAssembler* masm); | 178 void GenerateTypeTransition(MacroAssembler* masm); |
| 174 | 179 |
| 175 bool ArgsInRegistersSupported() { | |
| 176 return (op_ == Token::ADD) || (op_ == Token::SUB) | |
| 177 || (op_ == Token::MUL) || (op_ == Token::DIV); | |
| 178 } | |
| 179 bool IsOperationCommutative() { | 180 bool IsOperationCommutative() { |
| 180 return (op_ == Token::ADD) || (op_ == Token::MUL); | 181 return (op_ == Token::ADD) || (op_ == Token::MUL); |
| 181 } | 182 } |
| 182 | 183 |
| 183 void SetArgsInRegisters() { args_in_registers_ = true; } | 184 void SetArgsInRegisters() { args_in_registers_ = true; } |
| 184 void SetArgsReversed() { args_reversed_ = true; } | 185 void SetArgsReversed() { args_reversed_ = true; } |
| 185 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 186 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
| 186 bool HasArgsInRegisters() { return args_in_registers_; } | 187 bool HasArgsInRegisters() { return args_in_registers_; } |
| 187 bool HasArgsReversed() { return args_reversed_; } | 188 bool HasArgsReversed() { return args_reversed_; } |
| 188 | 189 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 return ObjectBits::encode(object_.code()) | | 384 return ObjectBits::encode(object_.code()) | |
| 384 AddressBits::encode(addr_.code()) | | 385 AddressBits::encode(addr_.code()) | |
| 385 ScratchBits::encode(scratch_.code()); | 386 ScratchBits::encode(scratch_.code()); |
| 386 } | 387 } |
| 387 }; | 388 }; |
| 388 | 389 |
| 389 | 390 |
| 390 } } // namespace v8::internal | 391 } } // namespace v8::internal |
| 391 | 392 |
| 392 #endif // V8_X64_CODE_STUBS_X64_H_ | 393 #endif // V8_X64_CODE_STUBS_X64_H_ |
| OLD | NEW |