Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: bool -> enum Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4567 matching lines...) Expand 10 before | Expand all | Expand 10 after
4578 LoadRoot(at, Heap::kUndefinedValueRootIndex); 4578 LoadRoot(at, Heap::kUndefinedValueRootIndex);
4579 Branch(not_int32, ne, object, Operand(at)); 4579 Branch(not_int32, ne, object, Operand(at));
4580 // |undefined| is truncated to 0. 4580 // |undefined| is truncated to 0.
4581 li(dst, Operand(Smi::FromInt(0))); 4581 li(dst, Operand(Smi::FromInt(0)));
4582 // Fall through. 4582 // Fall through.
4583 4583
4584 bind(&done); 4584 bind(&done);
4585 } 4585 }
4586 4586
4587 4587
4588 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
4589 if (frame_mode == BUILD_STUB_FRAME) {
4590 Push(ra, fp, cp);
4591 Push(Smi::FromInt(StackFrame::STUB));
4592 // Adjust FP to point to saved FP.
4593 Addu(fp, sp, Operand(2 * kPointerSize));
4594 } else {
4595 PredictableCodeSizeScope predictible_code_size_scope(
4596 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
4597 // The following three instructions must remain together and unmodified
4598 // for code aging to work properly.
4599 if (FLAG_optimize_for_size && FLAG_age_code) {
4600 // Pre-age the code.
4601 Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
4602 nop(Assembler::CODE_AGE_MARKER_NOP);
4603 // Save the function's original return address
4604 // (it will be clobbered by Call(t9))
4605 mov(at, ra);
4606 // Load the stub address to t9 and call it
4607 li(t9,
4608 Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
4609 Call(t9);
4610 // Record the stub address in the empty space for GetCodeAgeAndParity()
4611 dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
4612 } else {
4613 Push(ra, fp, cp, a1);
4614 nop(Assembler::CODE_AGE_SEQUENCE_NOP);
4615 // Adjust fp to point to caller's fp.
4616 Addu(fp, sp, Operand(2 * kPointerSize));
4617 }
4618 }
4619 }
4620
4621
4588 void MacroAssembler::EnterFrame(StackFrame::Type type) { 4622 void MacroAssembler::EnterFrame(StackFrame::Type type) {
4589 addiu(sp, sp, -5 * kPointerSize); 4623 addiu(sp, sp, -5 * kPointerSize);
4590 li(t8, Operand(Smi::FromInt(type))); 4624 li(t8, Operand(Smi::FromInt(type)));
4591 li(t9, Operand(CodeObject()), CONSTANT_SIZE); 4625 li(t9, Operand(CodeObject()), CONSTANT_SIZE);
4592 sw(ra, MemOperand(sp, 4 * kPointerSize)); 4626 sw(ra, MemOperand(sp, 4 * kPointerSize));
4593 sw(fp, MemOperand(sp, 3 * kPointerSize)); 4627 sw(fp, MemOperand(sp, 3 * kPointerSize));
4594 sw(cp, MemOperand(sp, 2 * kPointerSize)); 4628 sw(cp, MemOperand(sp, 2 * kPointerSize));
4595 sw(t8, MemOperand(sp, 1 * kPointerSize)); 4629 sw(t8, MemOperand(sp, 1 * kPointerSize));
4596 sw(t9, MemOperand(sp, 0 * kPointerSize)); 4630 sw(t9, MemOperand(sp, 0 * kPointerSize));
4597 addiu(fp, sp, 3 * kPointerSize); 4631 addiu(fp, sp, 3 * kPointerSize);
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
5675 opcode == BGTZL); 5709 opcode == BGTZL);
5676 opcode = (cond == eq) ? BEQ : BNE; 5710 opcode = (cond == eq) ? BEQ : BNE;
5677 instr = (instr & ~kOpcodeMask) | opcode; 5711 instr = (instr & ~kOpcodeMask) | opcode;
5678 masm_.emit(instr); 5712 masm_.emit(instr);
5679 } 5713 }
5680 5714
5681 5715
5682 } } // namespace v8::internal 5716 } } // namespace v8::internal
5683 5717
5684 #endif // V8_TARGET_ARCH_MIPS 5718 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698