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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 __ MultiPush(kJSCallerSaved | ra.bit()); | 1578 __ MultiPush(kJSCallerSaved | ra.bit()); |
1579 if (save_doubles_ == kSaveFPRegs) { | 1579 if (save_doubles_ == kSaveFPRegs) { |
1580 __ MultiPushFPU(kCallerSavedFPU); | 1580 __ MultiPushFPU(kCallerSavedFPU); |
1581 } | 1581 } |
1582 const int argument_count = 1; | 1582 const int argument_count = 1; |
1583 const int fp_argument_count = 0; | 1583 const int fp_argument_count = 0; |
1584 const Register scratch = a1; | 1584 const Register scratch = a1; |
1585 | 1585 |
1586 AllowExternalCallThatCantCauseGC scope(masm); | 1586 AllowExternalCallThatCantCauseGC scope(masm); |
1587 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch); | 1587 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch); |
1588 __ li(a0, Operand(ExternalReference::isolate_address())); | 1588 __ li(a0, Operand(ExternalReference::isolate_address(masm->isolate()))); |
1589 __ CallCFunction( | 1589 __ CallCFunction( |
1590 ExternalReference::store_buffer_overflow_function(masm->isolate()), | 1590 ExternalReference::store_buffer_overflow_function(masm->isolate()), |
1591 argument_count); | 1591 argument_count); |
1592 if (save_doubles_ == kSaveFPRegs) { | 1592 if (save_doubles_ == kSaveFPRegs) { |
1593 __ MultiPopFPU(kCallerSavedFPU); | 1593 __ MultiPopFPU(kCallerSavedFPU); |
1594 } | 1594 } |
1595 | 1595 |
1596 __ MultiPop(kJSCallerSaved | ra.bit()); | 1596 __ MultiPop(kJSCallerSaved | ra.bit()); |
1597 __ Ret(); | 1597 __ Ret(); |
1598 } | 1598 } |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3403 // Prepare arguments for C routine. | 3403 // Prepare arguments for C routine. |
3404 // a0 = argc | 3404 // a0 = argc |
3405 __ mov(a0, s0); | 3405 __ mov(a0, s0); |
3406 // a1 = argv (set in the delay slot after find_ra below). | 3406 // a1 = argv (set in the delay slot after find_ra below). |
3407 | 3407 |
3408 // We are calling compiled C/C++ code. a0 and a1 hold our two arguments. We | 3408 // We are calling compiled C/C++ code. a0 and a1 hold our two arguments. We |
3409 // also need to reserve the 4 argument slots on the stack. | 3409 // also need to reserve the 4 argument slots on the stack. |
3410 | 3410 |
3411 __ AssertStackIsAligned(); | 3411 __ AssertStackIsAligned(); |
3412 | 3412 |
3413 __ li(a2, Operand(ExternalReference::isolate_address())); | 3413 __ li(a2, Operand(ExternalReference::isolate_address(isolate))); |
3414 | 3414 |
3415 // To let the GC traverse the return address of the exit frames, we need to | 3415 // To let the GC traverse the return address of the exit frames, we need to |
3416 // know where the return address is. The CEntryStub is unmovable, so | 3416 // know where the return address is. The CEntryStub is unmovable, so |
3417 // we can store the address on the stack to be able to find it again and | 3417 // we can store the address on the stack to be able to find it again and |
3418 // we never have to restore it, because it will not change. | 3418 // we never have to restore it, because it will not change. |
3419 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm); | 3419 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm); |
3420 // This branch-and-link sequence is needed to find the current PC on mips, | 3420 // This branch-and-link sequence is needed to find the current PC on mips, |
3421 // saved to the ra register. | 3421 // saved to the ra register. |
3422 // Use masm-> here instead of the double-underscore macro since extra | 3422 // Use masm-> here instead of the double-underscore macro since extra |
3423 // coverage code can interfere with the proper calculation of ra. | 3423 // coverage code can interfere with the proper calculation of ra. |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4682 // look (sp meaning the value of sp at this moment): | 4682 // look (sp meaning the value of sp at this moment): |
4683 // [sp + 5] - Argument 9 | 4683 // [sp + 5] - Argument 9 |
4684 // [sp + 4] - Argument 8 | 4684 // [sp + 4] - Argument 8 |
4685 // [sp + 3] - Argument 7 | 4685 // [sp + 3] - Argument 7 |
4686 // [sp + 2] - Argument 6 | 4686 // [sp + 2] - Argument 6 |
4687 // [sp + 1] - Argument 5 | 4687 // [sp + 1] - Argument 5 |
4688 // [sp + 0] - saved ra | 4688 // [sp + 0] - saved ra |
4689 | 4689 |
4690 // Argument 9: Pass current isolate address. | 4690 // Argument 9: Pass current isolate address. |
4691 // CFunctionArgumentOperand handles MIPS stack argument slots. | 4691 // CFunctionArgumentOperand handles MIPS stack argument slots. |
4692 __ li(a0, Operand(ExternalReference::isolate_address())); | 4692 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); |
4693 __ sw(a0, MemOperand(sp, 5 * kPointerSize)); | 4693 __ sw(a0, MemOperand(sp, 5 * kPointerSize)); |
4694 | 4694 |
4695 // Argument 8: Indicate that this is a direct call from JavaScript. | 4695 // Argument 8: Indicate that this is a direct call from JavaScript. |
4696 __ li(a0, Operand(1)); | 4696 __ li(a0, Operand(1)); |
4697 __ sw(a0, MemOperand(sp, 4 * kPointerSize)); | 4697 __ sw(a0, MemOperand(sp, 4 * kPointerSize)); |
4698 | 4698 |
4699 // Argument 7: Start (high end) of backtracking stack memory area. | 4699 // Argument 7: Start (high end) of backtracking stack memory area. |
4700 __ li(a0, Operand(address_of_regexp_stack_memory_address)); | 4700 __ li(a0, Operand(address_of_regexp_stack_memory_address)); |
4701 __ lw(a0, MemOperand(a0, 0)); | 4701 __ lw(a0, MemOperand(a0, 0)); |
4702 __ li(a2, Operand(address_of_regexp_stack_memory_size)); | 4702 __ li(a2, Operand(address_of_regexp_stack_memory_size)); |
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7296 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); | 7296 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
7297 int argument_count = 3; | 7297 int argument_count = 3; |
7298 __ PrepareCallCFunction(argument_count, regs_.scratch0()); | 7298 __ PrepareCallCFunction(argument_count, regs_.scratch0()); |
7299 Register address = | 7299 Register address = |
7300 a0.is(regs_.address()) ? regs_.scratch0() : regs_.address(); | 7300 a0.is(regs_.address()) ? regs_.scratch0() : regs_.address(); |
7301 ASSERT(!address.is(regs_.object())); | 7301 ASSERT(!address.is(regs_.object())); |
7302 ASSERT(!address.is(a0)); | 7302 ASSERT(!address.is(a0)); |
7303 __ Move(address, regs_.address()); | 7303 __ Move(address, regs_.address()); |
7304 __ Move(a0, regs_.object()); | 7304 __ Move(a0, regs_.object()); |
7305 __ Move(a1, address); | 7305 __ Move(a1, address); |
7306 __ li(a2, Operand(ExternalReference::isolate_address())); | 7306 __ li(a2, Operand(ExternalReference::isolate_address(masm->isolate()))); |
7307 | 7307 |
7308 AllowExternalCallThatCantCauseGC scope(masm); | 7308 AllowExternalCallThatCantCauseGC scope(masm); |
7309 if (mode == INCREMENTAL_COMPACTION) { | 7309 if (mode == INCREMENTAL_COMPACTION) { |
7310 __ CallCFunction( | 7310 __ CallCFunction( |
7311 ExternalReference::incremental_evacuation_record_write_function( | 7311 ExternalReference::incremental_evacuation_record_write_function( |
7312 masm->isolate()), | 7312 masm->isolate()), |
7313 argument_count); | 7313 argument_count); |
7314 } else { | 7314 } else { |
7315 ASSERT(mode == INCREMENTAL); | 7315 ASSERT(mode == INCREMENTAL); |
7316 __ CallCFunction( | 7316 __ CallCFunction( |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7547 __ Pop(ra, t1, a1); | 7547 __ Pop(ra, t1, a1); |
7548 __ Ret(); | 7548 __ Ret(); |
7549 } | 7549 } |
7550 | 7550 |
7551 | 7551 |
7552 #undef __ | 7552 #undef __ |
7553 | 7553 |
7554 } } // namespace v8::internal | 7554 } } // namespace v8::internal |
7555 | 7555 |
7556 #endif // V8_TARGET_ARCH_MIPS | 7556 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |