| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalContextOffset)); | 824 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalContextOffset)); |
| 825 __ mov(ebx, FieldOperand(ebx, kGlobalOffset)); | 825 __ mov(ebx, FieldOperand(ebx, kGlobalOffset)); |
| 826 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); | 826 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); |
| 827 | 827 |
| 828 // Push the receiver. | 828 // Push the receiver. |
| 829 __ bind(&push_receiver); | 829 __ bind(&push_receiver); |
| 830 __ push(ebx); | 830 __ push(ebx); |
| 831 | 831 |
| 832 // Copy all arguments from the array to the stack. | 832 // Copy all arguments from the array to the stack. |
| 833 Label entry, loop; | 833 Label entry, loop; |
| 834 __ mov(eax, Operand(ebp, kIndexOffset)); | 834 __ mov(ecx, Operand(ebp, kIndexOffset)); |
| 835 __ jmp(&entry); | 835 __ jmp(&entry); |
| 836 __ bind(&loop); | 836 __ bind(&loop); |
| 837 __ mov(edx, Operand(ebp, kArgumentsOffset)); // load arguments | 837 __ mov(edx, Operand(ebp, kArgumentsOffset)); // load arguments |
| 838 | 838 |
| 839 // Use inline caching to speed up access to arguments. | 839 // Use inline caching to speed up access to arguments. |
| 840 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize(); | 840 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize(); |
| 841 __ call(ic, RelocInfo::CODE_TARGET); | 841 __ call(ic, RelocInfo::CODE_TARGET); |
| 842 // It is important that we do not have a test instruction after the | 842 // It is important that we do not have a test instruction after the |
| 843 // call. A test instruction after the call is used to indicate that | 843 // call. A test instruction after the call is used to indicate that |
| 844 // we have generated an inline version of the keyed load. In this | 844 // we have generated an inline version of the keyed load. In this |
| 845 // case, we know that we are not generating a test instruction next. | 845 // case, we know that we are not generating a test instruction next. |
| 846 | 846 |
| 847 // Push the nth argument. | 847 // Push the nth argument. |
| 848 __ push(eax); | 848 __ push(eax); |
| 849 | 849 |
| 850 // Update the index on the stack and in register eax. | 850 // Update the index on the stack and in register eax. |
| 851 __ mov(eax, Operand(ebp, kIndexOffset)); | 851 __ mov(ecx, Operand(ebp, kIndexOffset)); |
| 852 __ add(eax, Immediate(1 << kSmiTagSize)); | 852 __ add(ecx, Immediate(1 << kSmiTagSize)); |
| 853 __ mov(Operand(ebp, kIndexOffset), eax); | 853 __ mov(Operand(ebp, kIndexOffset), ecx); |
| 854 | 854 |
| 855 __ bind(&entry); | 855 __ bind(&entry); |
| 856 __ cmp(eax, Operand(ebp, kLimitOffset)); | 856 __ cmp(ecx, Operand(ebp, kLimitOffset)); |
| 857 __ j(not_equal, &loop); | 857 __ j(not_equal, &loop); |
| 858 | 858 |
| 859 // Invoke the function. | 859 // Invoke the function. |
| 860 Label call_proxy; | 860 Label call_proxy; |
| 861 __ mov(eax, ecx); |
| 861 ParameterCount actual(eax); | 862 ParameterCount actual(eax); |
| 862 __ SmiUntag(eax); | 863 __ SmiUntag(eax); |
| 863 __ mov(edi, Operand(ebp, kFunctionOffset)); | 864 __ mov(edi, Operand(ebp, kFunctionOffset)); |
| 864 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 865 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| 865 __ j(not_equal, &call_proxy); | 866 __ j(not_equal, &call_proxy); |
| 866 __ InvokeFunction(edi, actual, CALL_FUNCTION, | 867 __ InvokeFunction(edi, actual, CALL_FUNCTION, |
| 867 NullCallWrapper(), CALL_AS_METHOD); | 868 NullCallWrapper(), CALL_AS_METHOD); |
| 868 | 869 |
| 869 frame_scope.GenerateLeaveFrame(); | 870 frame_scope.GenerateLeaveFrame(); |
| 870 __ ret(3 * kPointerSize); // remove this, receiver, and arguments | 871 __ ret(3 * kPointerSize); // remove this, receiver, and arguments |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1729 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1729 generator.Generate(); | 1730 generator.Generate(); |
| 1730 } | 1731 } |
| 1731 | 1732 |
| 1732 | 1733 |
| 1733 #undef __ | 1734 #undef __ |
| 1734 } | 1735 } |
| 1735 } // namespace v8::internal | 1736 } // namespace v8::internal |
| 1736 | 1737 |
| 1737 #endif // V8_TARGET_ARCH_IA32 | 1738 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |