| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } else { | 191 } else { |
| 192 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 192 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 193 } | 193 } |
| 194 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); | 194 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); |
| 195 // Context is returned in both r0 and cp. It replaces the context | 195 // Context is returned in both r0 and cp. It replaces the context |
| 196 // passed to us. It's saved in the stack and kept live in cp. | 196 // passed to us. It's saved in the stack and kept live in cp. |
| 197 __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 197 __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 198 // Copy any necessary parameters into the context. | 198 // Copy any necessary parameters into the context. |
| 199 int num_parameters = scope()->num_parameters(); | 199 int num_parameters = scope()->num_parameters(); |
| 200 for (int i = 0; i < num_parameters; i++) { | 200 for (int i = 0; i < num_parameters; i++) { |
| 201 Slot* slot = scope()->parameter(i)->AsSlot(); | 201 Variable* var = scope()->parameter(i); |
| 202 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 202 if (var->IsContextSlot()) { |
| 203 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 203 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| 204 (num_parameters - 1 - i) * kPointerSize; | 204 (num_parameters - 1 - i) * kPointerSize; |
| 205 // Load parameter from stack. | 205 // Load parameter from stack. |
| 206 __ ldr(r0, MemOperand(fp, parameter_offset)); | 206 __ ldr(r0, MemOperand(fp, parameter_offset)); |
| 207 // Store it in the context. | 207 // Store it in the context. |
| 208 __ mov(r1, Operand(Context::SlotOffset(slot->index()))); | 208 __ mov(r1, Operand(Context::SlotOffset(var->index()))); |
| 209 __ str(r0, MemOperand(cp, r1)); | 209 __ str(r0, MemOperand(cp, r1)); |
| 210 // Update the write barrier. This clobbers all involved | 210 // Update the write barrier. This clobbers all involved |
| 211 // registers, so we have to use two more registers to avoid | 211 // registers, so we have to use two more registers to avoid |
| 212 // clobbering cp. | 212 // clobbering cp. |
| 213 __ mov(r2, Operand(cp)); | 213 __ mov(r2, Operand(cp)); |
| 214 __ RecordWrite(r2, Operand(r1), r3, r0); | 214 __ RecordWrite(r2, Operand(r1), r3, r0); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 Comment(";;; End allocate local context"); | 217 Comment(";;; End allocate local context"); |
| 218 } | 218 } |
| (...skipping 4290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4509 ASSERT(osr_pc_offset_ == -1); | 4509 ASSERT(osr_pc_offset_ == -1); |
| 4510 osr_pc_offset_ = masm()->pc_offset(); | 4510 osr_pc_offset_ = masm()->pc_offset(); |
| 4511 } | 4511 } |
| 4512 | 4512 |
| 4513 | 4513 |
| 4514 | 4514 |
| 4515 | 4515 |
| 4516 #undef __ | 4516 #undef __ |
| 4517 | 4517 |
| 4518 } } // namespace v8::internal | 4518 } } // namespace v8::internal |
| OLD | NEW |