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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/lithium-codegen-arm.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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 __ stop("stop-at"); 142 __ stop("stop-at");
143 } 143 }
144 #endif 144 #endif
145 145
146 // Strict mode functions and builtins need to replace the receiver 146 // Strict mode functions and builtins need to replace the receiver
147 // with undefined when called as functions (without an explicit 147 // with undefined when called as functions (without an explicit
148 // receiver object). r5 is zero for method calls and non-zero for 148 // receiver object). r5 is zero for method calls and non-zero for
149 // function calls. 149 // function calls.
150 if (!info->is_classic_mode() || info->is_native()) { 150 if (!info->is_classic_mode() || info->is_native()) {
151 Label ok; 151 Label ok;
152 Label begin;
153 __ bind(&begin);
152 __ cmp(r5, Operand(0)); 154 __ cmp(r5, Operand(0));
153 __ b(eq, &ok); 155 __ b(eq, &ok);
154 int receiver_offset = info->scope()->num_parameters() * kPointerSize; 156 int receiver_offset = info->scope()->num_parameters() * kPointerSize;
155 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 157 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
156 __ str(r2, MemOperand(sp, receiver_offset)); 158 __ str(r2, MemOperand(sp, receiver_offset));
157 __ bind(&ok); 159 __ bind(&ok);
160 ASSERT_EQ(kSizeOfFullCodegenStrictModePrologue, ok.pos() - begin.pos());
158 } 161 }
159 162
160 // Open a frame scope to indicate that there is a frame on the stack. The 163 // Open a frame scope to indicate that there is a frame on the stack. The
161 // MANUAL indicates that the scope shouldn't actually generate code to set up 164 // MANUAL indicates that the scope shouldn't actually generate code to set up
162 // the frame (that is done below). 165 // the frame (that is done below).
163 FrameScope frame_scope(masm_, StackFrame::MANUAL); 166 FrameScope frame_scope(masm_, StackFrame::MANUAL);
164 167
165 int locals_count = info->scope()->num_stack_slots(); 168 int locals_count = info->scope()->num_stack_slots();
166 169
167 __ Push(lr, fp, cp, r1); 170 // The following four instructions must remain together and unmodified for
168 if (locals_count > 0) { 171 // code aging to work properly.
169 // Load undefined value here, so the value is ready for the loop 172 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
170 // below. 173 // Load undefined value here, so the value is ready for the loop
171 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 174 // below.
172 } 175 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
173 // Adjust fp to point to caller's fp. 176 // Adjust fp to point to caller's fp.
174 __ add(fp, sp, Operand(2 * kPointerSize)); 177 __ add(fp, sp, Operand(2 * kPointerSize));
175 178
176 { Comment cmnt(masm_, "[ Allocate locals"); 179 { Comment cmnt(masm_, "[ Allocate locals");
177 for (int i = 0; i < locals_count; i++) { 180 for (int i = 0; i < locals_count; i++) {
178 __ push(ip); 181 __ push(ip);
179 } 182 }
180 } 183 }
181 184
182 bool function_in_register = true; 185 bool function_in_register = true;
(...skipping 4350 matching lines...) Expand 10 before | Expand all | Expand 10 after
4533 *context_length = 0; 4536 *context_length = 0;
4534 return previous_; 4537 return previous_;
4535 } 4538 }
4536 4539
4537 4540
4538 #undef __ 4541 #undef __
4539 4542
4540 } } // namespace v8::internal 4543 } } // namespace v8::internal
4541 4544
4542 #endif // V8_TARGET_ARCH_ARM 4545 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698