| 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 bool need_write_barrier = true; | 611 bool need_write_barrier = true; |
| 612 // Argument to NewContext is the function, which is in x1. | 612 // Argument to NewContext is the function, which is in x1. |
| 613 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 613 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 614 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 614 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
| 615 if (info()->scope()->is_script_scope()) { | 615 if (info()->scope()->is_script_scope()) { |
| 616 __ Mov(x10, Operand(info()->scope()->scope_info())); | 616 __ Mov(x10, Operand(info()->scope()->scope_info())); |
| 617 __ Push(x1, x10); | 617 __ Push(x1, x10); |
| 618 __ CallRuntime(Runtime::kNewScriptContext); | 618 __ CallRuntime(Runtime::kNewScriptContext); |
| 619 deopt_mode = Safepoint::kLazyDeopt; | 619 deopt_mode = Safepoint::kLazyDeopt; |
| 620 } else { | 620 } else { |
| 621 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 621 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { |
| 622 FastNewFunctionContextStub stub(isolate()); | 622 FastNewFunctionContextStub stub(isolate(), |
| 623 info()->scope()->scope_type()); |
| 623 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); | 624 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
| 624 __ CallStub(&stub); | 625 __ CallStub(&stub); |
| 625 // Result of FastNewFunctionContextStub is always in new space. | 626 // Result of FastNewFunctionContextStub is always in new space. |
| 626 need_write_barrier = false; | 627 need_write_barrier = false; |
| 627 } else { | 628 } else { |
| 628 __ Push(x1); | 629 __ Push(x1); |
| 630 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
| 629 __ CallRuntime(Runtime::kNewFunctionContext); | 631 __ CallRuntime(Runtime::kNewFunctionContext); |
| 630 } | 632 } |
| 631 } | 633 } |
| 632 RecordSafepoint(deopt_mode); | 634 RecordSafepoint(deopt_mode); |
| 633 // Context is returned in x0. It replaces the context passed to us. It's | 635 // Context is returned in x0. It replaces the context passed to us. It's |
| 634 // saved in the stack and kept live in cp. | 636 // saved in the stack and kept live in cp. |
| 635 __ Mov(cp, x0); | 637 __ Mov(cp, x0); |
| 636 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 638 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 637 // Copy any necessary parameters into the context. | 639 // Copy any necessary parameters into the context. |
| 638 int num_parameters = info()->scope()->num_parameters(); | 640 int num_parameters = info()->scope()->num_parameters(); |
| (...skipping 4948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5587 // Index is equal to negated out of object property index plus 1. | 5589 // Index is equal to negated out of object property index plus 1. |
| 5588 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5590 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5589 __ Ldr(result, FieldMemOperand(result, | 5591 __ Ldr(result, FieldMemOperand(result, |
| 5590 FixedArray::kHeaderSize - kPointerSize)); | 5592 FixedArray::kHeaderSize - kPointerSize)); |
| 5591 __ Bind(deferred->exit()); | 5593 __ Bind(deferred->exit()); |
| 5592 __ Bind(&done); | 5594 __ Bind(&done); |
| 5593 } | 5595 } |
| 5594 | 5596 |
| 5595 } // namespace internal | 5597 } // namespace internal |
| 5596 } // namespace v8 | 5598 } // namespace v8 |
| OLD | NEW |