| OLD | NEW |
| 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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 __ CallStub(&stub); | 600 __ CallStub(&stub); |
| 601 // Result of FastNewFunctionContextStub is always in new space. | 601 // Result of FastNewFunctionContextStub is always in new space. |
| 602 need_write_barrier = false; | 602 need_write_barrier = false; |
| 603 } | 603 } |
| 604 RecordSafepoint(deopt_mode); | 604 RecordSafepoint(deopt_mode); |
| 605 // Context is returned in x0. It replaces the context passed to us. It's | 605 // Context is returned in x0. It replaces the context passed to us. It's |
| 606 // saved in the stack and kept live in cp. | 606 // saved in the stack and kept live in cp. |
| 607 __ Mov(cp, x0); | 607 __ Mov(cp, x0); |
| 608 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 608 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 609 // Copy any necessary parameters into the context. | 609 // Copy any necessary parameters into the context. |
| 610 int num_parameters = info()->scope()->num_parameters(); | 610 int num_parameters = scope()->num_parameters(); |
| 611 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; | 611 int first_parameter = scope()->has_this_declaration() ? -1 : 0; |
| 612 for (int i = first_parameter; i < num_parameters; i++) { | 612 for (int i = first_parameter; i < num_parameters; i++) { |
| 613 Variable* var = (i == -1) ? info()->scope()->receiver() | 613 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); |
| 614 : info()->scope()->parameter(i); | |
| 615 if (var->IsContextSlot()) { | 614 if (var->IsContextSlot()) { |
| 616 Register value = x0; | 615 Register value = x0; |
| 617 Register scratch = x3; | 616 Register scratch = x3; |
| 618 | 617 |
| 619 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 618 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| 620 (num_parameters - 1 - i) * kPointerSize; | 619 (num_parameters - 1 - i) * kPointerSize; |
| 621 // Load parameter from stack. | 620 // Load parameter from stack. |
| 622 __ Ldr(value, MemOperand(fp, parameter_offset)); | 621 __ Ldr(value, MemOperand(fp, parameter_offset)); |
| 623 // Store it in the context. | 622 // Store it in the context. |
| 624 MemOperand target = ContextMemOperand(cp, var->index()); | 623 MemOperand target = ContextMemOperand(cp, var->index()); |
| (...skipping 5073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5698 // Index is equal to negated out of object property index plus 1. | 5697 // Index is equal to negated out of object property index plus 1. |
| 5699 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5698 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5700 __ Ldr(result, FieldMemOperand(result, | 5699 __ Ldr(result, FieldMemOperand(result, |
| 5701 FixedArray::kHeaderSize - kPointerSize)); | 5700 FixedArray::kHeaderSize - kPointerSize)); |
| 5702 __ Bind(deferred->exit()); | 5701 __ Bind(deferred->exit()); |
| 5703 __ Bind(&done); | 5702 __ Bind(&done); |
| 5704 } | 5703 } |
| 5705 | 5704 |
| 5706 } // namespace internal | 5705 } // namespace internal |
| 5707 } // namespace v8 | 5706 } // namespace v8 |
| OLD | NEW |