| OLD | NEW |
| 1 // Copyright 2006-2009 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } else { | 217 } else { |
| 218 stm(db_w, sp, src1.bit() | src2.bit(), cond); | 218 stm(db_w, sp, src1.bit() | src2.bit(), cond); |
| 219 Push(src3, src4, cond); | 219 Push(src3, src4, cond); |
| 220 } | 220 } |
| 221 } else { | 221 } else { |
| 222 str(src1, MemOperand(sp, 4, NegPreIndex), cond); | 222 str(src1, MemOperand(sp, 4, NegPreIndex), cond); |
| 223 Push(src2, src3, src4, cond); | 223 Push(src2, src3, src4, cond); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Push and pop the registers that can hold pointers, as defined by the |
| 228 // RegList constant kSafepointSavedRegisters. |
| 229 void PushSafepointRegisters(); |
| 230 void PopSafepointRegisters(); |
| 231 static int SafepointRegisterStackIndex(int reg_code); |
| 232 |
| 227 // Load two consecutive registers with two consecutive memory locations. | 233 // Load two consecutive registers with two consecutive memory locations. |
| 228 void Ldrd(Register dst1, | 234 void Ldrd(Register dst1, |
| 229 Register dst2, | 235 Register dst2, |
| 230 const MemOperand& src, | 236 const MemOperand& src, |
| 231 Condition cond = al); | 237 Condition cond = al); |
| 232 | 238 |
| 233 // Store two consecutive registers to two consecutive memory locations. | 239 // Store two consecutive registers to two consecutive memory locations. |
| 234 void Strd(Register src1, | 240 void Strd(Register src1, |
| 235 Register src2, | 241 Register src2, |
| 236 const MemOperand& dst, | 242 const MemOperand& dst, |
| 237 Condition cond = al); | 243 Condition cond = al); |
| 238 | 244 |
| 239 // --------------------------------------------------------------------------- | 245 // --------------------------------------------------------------------------- |
| 240 // Stack limit support | |
| 241 | |
| 242 void StackLimitCheck(Label* on_stack_limit_hit); | |
| 243 | |
| 244 // --------------------------------------------------------------------------- | |
| 245 // Activation frames | 246 // Activation frames |
| 246 | 247 |
| 247 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } | 248 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } |
| 248 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } | 249 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } |
| 249 | 250 |
| 250 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } | 251 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } |
| 251 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } | 252 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } |
| 252 | 253 |
| 253 // Enter exit frame. | 254 // Enter exit frame. |
| 254 // Expects the number of arguments in register r0 and | 255 // Expects the number of arguments in register r0 and |
| 255 // the builtin function to call in register r1. Exits with argc in | 256 // the builtin function to call in register r1. Exits with argc in |
| 256 // r4, argv in r6, and and the builtin function to call in r5. | 257 // r4, argv in r6, and and the builtin function to call in r5. |
| 257 void EnterExitFrame(); | 258 void EnterExitFrame(bool save_doubles); |
| 258 | 259 |
| 259 // Leave the current exit frame. Expects the return value in r0. | 260 // Leave the current exit frame. Expects the return value in r0. |
| 260 void LeaveExitFrame(); | 261 void LeaveExitFrame(bool save_doubles); |
| 261 | 262 |
| 262 // Get the actual activation frame alignment for target environment. | 263 // Get the actual activation frame alignment for target environment. |
| 263 static int ActivationFrameAlignment(); | 264 static int ActivationFrameAlignment(); |
| 264 | 265 |
| 265 void LoadContext(Register dst, int context_chain_length); | 266 void LoadContext(Register dst, int context_chain_length); |
| 266 | 267 |
| 267 void LoadGlobalFunction(int index, Register function); | 268 void LoadGlobalFunction(int index, Register function); |
| 268 | 269 |
| 269 // Load the initial map from the global function. The registers | 270 // Load the initial map from the global function. The registers |
| 270 // function and map can be the same, function is then overwritten. | 271 // function and map can be the same, function is then overwritten. |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 // Runtime calls | 569 // Runtime calls |
| 569 | 570 |
| 570 // Call a code stub. | 571 // Call a code stub. |
| 571 void CallStub(CodeStub* stub, Condition cond = al); | 572 void CallStub(CodeStub* stub, Condition cond = al); |
| 572 | 573 |
| 573 // Call a code stub. | 574 // Call a code stub. |
| 574 void TailCallStub(CodeStub* stub, Condition cond = al); | 575 void TailCallStub(CodeStub* stub, Condition cond = al); |
| 575 | 576 |
| 576 // Call a runtime routine. | 577 // Call a runtime routine. |
| 577 void CallRuntime(const Runtime::Function* f, int num_arguments); | 578 void CallRuntime(const Runtime::Function* f, int num_arguments); |
| 579 void CallRuntimeSaveDoubles(Runtime::FunctionId id); |
| 578 | 580 |
| 579 // Convenience function: Same as above, but takes the fid instead. | 581 // Convenience function: Same as above, but takes the fid instead. |
| 580 void CallRuntime(Runtime::FunctionId fid, int num_arguments); | 582 void CallRuntime(Runtime::FunctionId fid, int num_arguments); |
| 581 | 583 |
| 582 // Convenience function: call an external reference. | 584 // Convenience function: call an external reference. |
| 583 void CallExternalReference(const ExternalReference& ext, | 585 void CallExternalReference(const ExternalReference& ext, |
| 584 int num_arguments); | 586 int num_arguments); |
| 585 | 587 |
| 586 // Tail call of a runtime routine (jump). | 588 // Tail call of a runtime routine (jump). |
| 587 // Like JumpToExternalReference, but also takes care of passing the number | 589 // Like JumpToExternalReference, but also takes care of passing the number |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 660 |
| 659 // Verify restrictions about code generated in stubs. | 661 // Verify restrictions about code generated in stubs. |
| 660 void set_generating_stub(bool value) { generating_stub_ = value; } | 662 void set_generating_stub(bool value) { generating_stub_ = value; } |
| 661 bool generating_stub() { return generating_stub_; } | 663 bool generating_stub() { return generating_stub_; } |
| 662 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | 664 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } |
| 663 bool allow_stub_calls() { return allow_stub_calls_; } | 665 bool allow_stub_calls() { return allow_stub_calls_; } |
| 664 | 666 |
| 665 // --------------------------------------------------------------------------- | 667 // --------------------------------------------------------------------------- |
| 666 // Smi utilities | 668 // Smi utilities |
| 667 | 669 |
| 670 void SmiTag(Register reg, SBit s = LeaveCC) { |
| 671 add(reg, reg, Operand(reg), s); |
| 672 } |
| 673 |
| 674 void SmiUntag(Register reg) { |
| 675 mov(reg, Operand(reg, ASR, kSmiTagSize)); |
| 676 } |
| 677 |
| 668 // Jump if either of the registers contain a non-smi. | 678 // Jump if either of the registers contain a non-smi. |
| 669 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); | 679 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); |
| 670 // Jump if either of the registers contain a smi. | 680 // Jump if either of the registers contain a smi. |
| 671 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); | 681 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); |
| 672 | 682 |
| 673 // Abort execution if argument is a smi. Used in debug code. | 683 // Abort execution if argument is a smi. Used in debug code. |
| 674 void AbortIfSmi(Register object); | 684 void AbortIfSmi(Register object); |
| 675 | 685 |
| 676 // --------------------------------------------------------------------------- | 686 // --------------------------------------------------------------------------- |
| 677 // String utilities | 687 // String utilities |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 774 |
| 765 private: | 775 private: |
| 766 byte* address_; // The address of the code being patched. | 776 byte* address_; // The address of the code being patched. |
| 767 int instructions_; // Number of instructions of the expected patch size. | 777 int instructions_; // Number of instructions of the expected patch size. |
| 768 int size_; // Number of bytes of the expected patch size. | 778 int size_; // Number of bytes of the expected patch size. |
| 769 MacroAssembler masm_; // Macro assembler used to generate the code. | 779 MacroAssembler masm_; // Macro assembler used to generate the code. |
| 770 }; | 780 }; |
| 771 #endif // ENABLE_DEBUGGER_SUPPORT | 781 #endif // ENABLE_DEBUGGER_SUPPORT |
| 772 | 782 |
| 773 | 783 |
| 784 // Helper class for generating code or data associated with the code |
| 785 // right after a call instruction. As an example this can be used to |
| 786 // generate safepoint data after calls for crankshaft. |
| 787 class PostCallGenerator { |
| 788 public: |
| 789 PostCallGenerator() { } |
| 790 virtual ~PostCallGenerator() { } |
| 791 virtual void Generate() = 0; |
| 792 }; |
| 793 |
| 794 |
| 774 // ----------------------------------------------------------------------------- | 795 // ----------------------------------------------------------------------------- |
| 775 // Static helper functions. | 796 // Static helper functions. |
| 776 | 797 |
| 777 static MemOperand ContextOperand(Register context, int index) { | 798 static MemOperand ContextOperand(Register context, int index) { |
| 778 return MemOperand(context, Context::SlotOffset(index)); | 799 return MemOperand(context, Context::SlotOffset(index)); |
| 779 } | 800 } |
| 780 | 801 |
| 781 | 802 |
| 782 static inline MemOperand GlobalObjectOperand() { | 803 static inline MemOperand GlobalObjectOperand() { |
| 783 return ContextOperand(cp, Context::GLOBAL_INDEX); | 804 return ContextOperand(cp, Context::GLOBAL_INDEX); |
| 784 } | 805 } |
| 785 | 806 |
| 786 | 807 |
| 787 #ifdef GENERATED_CODE_COVERAGE | 808 #ifdef GENERATED_CODE_COVERAGE |
| 788 #define CODE_COVERAGE_STRINGIFY(x) #x | 809 #define CODE_COVERAGE_STRINGIFY(x) #x |
| 789 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 810 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 790 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 811 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 791 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 812 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 792 #else | 813 #else |
| 793 #define ACCESS_MASM(masm) masm-> | 814 #define ACCESS_MASM(masm) masm-> |
| 794 #endif | 815 #endif |
| 795 | 816 |
| 796 | 817 |
| 797 } } // namespace v8::internal | 818 } } // namespace v8::internal |
| 798 | 819 |
| 799 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 820 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |