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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // the frame (that is done below). | 162 // the frame (that is done below). |
163 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 163 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
164 | 164 |
165 info->set_prologue_offset(masm_->pc_offset()); | 165 info->set_prologue_offset(masm_->pc_offset()); |
166 { | 166 { |
167 PredictableCodeSizeScope predictible_code_size_scope( | 167 PredictableCodeSizeScope predictible_code_size_scope( |
168 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 168 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
169 // The following three instructions must remain together and unmodified | 169 // The following three instructions must remain together and unmodified |
170 // for code aging to work properly. | 170 // for code aging to work properly. |
171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
172 // Load undefined value here, so the value is ready for the loop | 172 __ nop(ip.code()); |
173 // below. | |
174 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | |
175 // Adjust FP to point to saved FP. | 173 // Adjust FP to point to saved FP. |
176 __ add(fp, sp, Operand(2 * kPointerSize)); | 174 __ add(fp, sp, Operand(2 * kPointerSize)); |
177 } | 175 } |
178 info->AddNoFrameRange(0, masm_->pc_offset()); | 176 info->AddNoFrameRange(0, masm_->pc_offset()); |
179 | 177 |
180 { Comment cmnt(masm_, "[ Allocate locals"); | 178 { Comment cmnt(masm_, "[ Allocate locals"); |
181 int locals_count = info->scope()->num_stack_slots(); | 179 int locals_count = info->scope()->num_stack_slots(); |
182 // Generators allocate locals, if any, in context slots. | 180 // Generators allocate locals, if any, in context slots. |
183 ASSERT(!info->function()->is_generator() || locals_count == 0); | 181 ASSERT(!info->function()->is_generator() || locals_count == 0); |
184 for (int i = 0; i < locals_count; i++) { | 182 if (locals_count > 0) { |
185 __ push(ip); | 183 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 184 for (int i = 0; i < locals_count; i++) { |
| 185 __ push(ip); |
| 186 } |
186 } | 187 } |
187 } | 188 } |
188 | 189 |
189 bool function_in_register = true; | 190 bool function_in_register = true; |
190 | 191 |
191 // Possibly allocate a local context. | 192 // Possibly allocate a local context. |
192 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 193 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
193 if (heap_slots > 0) { | 194 if (heap_slots > 0) { |
194 // Argument to NewContext is the function, which is still in r1. | 195 // Argument to NewContext is the function, which is still in r1. |
195 Comment cmnt(masm_, "[ Allocate context"); | 196 Comment cmnt(masm_, "[ Allocate context"); |
(...skipping 4716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4912 *context_length = 0; | 4913 *context_length = 0; |
4913 return previous_; | 4914 return previous_; |
4914 } | 4915 } |
4915 | 4916 |
4916 | 4917 |
4917 #undef __ | 4918 #undef __ |
4918 | 4919 |
4919 } } // namespace v8::internal | 4920 } } // namespace v8::internal |
4920 | 4921 |
4921 #endif // V8_TARGET_ARCH_ARM | 4922 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |