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

Side by Side Diff: src/x87/full-codegen-x87.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_X87 7 #if V8_TARGET_ARCH_X87
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 function_in_register = false; 201 function_in_register = false;
202 // Context is returned in eax. It replaces the context passed to us. 202 // Context is returned in eax. It replaces the context passed to us.
203 // It's saved in the stack and kept live in esi. 203 // It's saved in the stack and kept live in esi.
204 __ mov(esi, eax); 204 __ mov(esi, eax);
205 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); 205 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax);
206 206
207 // Copy parameters into context if necessary. 207 // Copy parameters into context if necessary.
208 int num_parameters = info->scope()->num_parameters(); 208 int num_parameters = info->scope()->num_parameters();
209 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; 209 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0;
210 for (int i = first_parameter; i < num_parameters; i++) { 210 for (int i = first_parameter; i < num_parameters; i++) {
211 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 211 Variable* var =
212 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
212 if (var->IsContextSlot()) { 213 if (var->IsContextSlot()) {
213 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 214 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
214 (num_parameters - 1 - i) * kPointerSize; 215 (num_parameters - 1 - i) * kPointerSize;
215 // Load parameter from stack. 216 // Load parameter from stack.
216 __ mov(eax, Operand(ebp, parameter_offset)); 217 __ mov(eax, Operand(ebp, parameter_offset));
217 // Store it in the context. 218 // Store it in the context.
218 int context_offset = Context::SlotOffset(var->index()); 219 int context_offset = Context::SlotOffset(var->index());
219 __ mov(Operand(esi, context_offset), eax); 220 __ mov(Operand(esi, context_offset), eax);
220 // Update the write barrier. This clobbers eax and ebx. 221 // Update the write barrier. This clobbers eax and ebx.
221 if (need_write_barrier) { 222 if (need_write_barrier) {
(...skipping 5250 matching lines...) Expand 10 before | Expand all | Expand 10 after
5472 Assembler::target_address_at(call_target_address, 5473 Assembler::target_address_at(call_target_address,
5473 unoptimized_code)); 5474 unoptimized_code));
5474 return OSR_AFTER_STACK_CHECK; 5475 return OSR_AFTER_STACK_CHECK;
5475 } 5476 }
5476 5477
5477 5478
5478 } // namespace internal 5479 } // namespace internal
5479 } // namespace v8 5480 } // namespace v8
5480 5481
5481 #endif // V8_TARGET_ARCH_X87 5482 #endif // V8_TARGET_ARCH_X87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698