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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 RecordSafepoint(Safepoint::kNoLazyDeopt); 270 RecordSafepoint(Safepoint::kNoLazyDeopt);
271 // Context is returned in eax. It replaces the context passed to us. 271 // Context is returned in eax. It replaces the context passed to us.
272 // It's saved in the stack and kept live in esi. 272 // It's saved in the stack and kept live in esi.
273 __ mov(esi, eax); 273 __ mov(esi, eax);
274 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); 274 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax);
275 275
276 // Copy parameters into context if necessary. 276 // Copy parameters into context if necessary.
277 int num_parameters = scope()->num_parameters(); 277 int num_parameters = scope()->num_parameters();
278 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 278 int first_parameter = scope()->has_this_declaration() ? -1 : 0;
279 for (int i = first_parameter; i < num_parameters; i++) { 279 for (int i = first_parameter; i < num_parameters; i++) {
280 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 280 Variable* var =
281 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
281 if (var->IsContextSlot()) { 282 if (var->IsContextSlot()) {
282 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 283 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
283 (num_parameters - 1 - i) * kPointerSize; 284 (num_parameters - 1 - i) * kPointerSize;
284 // Load parameter from stack. 285 // Load parameter from stack.
285 __ mov(eax, Operand(ebp, parameter_offset)); 286 __ mov(eax, Operand(ebp, parameter_offset));
286 // Store it in the context. 287 // Store it in the context.
287 int context_offset = Context::SlotOffset(var->index()); 288 int context_offset = Context::SlotOffset(var->index());
288 __ mov(Operand(esi, context_offset), eax); 289 __ mov(Operand(esi, context_offset), eax);
289 // Update the write barrier. This clobbers eax and ebx. 290 // Update the write barrier. This clobbers eax and ebx.
290 if (need_write_barrier) { 291 if (need_write_barrier) {
(...skipping 5492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5783 RecordSafepoint(Safepoint::kNoLazyDeopt); 5784 RecordSafepoint(Safepoint::kNoLazyDeopt);
5784 } 5785 }
5785 5786
5786 5787
5787 #undef __ 5788 #undef __
5788 5789
5789 } // namespace internal 5790 } // namespace internal
5790 } // namespace v8 5791 } // namespace v8
5791 5792
5792 #endif // V8_TARGET_ARCH_IA32 5793 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698