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 17 matching lines...) Expand all Loading... |
28 #include <limits.h> // For LONG_MIN, LONG_MAX. | 28 #include <limits.h> // For LONG_MIN, LONG_MAX. |
29 | 29 |
30 #include "v8.h" | 30 #include "v8.h" |
31 | 31 |
32 #if V8_TARGET_ARCH_MIPS | 32 #if V8_TARGET_ARCH_MIPS |
33 | 33 |
34 #include "bootstrapper.h" | 34 #include "bootstrapper.h" |
35 #include "codegen.h" | 35 #include "codegen.h" |
36 #include "cpu-profiler.h" | 36 #include "cpu-profiler.h" |
37 #include "debug.h" | 37 #include "debug.h" |
| 38 #include "isolate-inl.h" |
38 #include "runtime.h" | 39 #include "runtime.h" |
39 | 40 |
40 namespace v8 { | 41 namespace v8 { |
41 namespace internal { | 42 namespace internal { |
42 | 43 |
43 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) | 44 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) |
44 : Assembler(arg_isolate, buffer, size), | 45 : Assembler(arg_isolate, buffer, size), |
45 generating_stub_(false), | 46 generating_stub_(false), |
46 allow_stub_calls_(true), | 47 allow_stub_calls_(true), |
47 has_frame_(false) { | 48 has_frame_(false) { |
(...skipping 4541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4589 if (frame_mode == BUILD_STUB_FRAME) { | 4590 if (frame_mode == BUILD_STUB_FRAME) { |
4590 Push(ra, fp, cp); | 4591 Push(ra, fp, cp); |
4591 Push(Smi::FromInt(StackFrame::STUB)); | 4592 Push(Smi::FromInt(StackFrame::STUB)); |
4592 // Adjust FP to point to saved FP. | 4593 // Adjust FP to point to saved FP. |
4593 Addu(fp, sp, Operand(2 * kPointerSize)); | 4594 Addu(fp, sp, Operand(2 * kPointerSize)); |
4594 } else { | 4595 } else { |
4595 PredictableCodeSizeScope predictible_code_size_scope( | 4596 PredictableCodeSizeScope predictible_code_size_scope( |
4596 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 4597 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
4597 // The following three instructions must remain together and unmodified | 4598 // The following three instructions must remain together and unmodified |
4598 // for code aging to work properly. | 4599 // for code aging to work properly. |
4599 if (FLAG_optimize_for_size && FLAG_age_code) { | 4600 if (isolate()->IsCodePreAgingActive()) { |
4600 // Pre-age the code. | 4601 // Pre-age the code. |
4601 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); | 4602 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
4602 nop(Assembler::CODE_AGE_MARKER_NOP); | 4603 nop(Assembler::CODE_AGE_MARKER_NOP); |
4603 // Save the function's original return address | 4604 // Save the function's original return address |
4604 // (it will be clobbered by Call(t9)) | 4605 // (it will be clobbered by Call(t9)) |
4605 mov(at, ra); | 4606 mov(at, ra); |
4606 // Load the stub address to t9 and call it | 4607 // Load the stub address to t9 and call it |
4607 li(t9, | 4608 li(t9, |
4608 Operand(reinterpret_cast<uint32_t>(stub->instruction_start()))); | 4609 Operand(reinterpret_cast<uint32_t>(stub->instruction_start()))); |
4609 Call(t9); | 4610 Call(t9); |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5709 opcode == BGTZL); | 5710 opcode == BGTZL); |
5710 opcode = (cond == eq) ? BEQ : BNE; | 5711 opcode = (cond == eq) ? BEQ : BNE; |
5711 instr = (instr & ~kOpcodeMask) | opcode; | 5712 instr = (instr & ~kOpcodeMask) | opcode; |
5712 masm_.emit(instr); | 5713 masm_.emit(instr); |
5713 } | 5714 } |
5714 | 5715 |
5715 | 5716 |
5716 } } // namespace v8::internal | 5717 } } // namespace v8::internal |
5717 | 5718 |
5718 #endif // V8_TARGET_ARCH_MIPS | 5719 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |