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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Check if the operand is a heap number. | 154 // Check if the operand is a heap number. |
155 static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand, | 155 static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand, |
156 Register scratch1, Register scratch2, | 156 Register scratch1, Register scratch2, |
157 Label* not_a_heap_number) { | 157 Label* not_a_heap_number) { |
158 __ lw(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset)); | 158 __ lw(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset)); |
159 __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex); | 159 __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex); |
160 __ Branch(not_a_heap_number, ne, scratch1, Operand(scratch2)); | 160 __ Branch(not_a_heap_number, ne, scratch1, Operand(scratch2)); |
161 } | 161 } |
162 | 162 |
163 | 163 |
| 164 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 165 // Update the static counter each time a new code stub is generated. |
| 166 Isolate* isolate = masm->isolate(); |
| 167 isolate->counters()->code_stubs()->Increment(); |
| 168 |
| 169 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate); |
| 170 int param_count = descriptor->register_param_count_; |
| 171 { |
| 172 // Call the runtime system in a fresh internal frame. |
| 173 FrameScope scope(masm, StackFrame::INTERNAL); |
| 174 ASSERT(descriptor->register_param_count_ == 0 || |
| 175 a0.is(descriptor->register_params_[param_count - 1])); |
| 176 // Push arguments |
| 177 for (int i = 0; i < param_count; ++i) { |
| 178 __ push(descriptor->register_params_[i]); |
| 179 } |
| 180 ExternalReference miss = descriptor->miss_handler_; |
| 181 __ CallExternalReference(miss, descriptor->register_param_count_); |
| 182 } |
| 183 |
| 184 __ Ret(); |
| 185 } |
| 186 |
| 187 |
164 void ToNumberStub::Generate(MacroAssembler* masm) { | 188 void ToNumberStub::Generate(MacroAssembler* masm) { |
165 // The ToNumber stub takes one argument in a0. | 189 // The ToNumber stub takes one argument in a0. |
166 Label check_heap_number, call_builtin; | 190 Label check_heap_number, call_builtin; |
167 __ JumpIfNotSmi(a0, &check_heap_number); | 191 __ JumpIfNotSmi(a0, &check_heap_number); |
168 __ Ret(USE_DELAY_SLOT); | 192 __ Ret(USE_DELAY_SLOT); |
169 __ mov(v0, a0); | 193 __ mov(v0, a0); |
170 | 194 |
171 __ bind(&check_heap_number); | 195 __ bind(&check_heap_number); |
172 EmitCheckForHeapNumber(masm, a0, a1, t0, &call_builtin); | 196 EmitCheckForHeapNumber(masm, a0, a1, t0, &call_builtin); |
173 __ Ret(USE_DELAY_SLOT); | 197 __ Ret(USE_DELAY_SLOT); |
(...skipping 7347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7521 __ Pop(ra, t1, a1); | 7545 __ Pop(ra, t1, a1); |
7522 __ Ret(); | 7546 __ Ret(); |
7523 } | 7547 } |
7524 | 7548 |
7525 | 7549 |
7526 #undef __ | 7550 #undef __ |
7527 | 7551 |
7528 } } // namespace v8::internal | 7552 } } // namespace v8::internal |
7529 | 7553 |
7530 #endif // V8_TARGET_ARCH_MIPS | 7554 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |