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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 200 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
201 } | 201 } |
202 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); | 202 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); |
203 // Context is returned in both rax and rsi. It replaces the context | 203 // Context is returned in both rax and rsi. It replaces the context |
204 // passed to us. It's saved in the stack and kept live in rsi. | 204 // passed to us. It's saved in the stack and kept live in rsi. |
205 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); | 205 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |
206 | 206 |
207 // Copy any necessary parameters into the context. | 207 // Copy any necessary parameters into the context. |
208 int num_parameters = scope()->num_parameters(); | 208 int num_parameters = scope()->num_parameters(); |
209 for (int i = 0; i < num_parameters; i++) { | 209 for (int i = 0; i < num_parameters; i++) { |
210 Slot* slot = scope()->parameter(i)->AsSlot(); | 210 Variable* var = scope()->parameter(i); |
211 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 211 if (var->IsContextSlot()) { |
212 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 212 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
213 (num_parameters - 1 - i) * kPointerSize; | 213 (num_parameters - 1 - i) * kPointerSize; |
214 // Load parameter from stack. | 214 // Load parameter from stack. |
215 __ movq(rax, Operand(rbp, parameter_offset)); | 215 __ movq(rax, Operand(rbp, parameter_offset)); |
216 // Store it in the context. | 216 // Store it in the context. |
217 int context_offset = Context::SlotOffset(slot->index()); | 217 int context_offset = Context::SlotOffset(var->index()); |
218 __ movq(Operand(rsi, context_offset), rax); | 218 __ movq(Operand(rsi, context_offset), rax); |
219 // Update the write barrier. This clobbers all involved | 219 // Update the write barrier. This clobbers all involved |
220 // registers, so we have use a third register to avoid | 220 // registers, so we have use a third register to avoid |
221 // clobbering rsi. | 221 // clobbering rsi. |
222 __ movq(rcx, rsi); | 222 __ movq(rcx, rsi); |
223 __ RecordWrite(rcx, context_offset, rax, rbx); | 223 __ RecordWrite(rcx, context_offset, rax, rbx); |
224 } | 224 } |
225 } | 225 } |
226 Comment(";;; End allocate local context"); | 226 Comment(";;; End allocate local context"); |
227 } | 227 } |
(...skipping 3919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4147 RegisterEnvironmentForDeoptimization(environment); | 4147 RegisterEnvironmentForDeoptimization(environment); |
4148 ASSERT(osr_pc_offset_ == -1); | 4148 ASSERT(osr_pc_offset_ == -1); |
4149 osr_pc_offset_ = masm()->pc_offset(); | 4149 osr_pc_offset_ = masm()->pc_offset(); |
4150 } | 4150 } |
4151 | 4151 |
4152 #undef __ | 4152 #undef __ |
4153 | 4153 |
4154 } } // namespace v8::internal | 4154 } } // namespace v8::internal |
4155 | 4155 |
4156 #endif // V8_TARGET_ARCH_X64 | 4156 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |