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/arm64/frames-arm64.h" | 5 #include "src/arm64/frames-arm64.h" |
6 #include "src/arm64/lithium-codegen-arm64.h" | 6 #include "src/arm64/lithium-codegen-arm64.h" |
7 #include "src/arm64/lithium-gap-resolver-arm64.h" | 7 #include "src/arm64/lithium-gap-resolver-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 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2822 void LCodeGen::DoDummy(LDummy* instr) { | 2822 void LCodeGen::DoDummy(LDummy* instr) { |
2823 // Nothing to see here, move on! | 2823 // Nothing to see here, move on! |
2824 } | 2824 } |
2825 | 2825 |
2826 | 2826 |
2827 void LCodeGen::DoDummyUse(LDummyUse* instr) { | 2827 void LCodeGen::DoDummyUse(LDummyUse* instr) { |
2828 // Nothing to see here, move on! | 2828 // Nothing to see here, move on! |
2829 } | 2829 } |
2830 | 2830 |
2831 | 2831 |
2832 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | |
2833 DCHECK(ToRegister(instr->context()).is(cp)); | |
2834 // FunctionLiteral instruction is marked as call, we can trash any register. | |
2835 DCHECK(instr->IsMarkedAsCall()); | |
2836 | |
2837 // Use the fast case closure allocation code that allocates in new | |
2838 // space for nested functions that don't need literals cloning. | |
2839 bool pretenure = instr->hydrogen()->pretenure(); | |
2840 if (!pretenure && instr->hydrogen()->has_no_literals()) { | |
2841 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(), | |
2842 instr->hydrogen()->kind()); | |
2843 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); | |
2844 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
2845 } else { | |
2846 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); | |
2847 __ Mov(x1, Operand(pretenure ? factory()->true_value() | |
2848 : factory()->false_value())); | |
2849 __ Push(cp, x2, x1); | |
2850 CallRuntime(Runtime::kNewClosure, 3, instr); | |
2851 } | |
2852 } | |
2853 | |
2854 | |
2855 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 2832 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
2856 Register map = ToRegister(instr->map()); | 2833 Register map = ToRegister(instr->map()); |
2857 Register result = ToRegister(instr->result()); | 2834 Register result = ToRegister(instr->result()); |
2858 Label load_cache, done; | 2835 Label load_cache, done; |
2859 | 2836 |
2860 __ EnumLengthUntagged(result, map); | 2837 __ EnumLengthUntagged(result, map); |
2861 __ Cbnz(result, &load_cache); | 2838 __ Cbnz(result, &load_cache); |
2862 | 2839 |
2863 __ Mov(result, Operand(isolate()->factory()->empty_fixed_array())); | 2840 __ Mov(result, Operand(isolate()->factory()->empty_fixed_array())); |
2864 __ B(&done); | 2841 __ B(&done); |
(...skipping 3178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6043 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6020 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6044 __ Push(scope_info); | 6021 __ Push(scope_info); |
6045 __ Push(ToRegister(instr->function())); | 6022 __ Push(ToRegister(instr->function())); |
6046 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6023 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6047 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6024 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6048 } | 6025 } |
6049 | 6026 |
6050 | 6027 |
6051 } // namespace internal | 6028 } // namespace internal |
6052 } // namespace v8 | 6029 } // namespace v8 |
OLD | NEW |