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

Side by Side Diff: src/arm64/full-codegen-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 function_in_register_x1 = false; 209 function_in_register_x1 = false;
210 // Context is returned in x0. It replaces the context passed to us. 210 // Context is returned in x0. It replaces the context passed to us.
211 // It's saved in the stack and kept live in cp. 211 // It's saved in the stack and kept live in cp.
212 __ Mov(cp, x0); 212 __ Mov(cp, x0);
213 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 213 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset));
214 // Copy any necessary parameters into the context. 214 // Copy any necessary parameters into the context.
215 int num_parameters = info->scope()->num_parameters(); 215 int num_parameters = info->scope()->num_parameters();
216 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; 216 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0;
217 for (int i = first_parameter; i < num_parameters; i++) { 217 for (int i = first_parameter; i < num_parameters; i++) {
218 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 218 Variable* var =
219 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
219 if (var->IsContextSlot()) { 220 if (var->IsContextSlot()) {
220 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 221 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
221 (num_parameters - 1 - i) * kPointerSize; 222 (num_parameters - 1 - i) * kPointerSize;
222 // Load parameter from stack. 223 // Load parameter from stack.
223 __ Ldr(x10, MemOperand(fp, parameter_offset)); 224 __ Ldr(x10, MemOperand(fp, parameter_offset));
224 // Store it in the context. 225 // Store it in the context.
225 MemOperand target = ContextMemOperand(cp, var->index()); 226 MemOperand target = ContextMemOperand(cp, var->index());
226 __ Str(x10, target); 227 __ Str(x10, target);
227 228
228 // Update the write barrier. 229 // Update the write barrier.
(...skipping 5356 matching lines...) Expand 10 before | Expand all | Expand 10 after
5585 } 5586 }
5586 5587
5587 return INTERRUPT; 5588 return INTERRUPT;
5588 } 5589 }
5589 5590
5590 5591
5591 } // namespace internal 5592 } // namespace internal
5592 } // namespace v8 5593 } // namespace v8
5593 5594
5594 #endif // V8_TARGET_ARCH_ARM64 5595 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698