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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 // convincing us that we have a monomorphic JSFunction. | 1995 // convincing us that we have a monomorphic JSFunction. |
1996 __ JumpIfSmi(rdi, &extra_checks_or_miss); | 1996 __ JumpIfSmi(rdi, &extra_checks_or_miss); |
1997 | 1997 |
1998 // Increment the call count for monomorphic function calls. | 1998 // Increment the call count for monomorphic function calls. |
1999 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, | 1999 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
2000 FixedArray::kHeaderSize + kPointerSize), | 2000 FixedArray::kHeaderSize + kPointerSize), |
2001 Smi::FromInt(CallICNexus::kCallCountIncrement)); | 2001 Smi::FromInt(CallICNexus::kCallCountIncrement)); |
2002 | 2002 |
2003 __ bind(&call_function); | 2003 __ bind(&call_function); |
2004 __ Set(rax, argc); | 2004 __ Set(rax, argc); |
2005 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), | 2005 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 2006 tail_call_mode()), |
2006 RelocInfo::CODE_TARGET); | 2007 RelocInfo::CODE_TARGET); |
2007 | 2008 |
2008 __ bind(&extra_checks_or_miss); | 2009 __ bind(&extra_checks_or_miss); |
2009 Label uninitialized, miss, not_allocation_site; | 2010 Label uninitialized, miss, not_allocation_site; |
2010 | 2011 |
2011 __ Cmp(rcx, TypeFeedbackVector::MegamorphicSentinel(isolate)); | 2012 __ Cmp(rcx, TypeFeedbackVector::MegamorphicSentinel(isolate)); |
2012 __ j(equal, &call); | 2013 __ j(equal, &call); |
2013 | 2014 |
2014 // Check if we have an allocation site. | 2015 // Check if we have an allocation site. |
2015 __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset), | 2016 __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset), |
(...skipping 17 matching lines...) Expand all Loading... |
2033 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2034 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
2034 // to handle it here. More complex cases are dealt with in the runtime. | 2035 // to handle it here. More complex cases are dealt with in the runtime. |
2035 __ AssertNotSmi(rcx); | 2036 __ AssertNotSmi(rcx); |
2036 __ CmpObjectType(rcx, JS_FUNCTION_TYPE, rcx); | 2037 __ CmpObjectType(rcx, JS_FUNCTION_TYPE, rcx); |
2037 __ j(not_equal, &miss); | 2038 __ j(not_equal, &miss); |
2038 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize), | 2039 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize), |
2039 TypeFeedbackVector::MegamorphicSentinel(isolate)); | 2040 TypeFeedbackVector::MegamorphicSentinel(isolate)); |
2040 | 2041 |
2041 __ bind(&call); | 2042 __ bind(&call); |
2042 __ Set(rax, argc); | 2043 __ Set(rax, argc); |
2043 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), | 2044 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
2044 RelocInfo::CODE_TARGET); | 2045 RelocInfo::CODE_TARGET); |
2045 | 2046 |
2046 __ bind(&uninitialized); | 2047 __ bind(&uninitialized); |
2047 | 2048 |
2048 // We are going monomorphic, provided we actually have a JSFunction. | 2049 // We are going monomorphic, provided we actually have a JSFunction. |
2049 __ JumpIfSmi(rdi, &miss); | 2050 __ JumpIfSmi(rdi, &miss); |
2050 | 2051 |
2051 // Goto miss case if we do not have a function. | 2052 // Goto miss case if we do not have a function. |
2052 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); | 2053 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
2053 __ j(not_equal, &miss); | 2054 __ j(not_equal, &miss); |
(...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5460 NULL); | 5461 NULL); |
5461 } | 5462 } |
5462 | 5463 |
5463 | 5464 |
5464 #undef __ | 5465 #undef __ |
5465 | 5466 |
5466 } // namespace internal | 5467 } // namespace internal |
5467 } // namespace v8 | 5468 } // namespace v8 |
5468 | 5469 |
5469 #endif // V8_TARGET_ARCH_X64 | 5470 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |