| 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 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #if V8_TARGET_ARCH_IA32 | 30 #if V8_TARGET_ARCH_IA32 |
| 31 | 31 |
| 32 #include "codegen.h" | 32 #include "codegen.h" |
| 33 #include "deoptimizer.h" | 33 #include "deoptimizer.h" |
| 34 #include "full-codegen.h" | 34 #include "full-codegen.h" |
| 35 #include "stub-cache.h" |
| 35 | 36 |
| 36 namespace v8 { | 37 namespace v8 { |
| 37 namespace internal { | 38 namespace internal { |
| 38 | 39 |
| 39 | 40 |
| 40 #define __ ACCESS_MASM(masm) | 41 #define __ ACCESS_MASM(masm) |
| 41 | 42 |
| 42 | 43 |
| 43 void Builtins::Generate_Adaptor(MacroAssembler* masm, | 44 void Builtins::Generate_Adaptor(MacroAssembler* masm, |
| 44 CFunctionId id, | 45 CFunctionId id, |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 __ SmiUntag(eax); | 777 __ SmiUntag(eax); |
| 777 } | 778 } |
| 778 | 779 |
| 779 // Restore the function to edi. | 780 // Restore the function to edi. |
| 780 __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize)); | 781 __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize)); |
| 781 __ jmp(&patch_receiver); | 782 __ jmp(&patch_receiver); |
| 782 | 783 |
| 783 // Use the global receiver object from the called function as the | 784 // Use the global receiver object from the called function as the |
| 784 // receiver. | 785 // receiver. |
| 785 __ bind(&use_global_receiver); | 786 __ bind(&use_global_receiver); |
| 786 const int kGlobalIndex = | 787 CallStubCompiler::FetchGlobalProxy(masm, ebx, edi); |
| 787 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | |
| 788 __ mov(ebx, FieldOperand(esi, kGlobalIndex)); | |
| 789 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset)); | |
| 790 __ mov(ebx, FieldOperand(ebx, kGlobalIndex)); | |
| 791 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); | |
| 792 | 788 |
| 793 __ bind(&patch_receiver); | 789 __ bind(&patch_receiver); |
| 794 __ mov(Operand(esp, eax, times_4, 0), ebx); | 790 __ mov(Operand(esp, eax, times_4, 0), ebx); |
| 795 | 791 |
| 796 __ jmp(&shift_arguments); | 792 __ jmp(&shift_arguments); |
| 797 } | 793 } |
| 798 | 794 |
| 799 // 3b. Check for function proxy. | 795 // 3b. Check for function proxy. |
| 800 __ bind(&slow); | 796 __ bind(&slow); |
| 801 __ Set(edx, Immediate(1)); // indicate function proxy | 797 __ Set(edx, Immediate(1)); // indicate function proxy |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 __ j(above_equal, &push_receiver); | 950 __ j(above_equal, &push_receiver); |
| 955 | 951 |
| 956 __ bind(&call_to_object); | 952 __ bind(&call_to_object); |
| 957 __ push(ebx); | 953 __ push(ebx); |
| 958 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 954 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| 959 __ mov(ebx, eax); | 955 __ mov(ebx, eax); |
| 960 __ jmp(&push_receiver); | 956 __ jmp(&push_receiver); |
| 961 | 957 |
| 962 // Use the current global receiver object as the receiver. | 958 // Use the current global receiver object as the receiver. |
| 963 __ bind(&use_global_receiver); | 959 __ bind(&use_global_receiver); |
| 964 const int kGlobalOffset = | 960 CallStubCompiler::FetchGlobalProxy(masm, ebx, edi); |
| 965 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | |
| 966 __ mov(ebx, FieldOperand(esi, kGlobalOffset)); | |
| 967 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset)); | |
| 968 __ mov(ebx, FieldOperand(ebx, kGlobalOffset)); | |
| 969 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); | |
| 970 | 961 |
| 971 // Push the receiver. | 962 // Push the receiver. |
| 972 __ bind(&push_receiver); | 963 __ bind(&push_receiver); |
| 973 __ push(ebx); | 964 __ push(ebx); |
| 974 | 965 |
| 975 // Copy all arguments from the array to the stack. | 966 // Copy all arguments from the array to the stack. |
| 976 Label entry, loop; | 967 Label entry, loop; |
| 977 __ mov(ecx, Operand(ebp, kIndexOffset)); | 968 __ mov(ecx, Operand(ebp, kIndexOffset)); |
| 978 __ jmp(&entry); | 969 __ jmp(&entry); |
| 979 __ bind(&loop); | 970 __ bind(&loop); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 | 1380 |
| 1390 __ bind(&ok); | 1381 __ bind(&ok); |
| 1391 __ ret(0); | 1382 __ ret(0); |
| 1392 } | 1383 } |
| 1393 | 1384 |
| 1394 #undef __ | 1385 #undef __ |
| 1395 } | 1386 } |
| 1396 } // namespace v8::internal | 1387 } // namespace v8::internal |
| 1397 | 1388 |
| 1398 #endif // V8_TARGET_ARCH_IA32 | 1389 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |