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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 // Try to confirm that function_reg (x1) is a tagged pointer. | 1972 // Try to confirm that function_reg (x1) is a tagged pointer. |
1973 __ JumpIfNotSmi(function_reg, &is_not_smi); | 1973 __ JumpIfNotSmi(function_reg, &is_not_smi); |
1974 __ Abort(kExpectedFunctionObject); | 1974 __ Abort(kExpectedFunctionObject); |
1975 __ Bind(&is_not_smi); | 1975 __ Bind(&is_not_smi); |
1976 } | 1976 } |
1977 | 1977 |
1978 if (can_invoke_directly) { | 1978 if (can_invoke_directly) { |
1979 // Change context. | 1979 // Change context. |
1980 __ Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); | 1980 __ Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
1981 | 1981 |
1982 // Always initialize x0 to the number of actual arguments. | 1982 // Always initialize new target and number of actual arguments. |
| 1983 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); |
1983 __ Mov(arity_reg, arity); | 1984 __ Mov(arity_reg, arity); |
1984 | 1985 |
1985 // Invoke function. | 1986 // Invoke function. |
1986 __ Ldr(x10, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); | 1987 __ Ldr(x10, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); |
1987 __ Call(x10); | 1988 __ Call(x10); |
1988 | 1989 |
1989 // Set up deoptimization. | 1990 // Set up deoptimization. |
1990 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 1991 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
1991 } else { | 1992 } else { |
1992 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 1993 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 } | 2041 } |
2041 | 2042 |
2042 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 2043 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
2043 } | 2044 } |
2044 | 2045 |
2045 | 2046 |
2046 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | 2047 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
2047 DCHECK(instr->IsMarkedAsCall()); | 2048 DCHECK(instr->IsMarkedAsCall()); |
2048 DCHECK(ToRegister(instr->function()).is(x1)); | 2049 DCHECK(ToRegister(instr->function()).is(x1)); |
2049 | 2050 |
2050 __ Mov(x0, Operand(instr->arity())); | |
2051 | |
2052 // Change context. | 2051 // Change context. |
2053 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 2052 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
2054 | 2053 |
| 2054 // Always initialize new target and number of actual arguments. |
| 2055 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); |
| 2056 __ Mov(x0, instr->arity()); |
| 2057 |
2055 // Load the code entry address | 2058 // Load the code entry address |
2056 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); | 2059 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); |
2057 __ Call(x10); | 2060 __ Call(x10); |
2058 | 2061 |
2059 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 2062 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
2060 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 2063 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
2061 } | 2064 } |
2062 | 2065 |
2063 | 2066 |
2064 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 2067 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
(...skipping 3885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5950 Handle<ScopeInfo> scope_info = instr->scope_info(); | 5953 Handle<ScopeInfo> scope_info = instr->scope_info(); |
5951 __ Push(scope_info); | 5954 __ Push(scope_info); |
5952 __ Push(ToRegister(instr->function())); | 5955 __ Push(ToRegister(instr->function())); |
5953 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5956 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5954 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5957 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5955 } | 5958 } |
5956 | 5959 |
5957 | 5960 |
5958 } // namespace internal | 5961 } // namespace internal |
5959 } // namespace v8 | 5962 } // namespace v8 |
OLD | NEW |