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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // As the then-branch, but move double-value to result before shifting. | 399 // As the then-branch, but move double-value to result before shifting. |
400 __ xorl(result, double_value); | 400 __ xorl(result, double_value); |
401 __ leal(rcx, Operand(double_exponent, -HeapNumber::kMantissaBits - 1)); | 401 __ leal(rcx, Operand(double_exponent, -HeapNumber::kMantissaBits - 1)); |
402 __ shll_cl(result); | 402 __ shll_cl(result); |
403 } | 403 } |
404 | 404 |
405 __ bind(&done); | 405 __ bind(&done); |
406 } | 406 } |
407 | 407 |
408 | 408 |
409 Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) { | |
410 UnaryOpStub stub(key, type_info); | |
411 return stub.GetCode(); | |
412 } | |
413 | |
414 | |
415 void UnaryOpStub::Generate(MacroAssembler* masm) { | 409 void UnaryOpStub::Generate(MacroAssembler* masm) { |
416 switch (operand_type_) { | 410 switch (operand_type_) { |
417 case UnaryOpIC::UNINITIALIZED: | 411 case UnaryOpIC::UNINITIALIZED: |
418 GenerateTypeTransition(masm); | 412 GenerateTypeTransition(masm); |
419 break; | 413 break; |
420 case UnaryOpIC::SMI: | 414 case UnaryOpIC::SMI: |
421 GenerateSmiStub(masm); | 415 GenerateSmiStub(masm); |
422 break; | 416 break; |
423 case UnaryOpIC::HEAP_NUMBER: | 417 case UnaryOpIC::HEAP_NUMBER: |
424 GenerateHeapNumberStub(masm); | 418 GenerateHeapNumberStub(masm); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 664 |
671 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), | 665 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
672 "UnaryOpStub_%s_%s_%s", | 666 "UnaryOpStub_%s_%s_%s", |
673 op_name, | 667 op_name, |
674 overwrite_name, | 668 overwrite_name, |
675 UnaryOpIC::GetName(operand_type_)); | 669 UnaryOpIC::GetName(operand_type_)); |
676 return name_; | 670 return name_; |
677 } | 671 } |
678 | 672 |
679 | 673 |
680 Handle<Code> GetBinaryOpStub(int key, | |
681 BinaryOpIC::TypeInfo type_info, | |
682 BinaryOpIC::TypeInfo result_type_info) { | |
683 BinaryOpStub stub(key, type_info, result_type_info); | |
684 return stub.GetCode(); | |
685 } | |
686 | |
687 | |
688 void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { | 674 void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
689 __ pop(rcx); // Save return address. | 675 __ pop(rcx); // Save return address. |
690 __ push(rdx); | 676 __ push(rdx); |
691 __ push(rax); | 677 __ push(rax); |
692 // Left and right arguments are now on top. | 678 // Left and right arguments are now on top. |
693 // Push this stub's key. Although the operation and the type info are | 679 // Push this stub's key. Although the operation and the type info are |
694 // encoded into the key, the encoding is opaque, so push them too. | 680 // encoded into the key, the encoding is opaque, so push them too. |
695 __ Push(Smi::FromInt(MinorKey())); | 681 __ Push(Smi::FromInt(MinorKey())); |
696 __ Push(Smi::FromInt(op_)); | 682 __ Push(Smi::FromInt(op_)); |
697 __ Push(Smi::FromInt(operands_type_)); | 683 __ Push(Smi::FromInt(operands_type_)); |
(...skipping 4429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5127 __ Drop(1); | 5113 __ Drop(1); |
5128 __ ret(2 * kPointerSize); | 5114 __ ret(2 * kPointerSize); |
5129 } | 5115 } |
5130 | 5116 |
5131 | 5117 |
5132 #undef __ | 5118 #undef __ |
5133 | 5119 |
5134 } } // namespace v8::internal | 5120 } } // namespace v8::internal |
5135 | 5121 |
5136 #endif // V8_TARGET_ARCH_X64 | 5122 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |