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

Side by Side Diff: src/mips/lithium-codegen-mips.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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 RecordSafepoint(Safepoint::kNoLazyDeopt); 213 RecordSafepoint(Safepoint::kNoLazyDeopt);
214 // Context is returned in both v0. It replaces the context passed to us. 214 // Context is returned in both v0. It replaces the context passed to us.
215 // It's saved in the stack and kept live in cp. 215 // It's saved in the stack and kept live in cp.
216 __ mov(cp, v0); 216 __ mov(cp, v0);
217 __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 217 __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset));
218 // Copy any necessary parameters into the context. 218 // Copy any necessary parameters into the context.
219 int num_parameters = scope()->num_parameters(); 219 int num_parameters = scope()->num_parameters();
220 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 220 int first_parameter = scope()->has_this_declaration() ? -1 : 0;
221 for (int i = first_parameter; i < num_parameters; i++) { 221 for (int i = first_parameter; i < num_parameters; i++) {
222 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 222 Variable* var =
223 (i == -1) ? scope()->receiver() : scope()->parameter_var(i);
223 if (var->IsContextSlot()) { 224 if (var->IsContextSlot()) {
224 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 225 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
225 (num_parameters - 1 - i) * kPointerSize; 226 (num_parameters - 1 - i) * kPointerSize;
226 // Load parameter from stack. 227 // Load parameter from stack.
227 __ lw(a0, MemOperand(fp, parameter_offset)); 228 __ lw(a0, MemOperand(fp, parameter_offset));
228 // Store it in the context. 229 // Store it in the context.
229 MemOperand target = ContextOperand(cp, var->index()); 230 MemOperand target = ContextOperand(cp, var->index());
230 __ sw(a0, target); 231 __ sw(a0, target);
231 // Update the write barrier. This clobbers a3 and a0. 232 // Update the write barrier. This clobbers a3 and a0.
232 if (need_write_barrier) { 233 if (need_write_barrier) {
(...skipping 5770 matching lines...) Expand 10 before | Expand all | Expand 10 after
6003 __ Push(at, ToRegister(instr->function())); 6004 __ Push(at, ToRegister(instr->function()));
6004 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6005 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6005 RecordSafepoint(Safepoint::kNoLazyDeopt); 6006 RecordSafepoint(Safepoint::kNoLazyDeopt);
6006 } 6007 }
6007 6008
6008 6009
6009 #undef __ 6010 #undef __
6010 6011
6011 } // namespace internal 6012 } // namespace internal
6012 } // namespace v8 6013 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips64/full-codegen-mips64.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698