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

Side by Side Diff: src/arm/lithium-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
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 #include "src/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 RecordSafepoint(Safepoint::kNoLazyDeopt); 193 RecordSafepoint(Safepoint::kNoLazyDeopt);
194 // Context is returned in both r0 and cp. It replaces the context 194 // Context is returned in both r0 and cp. It replaces the context
195 // passed to us. It's saved in the stack and kept live in cp. 195 // passed to us. It's saved in the stack and kept live in cp.
196 __ mov(cp, r0); 196 __ mov(cp, r0);
197 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 197 __ str(r0, 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 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 200 int first_parameter = scope()->has_this_declaration() ? -1 : 0;
201 for (int i = first_parameter; i < num_parameters; i++) { 201 for (int i = first_parameter; i < num_parameters; i++) {
202 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 202 Variable* var =
203 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
203 if (var->IsContextSlot()) { 204 if (var->IsContextSlot()) {
204 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 205 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
205 (num_parameters - 1 - i) * kPointerSize; 206 (num_parameters - 1 - i) * kPointerSize;
206 // Load parameter from stack. 207 // Load parameter from stack.
207 __ ldr(r0, MemOperand(fp, parameter_offset)); 208 __ ldr(r0, MemOperand(fp, parameter_offset));
208 // Store it in the context. 209 // Store it in the context.
209 MemOperand target = ContextOperand(cp, var->index()); 210 MemOperand target = ContextOperand(cp, var->index());
210 __ str(r0, target); 211 __ str(r0, target);
211 // Update the write barrier. This clobbers r3 and r0. 212 // Update the write barrier. This clobbers r3 and r0.
212 if (need_write_barrier) { 213 if (need_write_barrier) {
(...skipping 5747 matching lines...) Expand 10 before | Expand all | Expand 10 after
5960 __ push(ToRegister(instr->function())); 5961 __ push(ToRegister(instr->function()));
5961 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5962 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5962 RecordSafepoint(Safepoint::kNoLazyDeopt); 5963 RecordSafepoint(Safepoint::kNoLazyDeopt);
5963 } 5964 }
5964 5965
5965 5966
5966 #undef __ 5967 #undef __
5967 5968
5968 } // namespace internal 5969 } // namespace internal
5969 } // namespace v8 5970 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm64/full-codegen-arm64.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698