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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.cc

Issue 2209573002: Separate Scope into DeclarationScope and Scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move has_simple_parameters_ to DeclarationScope Created 4 years, 4 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // Result of FastNewFunctionContextStub is always in new space. 192 // Result of FastNewFunctionContextStub is always in new space.
193 need_write_barrier = false; 193 need_write_barrier = false;
194 } 194 }
195 RecordSafepoint(deopt_mode); 195 RecordSafepoint(deopt_mode);
196 196
197 // Context is returned in both v0. It replaces the context passed to us. 197 // Context is returned in both v0. It replaces the context passed to us.
198 // It's saved in the stack and kept live in cp. 198 // It's saved in the stack and kept live in cp.
199 __ mov(cp, v0); 199 __ mov(cp, v0);
200 __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 200 __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset));
201 // Copy any necessary parameters into the context. 201 // Copy any necessary parameters into the context.
202 int num_parameters = scope()->num_parameters(); 202 int num_parameters = info()->scope()->num_parameters();
203 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 203 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0;
204 for (int i = first_parameter; i < num_parameters; i++) { 204 for (int i = first_parameter; i < num_parameters; i++) {
205 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); 205 Variable* var = (i == -1) ? info()->scope()->receiver()
206 : info()->scope()->parameter(i);
206 if (var->IsContextSlot()) { 207 if (var->IsContextSlot()) {
207 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 208 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
208 (num_parameters - 1 - i) * kPointerSize; 209 (num_parameters - 1 - i) * kPointerSize;
209 // Load parameter from stack. 210 // Load parameter from stack.
210 __ lw(a0, MemOperand(fp, parameter_offset)); 211 __ lw(a0, MemOperand(fp, parameter_offset));
211 // Store it in the context. 212 // Store it in the context.
212 MemOperand target = ContextMemOperand(cp, var->index()); 213 MemOperand target = ContextMemOperand(cp, var->index());
213 __ sw(a0, target); 214 __ sw(a0, target);
214 // Update the write barrier. This clobbers a3 and a0. 215 // Update the write barrier. This clobbers a3 and a0.
215 if (need_write_barrier) { 216 if (need_write_barrier) {
(...skipping 5322 matching lines...) Expand 10 before | Expand all | Expand 10 after
5538 __ lw(result, FieldMemOperand(scratch, 5539 __ lw(result, FieldMemOperand(scratch,
5539 FixedArray::kHeaderSize - kPointerSize)); 5540 FixedArray::kHeaderSize - kPointerSize));
5540 __ bind(deferred->exit()); 5541 __ bind(deferred->exit());
5541 __ bind(&done); 5542 __ bind(&done);
5542 } 5543 }
5543 5544
5544 #undef __ 5545 #undef __
5545 5546
5546 } // namespace internal 5547 } // namespace internal
5547 } // namespace v8 5548 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698