Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 1189743003: [destructuring] Implement parameter pattern matching. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 function_in_register = false; 200 function_in_register = false;
201 // Context is returned in rax. It replaces the context passed to us. 201 // Context is returned in rax. It replaces the context passed to us.
202 // It's saved in the stack and kept live in rsi. 202 // It's saved in the stack and kept live in rsi.
203 __ movp(rsi, rax); 203 __ movp(rsi, rax);
204 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); 204 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax);
205 205
206 // Copy any necessary parameters into the context. 206 // Copy any necessary parameters into the context.
207 int num_parameters = info->scope()->num_parameters(); 207 int num_parameters = info->scope()->num_parameters();
208 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; 208 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0;
209 for (int i = first_parameter; i < num_parameters; i++) { 209 for (int i = first_parameter; i < num_parameters; i++) {
210 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 210 Variable* var =
211 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
211 if (var->IsContextSlot()) { 212 if (var->IsContextSlot()) {
212 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 213 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
213 (num_parameters - 1 - i) * kPointerSize; 214 (num_parameters - 1 - i) * kPointerSize;
214 // Load parameter from stack. 215 // Load parameter from stack.
215 __ movp(rax, Operand(rbp, parameter_offset)); 216 __ movp(rax, Operand(rbp, parameter_offset));
216 // Store it in the context. 217 // Store it in the context.
217 int context_offset = Context::SlotOffset(var->index()); 218 int context_offset = Context::SlotOffset(var->index());
218 __ movp(Operand(rsi, context_offset), rax); 219 __ movp(Operand(rsi, context_offset), rax);
219 // Update the write barrier. This clobbers rax and rbx. 220 // Update the write barrier. This clobbers rax and rbx.
220 if (need_write_barrier) { 221 if (need_write_barrier) {
(...skipping 5282 matching lines...) Expand 10 before | Expand all | Expand 10 after
5503 Assembler::target_address_at(call_target_address, 5504 Assembler::target_address_at(call_target_address,
5504 unoptimized_code)); 5505 unoptimized_code));
5505 return OSR_AFTER_STACK_CHECK; 5506 return OSR_AFTER_STACK_CHECK;
5506 } 5507 }
5507 5508
5508 5509
5509 } // namespace internal 5510 } // namespace internal
5510 } // namespace v8 5511 } // namespace v8
5511 5512
5512 #endif // V8_TARGET_ARCH_X64 5513 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698