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