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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 int key, | 243 int key, |
244 TRBinaryOpIC::TypeInfo operands_type, | 244 TRBinaryOpIC::TypeInfo operands_type, |
245 TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED) | 245 TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED) |
246 : op_(OpBits::decode(key)), | 246 : op_(OpBits::decode(key)), |
247 mode_(ModeBits::decode(key)), | 247 mode_(ModeBits::decode(key)), |
248 use_sse3_(SSE3Bits::decode(key)), | 248 use_sse3_(SSE3Bits::decode(key)), |
249 operands_type_(operands_type), | 249 operands_type_(operands_type), |
250 result_type_(result_type), | 250 result_type_(result_type), |
251 name_(NULL) { } | 251 name_(NULL) { } |
252 | 252 |
253 // Generate code to call the stub with the supplied arguments. This will add | |
254 // code at the call site to prepare arguments either in registers or on the | |
255 // stack together with the actual call. | |
256 void GenerateCall(MacroAssembler* masm, Register left, Register right); | |
257 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); | |
258 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); | |
259 | |
260 private: | 253 private: |
261 enum SmiCodeGenerateHeapNumberResults { | 254 enum SmiCodeGenerateHeapNumberResults { |
262 ALLOW_HEAPNUMBER_RESULTS, | 255 ALLOW_HEAPNUMBER_RESULTS, |
263 NO_HEAPNUMBER_RESULTS | 256 NO_HEAPNUMBER_RESULTS |
264 }; | 257 }; |
265 | 258 |
266 Token::Value op_; | 259 Token::Value op_; |
267 OverwriteMode mode_; | 260 OverwriteMode mode_; |
268 bool use_sse3_; | 261 bool use_sse3_; |
269 | 262 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 void GenerateInt32Stub(MacroAssembler* masm); | 307 void GenerateInt32Stub(MacroAssembler* masm); |
315 void GenerateHeapNumberStub(MacroAssembler* masm); | 308 void GenerateHeapNumberStub(MacroAssembler* masm); |
316 void GenerateStringStub(MacroAssembler* masm); | 309 void GenerateStringStub(MacroAssembler* masm); |
317 void GenerateGenericStub(MacroAssembler* masm); | 310 void GenerateGenericStub(MacroAssembler* masm); |
318 | 311 |
319 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); | 312 void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure); |
320 void GenerateRegisterArgsPush(MacroAssembler* masm); | 313 void GenerateRegisterArgsPush(MacroAssembler* masm); |
321 void GenerateTypeTransition(MacroAssembler* masm); | 314 void GenerateTypeTransition(MacroAssembler* masm); |
322 void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm); | 315 void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm); |
323 | 316 |
324 bool IsOperationCommutative() { | |
325 return (op_ == Token::ADD) || (op_ == Token::MUL); | |
326 } | |
327 | |
328 virtual int GetCodeKind() { return Code::TYPE_RECORDING_BINARY_OP_IC; } | 317 virtual int GetCodeKind() { return Code::TYPE_RECORDING_BINARY_OP_IC; } |
329 | 318 |
330 virtual InlineCacheState GetICState() { | 319 virtual InlineCacheState GetICState() { |
331 return TRBinaryOpIC::ToState(operands_type_); | 320 return TRBinaryOpIC::ToState(operands_type_); |
332 } | 321 } |
333 | 322 |
334 virtual void FinishCode(Code* code) { | 323 virtual void FinishCode(Code* code) { |
335 code->set_type_recording_binary_op_type(operands_type_); | 324 code->set_type_recording_binary_op_type(operands_type_); |
336 code->set_type_recording_binary_op_result_type(result_type_); | 325 code->set_type_recording_binary_op_result_type(result_type_); |
337 } | 326 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void Print() { | 485 void Print() { |
497 PrintF("NumberToStringStub\n"); | 486 PrintF("NumberToStringStub\n"); |
498 } | 487 } |
499 #endif | 488 #endif |
500 }; | 489 }; |
501 | 490 |
502 | 491 |
503 } } // namespace v8::internal | 492 } } // namespace v8::internal |
504 | 493 |
505 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 494 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
OLD | NEW |