OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3665 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 3665 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
3666 } | 3666 } |
3667 | 3667 |
3668 | 3668 |
3669 static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) { | 3669 static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) { |
3670 // Cache the called function in a global property cell. Cache states | 3670 // Cache the called function in a global property cell. Cache states |
3671 // are uninitialized, monomorphic (indicated by a JSFunction), and | 3671 // are uninitialized, monomorphic (indicated by a JSFunction), and |
3672 // megamorphic. | 3672 // megamorphic. |
3673 // rbx : cache cell for call target | 3673 // rbx : cache cell for call target |
3674 // rdi : the function to call | 3674 // rdi : the function to call |
3675 ASSERT(!FLAG_optimize_constructed_arrays); | |
3676 Isolate* isolate = masm->isolate(); | 3675 Isolate* isolate = masm->isolate(); |
3677 Label initialize, done; | 3676 Label initialize, done; |
3678 | 3677 |
3679 // Load the cache state into rcx. | 3678 // Load the cache state into rcx. |
3680 __ movq(rcx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); | 3679 __ movq(rcx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); |
3681 | 3680 |
3682 // A monomorphic cache hit or an already megamorphic state: invoke the | 3681 // A monomorphic cache hit or an already megamorphic state: invoke the |
3683 // function without changing the state. | 3682 // function without changing the state. |
3684 __ cmpq(rcx, rdi); | 3683 __ cmpq(rcx, rdi); |
3685 __ j(equal, &done, Label::kNear); | 3684 __ j(equal, &done, Label::kNear); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3803 __ bind(&call); | 3802 __ bind(&call); |
3804 } | 3803 } |
3805 | 3804 |
3806 // Check that the function really is a JavaScript function. | 3805 // Check that the function really is a JavaScript function. |
3807 __ JumpIfSmi(rdi, &non_function); | 3806 __ JumpIfSmi(rdi, &non_function); |
3808 // Goto slow case if we do not have a function. | 3807 // Goto slow case if we do not have a function. |
3809 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); | 3808 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
3810 __ j(not_equal, &slow); | 3809 __ j(not_equal, &slow); |
3811 | 3810 |
3812 if (RecordCallTarget()) { | 3811 if (RecordCallTarget()) { |
3813 if (FLAG_optimize_constructed_arrays) { | 3812 GenerateRecordCallTargetNoArray(masm); |
3814 GenerateRecordCallTarget(masm); | |
3815 } else { | |
3816 GenerateRecordCallTargetNoArray(masm); | |
3817 } | |
3818 } | 3813 } |
3819 | 3814 |
3820 // Fast-case: Just invoke the function. | 3815 // Fast-case: Just invoke the function. |
3821 ParameterCount actual(argc_); | 3816 ParameterCount actual(argc_); |
3822 | 3817 |
3823 if (ReceiverMightBeImplicit()) { | 3818 if (ReceiverMightBeImplicit()) { |
3824 Label call_as_function; | 3819 Label call_as_function; |
3825 __ CompareRoot(rax, Heap::kTheHoleValueRootIndex); | 3820 __ CompareRoot(rax, Heap::kTheHoleValueRootIndex); |
3826 __ j(equal, &call_as_function); | 3821 __ j(equal, &call_as_function); |
3827 __ InvokeFunction(rdi, | 3822 __ InvokeFunction(rdi, |
(...skipping 3097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6925 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 6920 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
6926 } | 6921 } |
6927 } | 6922 } |
6928 | 6923 |
6929 | 6924 |
6930 #undef __ | 6925 #undef __ |
6931 | 6926 |
6932 } } // namespace v8::internal | 6927 } } // namespace v8::internal |
6933 | 6928 |
6934 #endif // V8_TARGET_ARCH_X64 | 6929 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |