OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4509 bind(&ok); | 4509 bind(&ok); |
4510 } | 4510 } |
4511 } | 4511 } |
4512 | 4512 |
4513 | 4513 |
4514 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { | 4514 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
4515 if (frame_mode == BUILD_STUB_FRAME) { | 4515 if (frame_mode == BUILD_STUB_FRAME) { |
4516 Push(ra, fp, cp); | 4516 Push(ra, fp, cp); |
4517 Push(Smi::FromInt(StackFrame::STUB)); | 4517 Push(Smi::FromInt(StackFrame::STUB)); |
4518 // Adjust FP to point to saved FP. | 4518 // Adjust FP to point to saved FP. |
4519 Addu(fp, sp, Operand(2 * kPointerSize)); | 4519 Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
4520 } else { | 4520 } else { |
4521 PredictableCodeSizeScope predictible_code_size_scope( | 4521 PredictableCodeSizeScope predictible_code_size_scope( |
4522 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 4522 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
4523 // The following three instructions must remain together and unmodified | 4523 // The following three instructions must remain together and unmodified |
4524 // for code aging to work properly. | 4524 // for code aging to work properly. |
4525 if (isolate()->IsCodePreAgingActive()) { | 4525 if (isolate()->IsCodePreAgingActive()) { |
4526 // Pre-age the code. | 4526 // Pre-age the code. |
4527 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); | 4527 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
4528 nop(Assembler::CODE_AGE_MARKER_NOP); | 4528 nop(Assembler::CODE_AGE_MARKER_NOP); |
4529 // Save the function's original return address | 4529 // Save the function's original return address |
4530 // (it will be clobbered by Call(t9)). | 4530 // (it will be clobbered by Call(t9)). |
4531 mov(at, ra); | 4531 mov(at, ra); |
4532 // Load the stub address to t9 and call it. | 4532 // Load the stub address to t9 and call it. |
4533 li(t9, | 4533 li(t9, |
4534 Operand(reinterpret_cast<uint32_t>(stub->instruction_start()))); | 4534 Operand(reinterpret_cast<uint32_t>(stub->instruction_start()))); |
4535 Call(t9); | 4535 Call(t9); |
4536 // Record the stub address in the empty space for GetCodeAgeAndParity(). | 4536 // Record the stub address in the empty space for GetCodeAgeAndParity(). |
4537 emit_code_stub_address(stub); | 4537 emit_code_stub_address(stub); |
4538 } else { | 4538 } else { |
4539 Push(ra, fp, cp, a1); | 4539 Push(ra, fp, cp, a1); |
4540 nop(Assembler::CODE_AGE_SEQUENCE_NOP); | 4540 nop(Assembler::CODE_AGE_SEQUENCE_NOP); |
4541 // Adjust fp to point to caller's fp. | 4541 // Adjust fp to point to caller's fp. |
4542 Addu(fp, sp, Operand(2 * kPointerSize)); | 4542 Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
4543 } | 4543 } |
4544 } | 4544 } |
4545 } | 4545 } |
4546 | 4546 |
4547 | 4547 |
4548 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 4548 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
4549 addiu(sp, sp, -5 * kPointerSize); | 4549 addiu(sp, sp, -5 * kPointerSize); |
4550 li(t8, Operand(Smi::FromInt(type))); | 4550 li(t8, Operand(Smi::FromInt(type))); |
4551 li(t9, Operand(CodeObject()), CONSTANT_SIZE); | 4551 li(t9, Operand(CodeObject()), CONSTANT_SIZE); |
4552 sw(ra, MemOperand(sp, 4 * kPointerSize)); | 4552 sw(ra, MemOperand(sp, 4 * kPointerSize)); |
4553 sw(fp, MemOperand(sp, 3 * kPointerSize)); | 4553 sw(fp, MemOperand(sp, 3 * kPointerSize)); |
4554 sw(cp, MemOperand(sp, 2 * kPointerSize)); | 4554 sw(cp, MemOperand(sp, 2 * kPointerSize)); |
4555 sw(t8, MemOperand(sp, 1 * kPointerSize)); | 4555 sw(t8, MemOperand(sp, 1 * kPointerSize)); |
4556 sw(t9, MemOperand(sp, 0 * kPointerSize)); | 4556 sw(t9, MemOperand(sp, 0 * kPointerSize)); |
4557 addiu(fp, sp, 3 * kPointerSize); | 4557 // Adjust FP to point to saved FP. |
| 4558 Addu(fp, sp, |
| 4559 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); |
4558 } | 4560 } |
4559 | 4561 |
4560 | 4562 |
4561 void MacroAssembler::LeaveFrame(StackFrame::Type type) { | 4563 void MacroAssembler::LeaveFrame(StackFrame::Type type) { |
4562 mov(sp, fp); | 4564 mov(sp, fp); |
4563 lw(fp, MemOperand(sp, 0 * kPointerSize)); | 4565 lw(fp, MemOperand(sp, 0 * kPointerSize)); |
4564 lw(ra, MemOperand(sp, 1 * kPointerSize)); | 4566 lw(ra, MemOperand(sp, 1 * kPointerSize)); |
4565 addiu(sp, sp, 2 * kPointerSize); | 4567 addiu(sp, sp, 2 * kPointerSize); |
4566 } | 4568 } |
4567 | 4569 |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5749 opcode == BGTZL); | 5751 opcode == BGTZL); |
5750 opcode = (cond == eq) ? BEQ : BNE; | 5752 opcode = (cond == eq) ? BEQ : BNE; |
5751 instr = (instr & ~kOpcodeMask) | opcode; | 5753 instr = (instr & ~kOpcodeMask) | opcode; |
5752 masm_.emit(instr); | 5754 masm_.emit(instr); |
5753 } | 5755 } |
5754 | 5756 |
5755 | 5757 |
5756 } } // namespace v8::internal | 5758 } } // namespace v8::internal |
5757 | 5759 |
5758 #endif // V8_TARGET_ARCH_MIPS | 5760 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |