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

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

Issue 11316218: Simplify and fix code aging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed comment and rebased. Created 8 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
« 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);
154 __ cmp(r5, Operand(0)); 152 __ cmp(r5, Operand(0));
155 __ b(eq, &ok); 153 __ b(eq, &ok);
156 int receiver_offset = info->scope()->num_parameters() * kPointerSize; 154 int receiver_offset = info->scope()->num_parameters() * kPointerSize;
157 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 155 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
158 __ str(r2, MemOperand(sp, receiver_offset)); 156 __ str(r2, MemOperand(sp, receiver_offset));
159 __ bind(&ok); 157 __ bind(&ok);
160 ASSERT_EQ(kSizeOfFullCodegenStrictModePrologue, ok.pos() - begin.pos());
161 } 158 }
162 159
163 // Open a frame scope to indicate that there is a frame on the stack. The 160 // Open a frame scope to indicate that there is a frame on the stack. The
164 // MANUAL indicates that the scope shouldn't actually generate code to set up 161 // MANUAL indicates that the scope shouldn't actually generate code to set up
165 // the frame (that is done below). 162 // the frame (that is done below).
166 FrameScope frame_scope(masm_, StackFrame::MANUAL); 163 FrameScope frame_scope(masm_, StackFrame::MANUAL);
167 164
168 int locals_count = info->scope()->num_stack_slots(); 165 int locals_count = info->scope()->num_stack_slots();
169 166
167 info->set_prologue_offset(masm_->pc_offset());
170 // The following four instructions must remain together and unmodified for 168 // The following four instructions must remain together and unmodified for
171 // code aging to work properly. 169 // code aging to work properly.
172 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); 170 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
173 // Load undefined value here, so the value is ready for the loop 171 // Load undefined value here, so the value is ready for the loop
174 // below. 172 // below.
175 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 173 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
176 // Adjust fp to point to caller's fp. 174 // Adjust fp to point to caller's fp.
177 __ add(fp, sp, Operand(2 * kPointerSize)); 175 __ add(fp, sp, Operand(2 * kPointerSize));
178 176
179 { Comment cmnt(masm_, "[ Allocate locals"); 177 { Comment cmnt(masm_, "[ Allocate locals");
(...skipping 4349 matching lines...) Expand 10 before | Expand all | Expand 10 after
4529 *context_length = 0; 4527 *context_length = 0;
4530 return previous_; 4528 return previous_;
4531 } 4529 }
4532 4530
4533 4531
4534 #undef __ 4532 #undef __
4535 4533
4536 } } // namespace v8::internal 4534 } } // namespace v8::internal
4537 4535
4538 #endif // V8_TARGET_ARCH_ARM 4536 #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