| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 addiu(sp, sp, 4 * NumSaved); | 416 addiu(sp, sp, 4 * NumSaved); |
| 417 } | 417 } |
| 418 | 418 |
| 419 | 419 |
| 420 // Emulated condtional branches do not emit a nop in the branch delay slot. | 420 // Emulated condtional branches do not emit a nop in the branch delay slot. |
| 421 | 421 |
| 422 // Trashes the at register if no scratch register is provided. | 422 // Trashes the at register if no scratch register is provided. |
| 423 void MacroAssembler::Branch(Condition cond, int16_t offset, Register rs, | 423 void MacroAssembler::Branch(Condition cond, int16_t offset, Register rs, |
| 424 const Operand& rt, Register scratch) { | 424 const Operand& rt, Register scratch) { |
| 425 Register r2; | 425 Register r2 = no_reg; |
| 426 if (rt.is_reg()) { | 426 if (rt.is_reg()) { |
| 427 // We don't want any other register but scratch clobbered. | 427 // We don't want any other register but scratch clobbered. |
| 428 ASSERT(!scratch.is(rs) && !scratch.is(rt.rm_)); | 428 ASSERT(!scratch.is(rs) && !scratch.is(rt.rm_)); |
| 429 r2 = rt.rm_; | 429 r2 = rt.rm_; |
| 430 } else if (cond != cc_always) { | 430 } else if (cond != cc_always) { |
| 431 // We don't want any other register but scratch clobbered. | 431 // We don't want any other register but scratch clobbered. |
| 432 ASSERT(!scratch.is(rs)); | 432 ASSERT(!scratch.is(rs)); |
| 433 r2 = scratch; | 433 r2 = scratch; |
| 434 li(r2, rt); | 434 li(r2, rt); |
| 435 } | 435 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 break; | 482 break; |
| 483 | 483 |
| 484 default: | 484 default: |
| 485 UNREACHABLE(); | 485 UNREACHABLE(); |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 | 488 |
| 489 | 489 |
| 490 void MacroAssembler::Branch(Condition cond, Label* L, Register rs, | 490 void MacroAssembler::Branch(Condition cond, Label* L, Register rs, |
| 491 const Operand& rt, Register scratch) { | 491 const Operand& rt, Register scratch) { |
| 492 Register r2; | 492 Register r2 = no_reg; |
| 493 if (rt.is_reg()) { | 493 if (rt.is_reg()) { |
| 494 r2 = rt.rm_; | 494 r2 = rt.rm_; |
| 495 } else if (cond != cc_always) { | 495 } else if (cond != cc_always) { |
| 496 r2 = scratch; | 496 r2 = scratch; |
| 497 li(r2, rt); | 497 li(r2, rt); |
| 498 } | 498 } |
| 499 | 499 |
| 500 // We use branch_offset as an argument for the branch instructions to be sure | 500 // We use branch_offset as an argument for the branch instructions to be sure |
| 501 // it is called just before generating the branch instruction, as needed. | 501 // it is called just before generating the branch instruction, as needed. |
| 502 | 502 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 | 554 |
| 555 | 555 |
| 556 // Trashes the at register if no scratch register is provided. | 556 // Trashes the at register if no scratch register is provided. |
| 557 // We need to use a bgezal or bltzal, but they can't be used directly with the | 557 // We need to use a bgezal or bltzal, but they can't be used directly with the |
| 558 // slt instructions. We could use sub or add instead but we would miss overflow | 558 // slt instructions. We could use sub or add instead but we would miss overflow |
| 559 // cases, so we keep slt and add an intermediate third instruction. | 559 // cases, so we keep slt and add an intermediate third instruction. |
| 560 void MacroAssembler::BranchAndLink(Condition cond, int16_t offset, Register rs, | 560 void MacroAssembler::BranchAndLink(Condition cond, int16_t offset, Register rs, |
| 561 const Operand& rt, Register scratch) { | 561 const Operand& rt, Register scratch) { |
| 562 Register r2; | 562 Register r2 = no_reg; |
| 563 if (rt.is_reg()) { | 563 if (rt.is_reg()) { |
| 564 r2 = rt.rm_; | 564 r2 = rt.rm_; |
| 565 } else if (cond != cc_always) { | 565 } else if (cond != cc_always) { |
| 566 r2 = scratch; | 566 r2 = scratch; |
| 567 li(r2, rt); | 567 li(r2, rt); |
| 568 } | 568 } |
| 569 | 569 |
| 570 switch (cond) { | 570 switch (cond) { |
| 571 case cc_always: | 571 case cc_always: |
| 572 bal(offset); | 572 bal(offset); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 break; | 627 break; |
| 628 | 628 |
| 629 default: | 629 default: |
| 630 UNREACHABLE(); | 630 UNREACHABLE(); |
| 631 } | 631 } |
| 632 } | 632 } |
| 633 | 633 |
| 634 | 634 |
| 635 void MacroAssembler::BranchAndLink(Condition cond, Label* L, Register rs, | 635 void MacroAssembler::BranchAndLink(Condition cond, Label* L, Register rs, |
| 636 const Operand& rt, Register scratch) { | 636 const Operand& rt, Register scratch) { |
| 637 Register r2; | 637 Register r2 = no_reg; |
| 638 if (rt.is_reg()) { | 638 if (rt.is_reg()) { |
| 639 r2 = rt.rm_; | 639 r2 = rt.rm_; |
| 640 } else if (cond != cc_always) { | 640 } else if (cond != cc_always) { |
| 641 r2 = scratch; | 641 r2 = scratch; |
| 642 li(r2, rt); | 642 li(r2, rt); |
| 643 } | 643 } |
| 644 | 644 |
| 645 switch (cond) { | 645 switch (cond) { |
| 646 case cc_always: | 646 case cc_always: |
| 647 bal(shifted_branch_offset(L, false)); | 647 bal(shifted_branch_offset(L, false)); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 void MacroAssembler::Drop(int count, Condition cond) { | 780 void MacroAssembler::Drop(int count, Condition cond) { |
| 781 UNIMPLEMENTED_MIPS(); | 781 UNIMPLEMENTED_MIPS(); |
| 782 } | 782 } |
| 783 | 783 |
| 784 | 784 |
| 785 void MacroAssembler::Call(Label* target) { | 785 void MacroAssembler::Call(Label* target) { |
| 786 UNIMPLEMENTED_MIPS(); | 786 UNIMPLEMENTED_MIPS(); |
| 787 } | 787 } |
| 788 | 788 |
| 789 | 789 |
| 790 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 791 // --------------------------------------------------------------------------- |
| 792 // Debugger Support |
| 793 |
| 794 void MacroAssembler::DebugBreak() { |
| 795 UNIMPLEMENTED_MIPS(); |
| 796 } |
| 797 #endif |
| 798 |
| 799 |
| 790 // --------------------------------------------------------------------------- | 800 // --------------------------------------------------------------------------- |
| 791 // Exception handling | 801 // Exception handling |
| 792 | 802 |
| 793 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 803 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
| 794 HandlerType type) { | 804 HandlerType type) { |
| 795 UNIMPLEMENTED_MIPS(); | 805 UNIMPLEMENTED_MIPS(); |
| 796 } | 806 } |
| 797 | 807 |
| 798 | 808 |
| 799 void MacroAssembler::PopTryHandler() { | 809 void MacroAssembler::PopTryHandler() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 819 void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) { | 829 void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) { |
| 820 UNIMPLEMENTED_MIPS(); | 830 UNIMPLEMENTED_MIPS(); |
| 821 } | 831 } |
| 822 | 832 |
| 823 | 833 |
| 824 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | 834 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { |
| 825 UNIMPLEMENTED_MIPS(); | 835 UNIMPLEMENTED_MIPS(); |
| 826 } | 836 } |
| 827 | 837 |
| 828 | 838 |
| 829 void MacroAssembler::TailCallRuntime(const ExternalReference& ext, | 839 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, |
| 830 int num_arguments, | 840 int num_arguments, |
| 831 int result_size) { | 841 int result_size) { |
| 832 UNIMPLEMENTED_MIPS(); | 842 UNIMPLEMENTED_MIPS(); |
| 833 } | 843 } |
| 834 | 844 |
| 835 | 845 |
| 836 void MacroAssembler::JumpToRuntime(const ExternalReference& builtin) { | 846 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, |
| 847 int num_arguments, |
| 848 int result_size) { |
| 849 TailCallExternalReference(ExternalReference(fid), num_arguments, result_size); |
| 850 } |
| 851 |
| 852 |
| 853 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { |
| 837 UNIMPLEMENTED_MIPS(); | 854 UNIMPLEMENTED_MIPS(); |
| 838 } | 855 } |
| 839 | 856 |
| 840 | 857 |
| 841 Handle<Code> MacroAssembler::ResolveBuiltin(Builtins::JavaScript id, | 858 Handle<Code> MacroAssembler::ResolveBuiltin(Builtins::JavaScript id, |
| 842 bool* resolved) { | 859 bool* resolved) { |
| 843 UNIMPLEMENTED_MIPS(); | 860 UNIMPLEMENTED_MIPS(); |
| 844 return Handle<Code>(reinterpret_cast<Code*>(NULL)); // UNIMPLEMENTED RETURN | 861 return Handle<Code>(reinterpret_cast<Code*>(NULL)); // UNIMPLEMENTED RETURN |
| 845 } | 862 } |
| 846 | 863 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 UNIMPLEMENTED_MIPS(); | 903 UNIMPLEMENTED_MIPS(); |
| 887 } | 904 } |
| 888 | 905 |
| 889 | 906 |
| 890 void MacroAssembler::Abort(const char* msg) { | 907 void MacroAssembler::Abort(const char* msg) { |
| 891 UNIMPLEMENTED_MIPS(); | 908 UNIMPLEMENTED_MIPS(); |
| 892 } | 909 } |
| 893 | 910 |
| 894 } } // namespace v8::internal | 911 } } // namespace v8::internal |
| 895 | 912 |
| OLD | NEW |