OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r5); | 1933 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r5); |
1934 __ cmp(r1, r5); | 1934 __ cmp(r1, r5); |
1935 __ b(ne, miss); | 1935 __ b(ne, miss); |
1936 | 1936 |
1937 __ mov(r0, Operand(arg_count())); | 1937 __ mov(r0, Operand(arg_count())); |
1938 | 1938 |
1939 // Increment the call count for monomorphic function calls. | 1939 // Increment the call count for monomorphic function calls. |
1940 __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); | 1940 __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); |
1941 __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); | 1941 __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); |
1942 __ ldr(r3, FieldMemOperand(r2, 0)); | 1942 __ ldr(r3, FieldMemOperand(r2, 0)); |
1943 __ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1943 __ add(r3, r3, Operand(Smi::FromInt(1))); |
1944 __ str(r3, FieldMemOperand(r2, 0)); | 1944 __ str(r3, FieldMemOperand(r2, 0)); |
1945 | 1945 |
1946 __ mov(r2, r4); | 1946 __ mov(r2, r4); |
1947 __ mov(r3, r1); | 1947 __ mov(r3, r1); |
1948 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 1948 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
1949 __ TailCallStub(&stub); | 1949 __ TailCallStub(&stub); |
1950 } | 1950 } |
1951 | 1951 |
1952 | 1952 |
1953 void CallICStub::Generate(MacroAssembler* masm) { | 1953 void CallICStub::Generate(MacroAssembler* masm) { |
(...skipping 27 matching lines...) Expand all Loading... |
1981 __ b(ne, &extra_checks_or_miss); | 1981 __ b(ne, &extra_checks_or_miss); |
1982 | 1982 |
1983 // The compare above could have been a SMI/SMI comparison. Guard against this | 1983 // The compare above could have been a SMI/SMI comparison. Guard against this |
1984 // convincing us that we have a monomorphic JSFunction. | 1984 // convincing us that we have a monomorphic JSFunction. |
1985 __ JumpIfSmi(r1, &extra_checks_or_miss); | 1985 __ JumpIfSmi(r1, &extra_checks_or_miss); |
1986 | 1986 |
1987 // Increment the call count for monomorphic function calls. | 1987 // Increment the call count for monomorphic function calls. |
1988 __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); | 1988 __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); |
1989 __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); | 1989 __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); |
1990 __ ldr(r3, FieldMemOperand(r2, 0)); | 1990 __ ldr(r3, FieldMemOperand(r2, 0)); |
1991 __ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1991 __ add(r3, r3, Operand(Smi::FromInt(1))); |
1992 __ str(r3, FieldMemOperand(r2, 0)); | 1992 __ str(r3, FieldMemOperand(r2, 0)); |
1993 | 1993 |
1994 __ bind(&call_function); | 1994 __ bind(&call_function); |
1995 __ mov(r0, Operand(argc)); | 1995 __ mov(r0, Operand(argc)); |
1996 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), | 1996 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
1997 tail_call_mode()), | 1997 tail_call_mode()), |
1998 RelocInfo::CODE_TARGET); | 1998 RelocInfo::CODE_TARGET); |
1999 | 1999 |
2000 __ bind(&extra_checks_or_miss); | 2000 __ bind(&extra_checks_or_miss); |
2001 Label uninitialized, miss, not_allocation_site; | 2001 Label uninitialized, miss, not_allocation_site; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 __ b(eq, &miss); | 2052 __ b(eq, &miss); |
2053 | 2053 |
2054 // Make sure the function belongs to the same native context. | 2054 // Make sure the function belongs to the same native context. |
2055 __ ldr(r4, FieldMemOperand(r1, JSFunction::kContextOffset)); | 2055 __ ldr(r4, FieldMemOperand(r1, JSFunction::kContextOffset)); |
2056 __ ldr(r4, ContextMemOperand(r4, Context::NATIVE_CONTEXT_INDEX)); | 2056 __ ldr(r4, ContextMemOperand(r4, Context::NATIVE_CONTEXT_INDEX)); |
2057 __ ldr(ip, NativeContextMemOperand()); | 2057 __ ldr(ip, NativeContextMemOperand()); |
2058 __ cmp(r4, ip); | 2058 __ cmp(r4, ip); |
2059 __ b(ne, &miss); | 2059 __ b(ne, &miss); |
2060 | 2060 |
2061 // Initialize the call counter. | 2061 // Initialize the call counter. |
2062 __ Move(r5, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2062 __ Move(r5, Operand(Smi::FromInt(1))); |
2063 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 2063 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
2064 __ str(r5, FieldMemOperand(r4, FixedArray::kHeaderSize + kPointerSize)); | 2064 __ str(r5, FieldMemOperand(r4, FixedArray::kHeaderSize + kPointerSize)); |
2065 | 2065 |
2066 // Store the function. Use a stub since we need a frame for allocation. | 2066 // Store the function. Use a stub since we need a frame for allocation. |
2067 // r2 - vector | 2067 // r2 - vector |
2068 // r3 - slot | 2068 // r3 - slot |
2069 // r1 - function | 2069 // r1 - function |
2070 { | 2070 { |
2071 FrameScope scope(masm, StackFrame::INTERNAL); | 2071 FrameScope scope(masm, StackFrame::INTERNAL); |
2072 CreateWeakCellStub create_stub(masm->isolate()); | 2072 CreateWeakCellStub create_stub(masm->isolate()); |
(...skipping 3365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5438 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5438 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5439 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5439 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5440 } | 5440 } |
5441 | 5441 |
5442 #undef __ | 5442 #undef __ |
5443 | 5443 |
5444 } // namespace internal | 5444 } // namespace internal |
5445 } // namespace v8 | 5445 } // namespace v8 |
5446 | 5446 |
5447 #endif // V8_TARGET_ARCH_ARM | 5447 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |