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

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

Issue 853323002: MIPS: split api call stubs into accessor and function call stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/code-stubs-mips64.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 4401 matching lines...) Expand 10 before | Expand all | Expand 10 after
4412 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd); 4412 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
4413 } 4413 }
4414 4414
4415 4415
4416 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { 4416 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
4417 return ref0.address() - ref1.address(); 4417 return ref0.address() - ref1.address();
4418 } 4418 }
4419 4419
4420 4420
4421 void MacroAssembler::CallApiFunctionAndReturn( 4421 void MacroAssembler::CallApiFunctionAndReturn(
4422 Register function_address, 4422 Register function_address, ExternalReference thunk_ref, int stack_space,
4423 ExternalReference thunk_ref, 4423 MemOperand* stack_space_operand, MemOperand return_value_operand,
4424 int stack_space,
4425 MemOperand return_value_operand,
4426 MemOperand* context_restore_operand) { 4424 MemOperand* context_restore_operand) {
4427 ExternalReference next_address = 4425 ExternalReference next_address =
4428 ExternalReference::handle_scope_next_address(isolate()); 4426 ExternalReference::handle_scope_next_address(isolate());
4429 const int kNextOffset = 0; 4427 const int kNextOffset = 0;
4430 const int kLimitOffset = AddressOffset( 4428 const int kLimitOffset = AddressOffset(
4431 ExternalReference::handle_scope_limit_address(isolate()), 4429 ExternalReference::handle_scope_limit_address(isolate()),
4432 next_address); 4430 next_address);
4433 const int kLevelOffset = AddressOffset( 4431 const int kLevelOffset = AddressOffset(
4434 ExternalReference::handle_scope_level_address(isolate()), 4432 ExternalReference::handle_scope_level_address(isolate()),
4435 next_address); 4433 next_address);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
4509 LoadRoot(t0, Heap::kTheHoleValueRootIndex); 4507 LoadRoot(t0, Heap::kTheHoleValueRootIndex);
4510 li(at, Operand(ExternalReference::scheduled_exception_address(isolate()))); 4508 li(at, Operand(ExternalReference::scheduled_exception_address(isolate())));
4511 lw(t1, MemOperand(at)); 4509 lw(t1, MemOperand(at));
4512 Branch(&promote_scheduled_exception, ne, t0, Operand(t1)); 4510 Branch(&promote_scheduled_exception, ne, t0, Operand(t1));
4513 bind(&exception_handled); 4511 bind(&exception_handled);
4514 4512
4515 bool restore_context = context_restore_operand != NULL; 4513 bool restore_context = context_restore_operand != NULL;
4516 if (restore_context) { 4514 if (restore_context) {
4517 lw(cp, *context_restore_operand); 4515 lw(cp, *context_restore_operand);
4518 } 4516 }
4519 li(s0, Operand(stack_space)); 4517 if (stack_space_operand != NULL) {
4520 LeaveExitFrame(false, s0, !restore_context, EMIT_RETURN); 4518 lw(s0, *stack_space_operand);
4519 } else {
4520 li(s0, Operand(stack_space));
4521 }
4522 LeaveExitFrame(false, s0, !restore_context, EMIT_RETURN,
4523 stack_space_operand != NULL);
4521 4524
4522 bind(&promote_scheduled_exception); 4525 bind(&promote_scheduled_exception);
4523 { 4526 {
4524 FrameScope frame(this, StackFrame::INTERNAL); 4527 FrameScope frame(this, StackFrame::INTERNAL);
4525 CallExternalReference( 4528 CallExternalReference(
4526 ExternalReference(Runtime::kPromoteScheduledException, isolate()), 4529 ExternalReference(Runtime::kPromoteScheduledException, isolate()),
4527 0); 4530 0);
4528 } 4531 }
4529 jmp(&exception_handled); 4532 jmp(&exception_handled);
4530 4533
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
5159 And(sp, sp, Operand(-frame_alignment)); // Align stack. 5162 And(sp, sp, Operand(-frame_alignment)); // Align stack.
5160 } 5163 }
5161 5164
5162 // Set the exit frame sp value to point just before the return address 5165 // Set the exit frame sp value to point just before the return address
5163 // location. 5166 // location.
5164 addiu(at, sp, kPointerSize); 5167 addiu(at, sp, kPointerSize);
5165 sw(at, MemOperand(fp, ExitFrameConstants::kSPOffset)); 5168 sw(at, MemOperand(fp, ExitFrameConstants::kSPOffset));
5166 } 5169 }
5167 5170
5168 5171
5169 void MacroAssembler::LeaveExitFrame(bool save_doubles, 5172 void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
5170 Register argument_count, 5173 bool restore_context, bool do_return,
5171 bool restore_context, 5174 bool argument_count_is_length) {
5172 bool do_return) {
5173 // Optionally restore all double registers. 5175 // Optionally restore all double registers.
5174 if (save_doubles) { 5176 if (save_doubles) {
5175 // Remember: we only need to restore every 2nd double FPU value. 5177 // Remember: we only need to restore every 2nd double FPU value.
5176 lw(t8, MemOperand(fp, ExitFrameConstants::kSPOffset)); 5178 lw(t8, MemOperand(fp, ExitFrameConstants::kSPOffset));
5177 for (int i = 0; i < FPURegister::kMaxNumRegisters; i+=2) { 5179 for (int i = 0; i < FPURegister::kMaxNumRegisters; i+=2) {
5178 FPURegister reg = FPURegister::from_code(i); 5180 FPURegister reg = FPURegister::from_code(i);
5179 ldc1(reg, MemOperand(t8, i * kDoubleSize + kPointerSize)); 5181 ldc1(reg, MemOperand(t8, i * kDoubleSize + kPointerSize));
5180 } 5182 }
5181 } 5183 }
5182 5184
(...skipping 10 matching lines...) Expand all
5193 li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); 5195 li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate())));
5194 sw(a3, MemOperand(t8)); 5196 sw(a3, MemOperand(t8));
5195 #endif 5197 #endif
5196 5198
5197 // Pop the arguments, restore registers, and return. 5199 // Pop the arguments, restore registers, and return.
5198 mov(sp, fp); // Respect ABI stack constraint. 5200 mov(sp, fp); // Respect ABI stack constraint.
5199 lw(fp, MemOperand(sp, ExitFrameConstants::kCallerFPOffset)); 5201 lw(fp, MemOperand(sp, ExitFrameConstants::kCallerFPOffset));
5200 lw(ra, MemOperand(sp, ExitFrameConstants::kCallerPCOffset)); 5202 lw(ra, MemOperand(sp, ExitFrameConstants::kCallerPCOffset));
5201 5203
5202 if (argument_count.is_valid()) { 5204 if (argument_count.is_valid()) {
5203 sll(t8, argument_count, kPointerSizeLog2); 5205 if (argument_count_is_length) {
5204 addu(sp, sp, t8); 5206 addu(sp, sp, argument_count);
5207 } else {
5208 sll(t8, argument_count, kPointerSizeLog2);
5209 addu(sp, sp, t8);
5210 }
5205 } 5211 }
5206 5212
5207 if (do_return) { 5213 if (do_return) {
5208 Ret(USE_DELAY_SLOT); 5214 Ret(USE_DELAY_SLOT);
5209 // If returning, the instruction in the delay slot will be the addiu below. 5215 // If returning, the instruction in the delay slot will be the addiu below.
5210 } 5216 }
5211 addiu(sp, sp, 8); 5217 addiu(sp, sp, 8);
5212 } 5218 }
5213 5219
5214 5220
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
6270 } 6276 }
6271 if (mag.shift > 0) sra(result, result, mag.shift); 6277 if (mag.shift > 0) sra(result, result, mag.shift);
6272 srl(at, dividend, 31); 6278 srl(at, dividend, 31);
6273 Addu(result, result, Operand(at)); 6279 Addu(result, result, Operand(at));
6274 } 6280 }
6275 6281
6276 6282
6277 } } // namespace v8::internal 6283 } } // namespace v8::internal
6278 6284
6279 #endif // V8_TARGET_ARCH_MIPS 6285 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698