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

Side by Side Diff: src/arm/full-codegen-arm.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
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ARM 7 #if V8_TARGET_ARCH_ARM
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 function_in_register = false; 208 function_in_register = false;
209 // Context is returned in r0. It replaces the context passed to us. 209 // Context is returned in r0. It replaces the context passed to us.
210 // It's saved in the stack and kept live in cp. 210 // It's saved in the stack and kept live in cp.
211 __ mov(cp, r0); 211 __ mov(cp, r0);
212 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 212 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset));
213 // Copy any necessary parameters into the context. 213 // Copy any necessary parameters into the context.
214 int num_parameters = info->scope()->num_parameters(); 214 int num_parameters = info->scope()->num_parameters();
215 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; 215 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0;
216 for (int i = first_parameter; i < num_parameters; i++) { 216 for (int i = first_parameter; i < num_parameters; i++) {
217 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 217 Variable* var =
218 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
218 if (var->IsContextSlot()) { 219 if (var->IsContextSlot()) {
219 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 220 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
220 (num_parameters - 1 - i) * kPointerSize; 221 (num_parameters - 1 - i) * kPointerSize;
221 // Load parameter from stack. 222 // Load parameter from stack.
222 __ ldr(r0, MemOperand(fp, parameter_offset)); 223 __ ldr(r0, MemOperand(fp, parameter_offset));
223 // Store it in the context. 224 // Store it in the context.
224 MemOperand target = ContextOperand(cp, var->index()); 225 MemOperand target = ContextOperand(cp, var->index());
225 __ str(r0, target); 226 __ str(r0, target);
226 227
227 // Update the write barrier. 228 // Update the write barrier.
(...skipping 5388 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 DCHECK(interrupt_address == 5617 DCHECK(interrupt_address ==
5617 isolate->builtins()->OsrAfterStackCheck()->entry()); 5618 isolate->builtins()->OsrAfterStackCheck()->entry());
5618 return OSR_AFTER_STACK_CHECK; 5619 return OSR_AFTER_STACK_CHECK;
5619 } 5620 }
5620 5621
5621 5622
5622 } // namespace internal 5623 } // namespace internal
5623 } // namespace v8 5624 } // namespace v8
5624 5625
5625 #endif // V8_TARGET_ARCH_ARM 5626 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698