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 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1989 // Try to confirm that function_reg (x1) is a tagged pointer. | 1989 // Try to confirm that function_reg (x1) is a tagged pointer. |
1990 __ JumpIfNotSmi(function_reg, &is_not_smi); | 1990 __ JumpIfNotSmi(function_reg, &is_not_smi); |
1991 __ Abort(kExpectedFunctionObject); | 1991 __ Abort(kExpectedFunctionObject); |
1992 __ Bind(&is_not_smi); | 1992 __ Bind(&is_not_smi); |
1993 } | 1993 } |
1994 | 1994 |
1995 if (can_invoke_directly) { | 1995 if (can_invoke_directly) { |
1996 // Change context. | 1996 // Change context. |
1997 __ Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); | 1997 __ Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
1998 | 1998 |
1999 // Set the arguments count if adaption is not needed. Assumes that x0 is | 1999 // Always initialize x0 to the number of actual arguments. |
2000 // available to write to at this point. | 2000 __ Mov(arity_reg, arity); |
2001 if (dont_adapt_arguments) { | |
2002 __ Mov(arity_reg, arity); | |
2003 } | |
2004 | 2001 |
2005 // Invoke function. | 2002 // Invoke function. |
2006 __ Ldr(x10, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); | 2003 __ Ldr(x10, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); |
2007 __ Call(x10); | 2004 __ Call(x10); |
2008 | 2005 |
2009 // Set up deoptimization. | 2006 // Set up deoptimization. |
2010 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 2007 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
2011 } else { | 2008 } else { |
2012 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 2009 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
2013 ParameterCount count(arity); | 2010 ParameterCount count(arity); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 } | 2057 } |
2061 | 2058 |
2062 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 2059 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
2063 } | 2060 } |
2064 | 2061 |
2065 | 2062 |
2066 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | 2063 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
2067 DCHECK(instr->IsMarkedAsCall()); | 2064 DCHECK(instr->IsMarkedAsCall()); |
2068 DCHECK(ToRegister(instr->function()).is(x1)); | 2065 DCHECK(ToRegister(instr->function()).is(x1)); |
2069 | 2066 |
2070 if (instr->hydrogen()->pass_argument_count()) { | 2067 __ Mov(x0, Operand(instr->arity())); |
2071 __ Mov(x0, Operand(instr->arity())); | |
2072 } | |
2073 | 2068 |
2074 // Change context. | 2069 // Change context. |
2075 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 2070 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
2076 | 2071 |
2077 // Load the code entry address | 2072 // Load the code entry address |
2078 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); | 2073 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); |
2079 __ Call(x10); | 2074 __ Call(x10); |
2080 | 2075 |
2081 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 2076 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
2082 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 2077 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
(...skipping 3965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6048 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6043 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6049 __ Push(scope_info); | 6044 __ Push(scope_info); |
6050 __ Push(ToRegister(instr->function())); | 6045 __ Push(ToRegister(instr->function())); |
6051 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6046 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6052 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6047 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6053 } | 6048 } |
6054 | 6049 |
6055 | 6050 |
6056 } // namespace internal | 6051 } // namespace internal |
6057 } // namespace v8 | 6052 } // namespace v8 |
OLD | NEW |