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

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

Issue 345007: Issue 485: Fix leak of builtins object through call and apply functions. (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « no previous file | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); 942 __ mov(r0, Operand(r0, ASR, kSmiTagSize));
943 943
944 __ LeaveInternalFrame(); 944 __ LeaveInternalFrame();
945 __ b(&patch_receiver); 945 __ b(&patch_receiver);
946 946
947 // Use the global receiver object from the called function as the receiver. 947 // Use the global receiver object from the called function as the receiver.
948 __ bind(&use_global_receiver); 948 __ bind(&use_global_receiver);
949 const int kGlobalIndex = 949 const int kGlobalIndex =
950 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 950 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
951 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); 951 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex));
952 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset));
953 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex));
952 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); 954 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset));
953 955
954 __ bind(&patch_receiver); 956 __ bind(&patch_receiver);
955 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); 957 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2));
956 __ str(r2, MemOperand(r3, -kPointerSize)); 958 __ str(r2, MemOperand(r3, -kPointerSize));
957 959
958 __ bind(&done); 960 __ bind(&done);
959 } 961 }
960 962
961 // 4. Shift stuff one slot down the stack 963 // 4. Shift stuff one slot down the stack
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 __ bind(&call_to_object); 1102 __ bind(&call_to_object);
1101 __ push(r0); 1103 __ push(r0);
1102 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); 1104 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS);
1103 __ b(&push_receiver); 1105 __ b(&push_receiver);
1104 1106
1105 // Use the current global receiver object as the receiver. 1107 // Use the current global receiver object as the receiver.
1106 __ bind(&use_global_receiver); 1108 __ bind(&use_global_receiver);
1107 const int kGlobalOffset = 1109 const int kGlobalOffset =
1108 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 1110 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
1109 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); 1111 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset));
1112 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalContextOffset));
1113 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset));
1110 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 1114 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
1111 1115
1112 // Push the receiver. 1116 // Push the receiver.
1113 // r0: receiver 1117 // r0: receiver
1114 __ bind(&push_receiver); 1118 __ bind(&push_receiver);
1115 __ push(r0); 1119 __ push(r0);
1116 1120
1117 // Copy all arguments from the array to the stack. 1121 // Copy all arguments from the array to the stack.
1118 Label entry, loop; 1122 Label entry, loop;
1119 __ ldr(r0, MemOperand(fp, kIndexOffset)); 1123 __ ldr(r0, MemOperand(fp, kIndexOffset));
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 // Dont adapt arguments. 1282 // Dont adapt arguments.
1279 // ------------------------------------------- 1283 // -------------------------------------------
1280 __ bind(&dont_adapt_arguments); 1284 __ bind(&dont_adapt_arguments);
1281 __ Jump(r3); 1285 __ Jump(r3);
1282 } 1286 }
1283 1287
1284 1288
1285 #undef __ 1289 #undef __
1286 1290
1287 } } // namespace v8::internal 1291 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698