OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 break; | 417 break; |
418 case UnaryOpIC::GENERIC: | 418 case UnaryOpIC::GENERIC: |
419 GenerateGenericStub(masm); | 419 GenerateGenericStub(masm); |
420 break; | 420 break; |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 | 424 |
425 void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { | 425 void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
426 __ pop(rcx); // Save return address. | 426 __ pop(rcx); // Save return address. |
427 __ push(rax); | 427 |
428 // Left and right arguments are now on top. | 428 __ push(rax); // the operand |
429 // Push this stub's key. Although the operation and the type info are | |
430 // encoded into the key, the encoding is opaque, so push them too. | |
431 __ Push(Smi::FromInt(MinorKey())); | |
432 __ Push(Smi::FromInt(op_)); | 429 __ Push(Smi::FromInt(op_)); |
| 430 __ Push(Smi::FromInt(mode_)); |
433 __ Push(Smi::FromInt(operand_type_)); | 431 __ Push(Smi::FromInt(operand_type_)); |
434 | 432 |
435 __ push(rcx); // Push return address. | 433 __ push(rcx); // Push return address. |
436 | 434 |
437 // Patch the caller to an appropriate specialized stub and return the | 435 // Patch the caller to an appropriate specialized stub and return the |
438 // operation result to the caller of the stub. | 436 // operation result to the caller of the stub. |
439 __ TailCallExternalReference( | 437 __ TailCallExternalReference( |
440 ExternalReference(IC_Utility(IC::kUnaryOp_Patch), | 438 ExternalReference(IC_Utility(IC::kUnaryOp_Patch), masm->isolate()), 4, 1); |
441 masm->isolate()), | |
442 4, | |
443 1); | |
444 } | 439 } |
445 | 440 |
446 | 441 |
447 // TODO(svenpanne): Use virtual functions instead of switch. | 442 // TODO(svenpanne): Use virtual functions instead of switch. |
448 void UnaryOpStub::GenerateSmiStub(MacroAssembler* masm) { | 443 void UnaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
449 switch (op_) { | 444 switch (op_) { |
450 case Token::SUB: | 445 case Token::SUB: |
451 GenerateSmiStubSub(masm); | 446 GenerateSmiStubSub(masm); |
452 break; | 447 break; |
453 case Token::BIT_NOT: | 448 case Token::BIT_NOT: |
(...skipping 4885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5339 __ Drop(1); | 5334 __ Drop(1); |
5340 __ ret(2 * kPointerSize); | 5335 __ ret(2 * kPointerSize); |
5341 } | 5336 } |
5342 | 5337 |
5343 | 5338 |
5344 #undef __ | 5339 #undef __ |
5345 | 5340 |
5346 } } // namespace v8::internal | 5341 } } // namespace v8::internal |
5347 | 5342 |
5348 #endif // V8_TARGET_ARCH_X64 | 5343 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |