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

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.h"
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 need_write_barrier = false; 189 need_write_barrier = false;
190 } 190 }
191 RecordSafepoint(deopt_mode); 191 RecordSafepoint(deopt_mode);
192 192
193 // Context is returned in rax. It replaces the context passed to us. 193 // Context is returned in rax. It replaces the context passed to us.
194 // It's saved in the stack and kept live in rsi. 194 // It's saved in the stack and kept live in rsi.
195 __ movp(rsi, rax); 195 __ movp(rsi, rax);
196 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); 196 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax);
197 197
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 = info()->scope()->num_parameters();
200 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 200 int first_parameter = info()->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 = (i == -1) ? info()->scope()->receiver()
203 : info()->scope()->parameter(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 __ movp(rax, Operand(rbp, parameter_offset)); 208 __ movp(rax, Operand(rbp, parameter_offset));
208 // Store it in the context. 209 // Store it in the context.
209 int context_offset = Context::SlotOffset(var->index()); 210 int context_offset = Context::SlotOffset(var->index());
210 __ movp(Operand(rsi, context_offset), rax); 211 __ movp(Operand(rsi, context_offset), rax);
211 // Update the write barrier. This clobbers rax and rbx. 212 // Update the write barrier. This clobbers rax and rbx.
212 if (need_write_barrier) { 213 if (need_write_barrier) {
(...skipping 5352 matching lines...) Expand 10 before | Expand all | Expand 10 after
5565 __ bind(deferred->exit()); 5566 __ bind(deferred->exit());
5566 __ bind(&done); 5567 __ bind(&done);
5567 } 5568 }
5568 5569
5569 #undef __ 5570 #undef __
5570 5571
5571 } // namespace internal 5572 } // namespace internal
5572 } // namespace v8 5573 } // namespace v8
5573 5574
5574 #endif // V8_TARGET_ARCH_X64 5575 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698