Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 111613003: Load the global proxy from the context of the target function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't embed global object or receiver in hydrogen Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 __ SmiUntag(eax); 757 __ SmiUntag(eax);
757 } 758 }
758 759
759 // Restore the function to edi. 760 // Restore the function to edi.
760 __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize)); 761 __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize));
761 __ jmp(&patch_receiver); 762 __ jmp(&patch_receiver);
762 763
763 // Use the global receiver object from the called function as the 764 // Use the global receiver object from the called function as the
764 // receiver. 765 // receiver.
765 __ bind(&use_global_receiver); 766 __ bind(&use_global_receiver);
766 const int kGlobalIndex = 767 CallStubCompiler::FetchGlobalProxy(masm, ebx, edi);
767 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
768 __ mov(ebx, FieldOperand(esi, kGlobalIndex));
769 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset));
770 __ mov(ebx, FieldOperand(ebx, kGlobalIndex));
771 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
772 768
773 __ bind(&patch_receiver); 769 __ bind(&patch_receiver);
774 __ mov(Operand(esp, eax, times_4, 0), ebx); 770 __ mov(Operand(esp, eax, times_4, 0), ebx);
775 771
776 __ jmp(&shift_arguments); 772 __ jmp(&shift_arguments);
777 } 773 }
778 774
779 // 3b. Check for function proxy. 775 // 3b. Check for function proxy.
780 __ bind(&slow); 776 __ bind(&slow);
781 __ Set(edx, Immediate(1)); // indicate function proxy 777 __ Set(edx, Immediate(1)); // indicate function proxy
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 __ j(above_equal, &push_receiver); 930 __ j(above_equal, &push_receiver);
935 931
936 __ bind(&call_to_object); 932 __ bind(&call_to_object);
937 __ push(ebx); 933 __ push(ebx);
938 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 934 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
939 __ mov(ebx, eax); 935 __ mov(ebx, eax);
940 __ jmp(&push_receiver); 936 __ jmp(&push_receiver);
941 937
942 // Use the current global receiver object as the receiver. 938 // Use the current global receiver object as the receiver.
943 __ bind(&use_global_receiver); 939 __ bind(&use_global_receiver);
944 const int kGlobalOffset = 940 CallStubCompiler::FetchGlobalProxy(masm, ebx, edi);
945 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
946 __ mov(ebx, FieldOperand(esi, kGlobalOffset));
947 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset));
948 __ mov(ebx, FieldOperand(ebx, kGlobalOffset));
949 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
950 941
951 // Push the receiver. 942 // Push the receiver.
952 __ bind(&push_receiver); 943 __ bind(&push_receiver);
953 __ push(ebx); 944 __ push(ebx);
954 945
955 // Copy all arguments from the array to the stack. 946 // Copy all arguments from the array to the stack.
956 Label entry, loop; 947 Label entry, loop;
957 __ mov(ecx, Operand(ebp, kIndexOffset)); 948 __ mov(ecx, Operand(ebp, kIndexOffset));
958 __ jmp(&entry); 949 __ jmp(&entry);
959 __ bind(&loop); 950 __ bind(&loop);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 1360
1370 __ bind(&ok); 1361 __ bind(&ok);
1371 __ ret(0); 1362 __ ret(0);
1372 } 1363 }
1373 1364
1374 #undef __ 1365 #undef __
1375 } 1366 }
1376 } // namespace v8::internal 1367 } // namespace v8::internal
1377 1368
1378 #endif // V8_TARGET_ARCH_IA32 1369 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698