| 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 4619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4630 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 4630 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
| 4631 } | 4631 } |
| 4632 | 4632 |
| 4633 | 4633 |
| 4634 static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) { | 4634 static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) { |
| 4635 // Cache the called function in a global property cell. Cache states | 4635 // Cache the called function in a global property cell. Cache states |
| 4636 // are uninitialized, monomorphic (indicated by a JSFunction), and | 4636 // are uninitialized, monomorphic (indicated by a JSFunction), and |
| 4637 // megamorphic. | 4637 // megamorphic. |
| 4638 // ebx : cache cell for call target | 4638 // ebx : cache cell for call target |
| 4639 // edi : the function to call | 4639 // edi : the function to call |
| 4640 ASSERT(!FLAG_optimize_constructed_arrays); | |
| 4641 Isolate* isolate = masm->isolate(); | 4640 Isolate* isolate = masm->isolate(); |
| 4642 Label initialize, done; | 4641 Label initialize, done; |
| 4643 | 4642 |
| 4644 // Load the cache state into ecx. | 4643 // Load the cache state into ecx. |
| 4645 __ mov(ecx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset)); | 4644 __ mov(ecx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset)); |
| 4646 | 4645 |
| 4647 // A monomorphic cache hit or an already megamorphic state: invoke the | 4646 // A monomorphic cache hit or an already megamorphic state: invoke the |
| 4648 // function without changing the state. | 4647 // function without changing the state. |
| 4649 __ cmp(ecx, edi); | 4648 __ cmp(ecx, edi); |
| 4650 __ j(equal, &done, Label::kNear); | 4649 __ j(equal, &done, Label::kNear); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4771 __ bind(&receiver_ok); | 4770 __ bind(&receiver_ok); |
| 4772 } | 4771 } |
| 4773 | 4772 |
| 4774 // Check that the function really is a JavaScript function. | 4773 // Check that the function really is a JavaScript function. |
| 4775 __ JumpIfSmi(edi, &non_function); | 4774 __ JumpIfSmi(edi, &non_function); |
| 4776 // Goto slow case if we do not have a function. | 4775 // Goto slow case if we do not have a function. |
| 4777 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 4776 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| 4778 __ j(not_equal, &slow); | 4777 __ j(not_equal, &slow); |
| 4779 | 4778 |
| 4780 if (RecordCallTarget()) { | 4779 if (RecordCallTarget()) { |
| 4781 if (FLAG_optimize_constructed_arrays) { | 4780 GenerateRecordCallTargetNoArray(masm); |
| 4782 GenerateRecordCallTarget(masm); | |
| 4783 } else { | |
| 4784 GenerateRecordCallTargetNoArray(masm); | |
| 4785 } | |
| 4786 } | 4781 } |
| 4787 | 4782 |
| 4788 // Fast-case: Just invoke the function. | 4783 // Fast-case: Just invoke the function. |
| 4789 ParameterCount actual(argc_); | 4784 ParameterCount actual(argc_); |
| 4790 | 4785 |
| 4791 if (ReceiverMightBeImplicit()) { | 4786 if (ReceiverMightBeImplicit()) { |
| 4792 Label call_as_function; | 4787 Label call_as_function; |
| 4793 __ cmp(eax, isolate->factory()->the_hole_value()); | 4788 __ cmp(eax, isolate->factory()->the_hole_value()); |
| 4794 __ j(equal, &call_as_function); | 4789 __ j(equal, &call_as_function); |
| 4795 __ InvokeFunction(edi, | 4790 __ InvokeFunction(edi, |
| (...skipping 3126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7922 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 7917 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 7923 } | 7918 } |
| 7924 } | 7919 } |
| 7925 | 7920 |
| 7926 | 7921 |
| 7927 #undef __ | 7922 #undef __ |
| 7928 | 7923 |
| 7929 } } // namespace v8::internal | 7924 } } // namespace v8::internal |
| 7930 | 7925 |
| 7931 #endif // V8_TARGET_ARCH_IA32 | 7926 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |