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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 if (info()->saves_caller_doubles()) { | 201 if (info()->saves_caller_doubles()) { |
202 SaveCallerDoubles(); | 202 SaveCallerDoubles(); |
203 } | 203 } |
204 | 204 |
205 // Possibly allocate a local context. | 205 // Possibly allocate a local context. |
206 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 206 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
207 if (heap_slots > 0) { | 207 if (heap_slots > 0) { |
208 Comment(";;; Allocate local context"); | 208 Comment(";;; Allocate local context"); |
209 // Argument to NewContext is the function, which is in r1. | 209 // Argument to NewContext is the function, which is in r1. |
210 __ push(r1); | |
211 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 210 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
212 FastNewContextStub stub(heap_slots); | 211 FastNewContextStub stub(heap_slots); |
213 __ CallStub(&stub); | 212 __ CallStub(&stub); |
214 } else { | 213 } else { |
| 214 __ push(r1); |
215 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 215 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
216 } | 216 } |
217 RecordSafepoint(Safepoint::kNoLazyDeopt); | 217 RecordSafepoint(Safepoint::kNoLazyDeopt); |
218 // Context is returned in both r0 and cp. It replaces the context | 218 // Context is returned in both r0 and cp. It replaces the context |
219 // passed to us. It's saved in the stack and kept live in cp. | 219 // passed to us. It's saved in the stack and kept live in cp. |
220 __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 220 __ mov(cp, r0); |
| 221 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
221 // Copy any necessary parameters into the context. | 222 // Copy any necessary parameters into the context. |
222 int num_parameters = scope()->num_parameters(); | 223 int num_parameters = scope()->num_parameters(); |
223 for (int i = 0; i < num_parameters; i++) { | 224 for (int i = 0; i < num_parameters; i++) { |
224 Variable* var = scope()->parameter(i); | 225 Variable* var = scope()->parameter(i); |
225 if (var->IsContextSlot()) { | 226 if (var->IsContextSlot()) { |
226 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 227 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
227 (num_parameters - 1 - i) * kPointerSize; | 228 (num_parameters - 1 - i) * kPointerSize; |
228 // Load parameter from stack. | 229 // Load parameter from stack. |
229 __ ldr(r0, MemOperand(fp, parameter_offset)); | 230 __ ldr(r0, MemOperand(fp, parameter_offset)); |
230 // Store it in the context. | 231 // Store it in the context. |
(...skipping 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5824 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5825 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5825 __ ldr(result, FieldMemOperand(scratch, | 5826 __ ldr(result, FieldMemOperand(scratch, |
5826 FixedArray::kHeaderSize - kPointerSize)); | 5827 FixedArray::kHeaderSize - kPointerSize)); |
5827 __ bind(&done); | 5828 __ bind(&done); |
5828 } | 5829 } |
5829 | 5830 |
5830 | 5831 |
5831 #undef __ | 5832 #undef __ |
5832 | 5833 |
5833 } } // namespace v8::internal | 5834 } } // namespace v8::internal |
OLD | NEW |