| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 __ li(s6, Operand(roots_address)); | 105 __ li(s6, Operand(roots_address)); |
| 106 | 106 |
| 107 // Push the function and the receiver onto the stack. | 107 // Push the function and the receiver onto the stack. |
| 108 __ MultiPushReversed(a1.bit() | a2.bit()); | 108 __ MultiPushReversed(a1.bit() | a2.bit()); |
| 109 | 109 |
| 110 // Copy arguments to the stack in a loop. | 110 // Copy arguments to the stack in a loop. |
| 111 // a3: argc | 111 // a3: argc |
| 112 // s0: argv, ie points to first arg | 112 // s0: argv, ie points to first arg |
| 113 Label loop, entry; | 113 Label loop, entry; |
| 114 __ sll(t0, a3, kPointerSizeLog2); | 114 __ sll(t0, a3, kPointerSizeLog2); |
| 115 __ add(t2, s0, t0); | 115 __ addu(t2, s0, t0); |
| 116 __ b(&entry); | 116 __ b(&entry); |
| 117 __ nop(); // Branch delay slot nop. | 117 __ nop(); // Branch delay slot nop. |
| 118 // t2 points past last arg. | 118 // t2 points past last arg. |
| 119 __ bind(&loop); | 119 __ bind(&loop); |
| 120 __ lw(t0, MemOperand(s0)); // Read next parameter. | 120 __ lw(t0, MemOperand(s0)); // Read next parameter. |
| 121 __ addiu(s0, s0, kPointerSize); | 121 __ addiu(s0, s0, kPointerSize); |
| 122 __ lw(t0, MemOperand(t0)); // Dereference handle. | 122 __ lw(t0, MemOperand(t0)); // Dereference handle. |
| 123 __ Push(t0); // Push parameter. | 123 __ Push(t0); // Push parameter. |
| 124 __ bind(&entry); | 124 __ bind(&entry); |
| 125 __ Branch(ne, &loop, s0, Operand(t2)); | 125 __ Branch(&loop, ne, s0, Operand(t2)); |
| 126 | 126 |
| 127 // Registers: | 127 // Registers: |
| 128 // a0: entry_address | 128 // a0: entry_address |
| 129 // a1: function | 129 // a1: function |
| 130 // a2: reveiver_pointer | 130 // a2: reveiver_pointer |
| 131 // a3: argc | 131 // a3: argc |
| 132 // s0: argv | 132 // s0: argv |
| 133 // s6: roots_address | 133 // s6: roots_address |
| 134 // | 134 // |
| 135 // Stack: | 135 // Stack: |
| 136 // arguments | 136 // arguments |
| 137 // receiver | 137 // receiver |
| 138 // function | 138 // function |
| 139 // arguments slots | 139 // arguments slots |
| 140 // handler frame | 140 // handler frame |
| 141 // entry frame | 141 // entry frame |
| 142 // callee saved registers + ra | 142 // callee saved registers + ra |
| 143 // 4 args slots | 143 // 4 args slots |
| 144 // args | 144 // args |
| 145 | 145 |
| 146 // Initialize all JavaScript callee-saved registers, since they will be seen | 146 // Initialize all JavaScript callee-saved registers, since they will be seen |
| 147 // by the garbage collector as part of handlers. | 147 // by the garbage collector as part of handlers. |
| 148 __ LoadRoot(t4, Heap::kUndefinedValueRootIndex); | 148 __ LoadRoot(t0, Heap::kUndefinedValueRootIndex); |
| 149 __ mov(s1, t4); | 149 __ mov(s1, t0); |
| 150 __ mov(s2, t4); | 150 __ mov(s2, t0); |
| 151 __ mov(s3, t4); | 151 __ mov(s3, t0); |
| 152 __ mov(s4, s4); | 152 __ mov(s4, t0); |
| 153 __ mov(s5, t4); | 153 __ mov(s5, t0); |
| 154 // s6 holds the root address. Do not clobber. | 154 // s6 holds the root address. Do not clobber. |
| 155 // s7 is cp. Do not init. | 155 // s7 is cp. Do not init. |
| 156 | 156 |
| 157 // Invoke the code and pass argc as a0. | 157 // Invoke the code and pass argc as a0. |
| 158 __ mov(a0, a3); | 158 __ mov(a0, a3); |
| 159 if (is_construct) { | 159 if (is_construct) { |
| 160 UNIMPLEMENTED_MIPS(); | 160 UNIMPLEMENTED_MIPS(); |
| 161 __ break_(0x164); | 161 __ break_(__LINE__); |
| 162 } else { | 162 } else { |
| 163 ParameterCount actual(a0); | 163 ParameterCount actual(a0); |
| 164 __ InvokeFunction(a1, actual, CALL_FUNCTION); | 164 __ InvokeFunction(a1, actual, CALL_FUNCTION); |
| 165 } | 165 } |
| 166 | 166 |
| 167 __ LeaveInternalFrame(); | 167 __ LeaveInternalFrame(); |
| 168 | 168 |
| 169 __ Jump(ra); | 169 __ Jump(ra); |
| 170 } | 170 } |
| 171 | 171 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 | 187 |
| 188 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 188 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| 189 UNIMPLEMENTED_MIPS(); | 189 UNIMPLEMENTED_MIPS(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 | 192 |
| 193 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 193 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| 194 UNIMPLEMENTED_MIPS(); | 194 UNIMPLEMENTED_MIPS(); |
| 195 __ break_(0x201); | 195 __ break_(__LINE__); |
| 196 } | 196 } |
| 197 | 197 |
| 198 | 198 |
| 199 #undef __ | 199 #undef __ |
| 200 | 200 |
| 201 } } // namespace v8::internal | 201 } } // namespace v8::internal |
| 202 | 202 |
| OLD | NEW |