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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters; | 111 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters; |
112 MultiPop(kSafepointSavedRegisters); | 112 MultiPop(kSafepointSavedRegisters); |
113 if (num_unsaved > 0) { | 113 if (num_unsaved > 0) { |
114 Addu(sp, sp, Operand(num_unsaved * kPointerSize)); | 114 Addu(sp, sp, Operand(num_unsaved * kPointerSize)); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 void MacroAssembler::PushSafepointRegistersAndDoubles() { | 119 void MacroAssembler::PushSafepointRegistersAndDoubles() { |
120 PushSafepointRegisters(); | 120 PushSafepointRegisters(); |
121 Subu(sp, sp, Operand(FPURegister::kNumAllocatableRegisters * kDoubleSize)); | 121 Subu(sp, sp, Operand(FPURegister::NumAllocatableRegisters() * kDoubleSize)); |
122 for (int i = 0; i < FPURegister::kNumAllocatableRegisters; i+=2) { | 122 for (int i = 0; i < FPURegister::NumAllocatableRegisters(); i+=2) { |
123 FPURegister reg = FPURegister::FromAllocationIndex(i); | 123 FPURegister reg = FPURegister::FromAllocationIndex(i); |
124 sdc1(reg, MemOperand(sp, i * kDoubleSize)); | 124 sdc1(reg, MemOperand(sp, i * kDoubleSize)); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 void MacroAssembler::PopSafepointRegistersAndDoubles() { | 129 void MacroAssembler::PopSafepointRegistersAndDoubles() { |
130 for (int i = 0; i < FPURegister::kNumAllocatableRegisters; i+=2) { | 130 for (int i = 0; i < FPURegister::NumAllocatableRegisters(); i+=2) { |
131 FPURegister reg = FPURegister::FromAllocationIndex(i); | 131 FPURegister reg = FPURegister::FromAllocationIndex(i); |
132 ldc1(reg, MemOperand(sp, i * kDoubleSize)); | 132 ldc1(reg, MemOperand(sp, i * kDoubleSize)); |
133 } | 133 } |
134 Addu(sp, sp, Operand(FPURegister::kNumAllocatableRegisters * kDoubleSize)); | 134 Addu(sp, sp, Operand(FPURegister::NumAllocatableRegisters() * kDoubleSize)); |
135 PopSafepointRegisters(); | 135 PopSafepointRegisters(); |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register src, | 139 void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register src, |
140 Register dst) { | 140 Register dst) { |
141 sw(src, SafepointRegistersAndDoublesSlot(dst)); | 141 sw(src, SafepointRegistersAndDoublesSlot(dst)); |
142 } | 142 } |
143 | 143 |
144 | 144 |
(...skipping 15 matching lines...) Expand all Loading... |
160 | 160 |
161 | 161 |
162 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { | 162 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { |
163 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); | 163 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { | 167 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { |
168 UNIMPLEMENTED_MIPS(); | 168 UNIMPLEMENTED_MIPS(); |
169 // General purpose registers are pushed last on the stack. | 169 // General purpose registers are pushed last on the stack. |
170 int doubles_size = FPURegister::kNumAllocatableRegisters * kDoubleSize; | 170 int doubles_size = FPURegister::NumAllocatableRegisters() * kDoubleSize; |
171 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; | 171 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; |
172 return MemOperand(sp, doubles_size + register_offset); | 172 return MemOperand(sp, doubles_size + register_offset); |
173 } | 173 } |
174 | 174 |
175 | 175 |
176 void MacroAssembler::InNewSpace(Register object, | 176 void MacroAssembler::InNewSpace(Register object, |
177 Register scratch, | 177 Register scratch, |
178 Condition cc, | 178 Condition cc, |
179 Label* branch) { | 179 Label* branch) { |
180 ASSERT(cc == eq || cc == ne); | 180 ASSERT(cc == eq || cc == ne); |
(...skipping 4061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4242 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4242 PrepareCEntryFunction(ExternalReference(f, isolate())); |
4243 CEntryStub stub(1); | 4243 CEntryStub stub(1); |
4244 CallStub(&stub); | 4244 CallStub(&stub); |
4245 } | 4245 } |
4246 | 4246 |
4247 | 4247 |
4248 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 4248 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
4249 const Runtime::Function* function = Runtime::FunctionForId(id); | 4249 const Runtime::Function* function = Runtime::FunctionForId(id); |
4250 PrepareCEntryArgs(function->nargs); | 4250 PrepareCEntryArgs(function->nargs); |
4251 PrepareCEntryFunction(ExternalReference(function, isolate())); | 4251 PrepareCEntryFunction(ExternalReference(function, isolate())); |
4252 CEntryStub stub(1, kSaveFPRegs); | 4252 SaveFPRegsMode mode = CpuFeatures::IsSupported(FPU) |
| 4253 ? kSaveFPRegs |
| 4254 : kDontSaveFPRegs; |
| 4255 CEntryStub stub(1, mode); |
4253 CallStub(&stub); | 4256 CallStub(&stub); |
4254 } | 4257 } |
4255 | 4258 |
4256 | 4259 |
4257 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | 4260 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { |
4258 CallRuntime(Runtime::FunctionForId(fid), num_arguments); | 4261 CallRuntime(Runtime::FunctionForId(fid), num_arguments); |
4259 } | 4262 } |
4260 | 4263 |
4261 | 4264 |
4262 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 4265 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5506 opcode == BGTZL); | 5509 opcode == BGTZL); |
5507 opcode = (cond == eq) ? BEQ : BNE; | 5510 opcode = (cond == eq) ? BEQ : BNE; |
5508 instr = (instr & ~kOpcodeMask) | opcode; | 5511 instr = (instr & ~kOpcodeMask) | opcode; |
5509 masm_.emit(instr); | 5512 masm_.emit(instr); |
5510 } | 5513 } |
5511 | 5514 |
5512 | 5515 |
5513 } } // namespace v8::internal | 5516 } } // namespace v8::internal |
5514 | 5517 |
5515 #endif // V8_TARGET_ARCH_MIPS | 5518 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |