| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 163 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
| 164 __ sw(a2, MemOperand(sp, receiver_offset)); | 164 __ sw(a2, MemOperand(sp, receiver_offset)); |
| 165 __ bind(&ok); | 165 __ bind(&ok); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Open a frame scope to indicate that there is a frame on the stack. The | 168 // Open a frame scope to indicate that there is a frame on the stack. The |
| 169 // MANUAL indicates that the scope shouldn't actually generate code to set up | 169 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 170 // the frame (that is done below). | 170 // the frame (that is done below). |
| 171 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 171 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 172 | 172 |
| 173 int locals_count = info->scope()->num_stack_slots(); | |
| 174 | |
| 175 info->set_prologue_offset(masm_->pc_offset()); | 173 info->set_prologue_offset(masm_->pc_offset()); |
| 176 // The following three instructions must remain together and unmodified for | 174 // The following three instructions must remain together and unmodified for |
| 177 // code aging to work properly. | 175 // code aging to work properly. |
| 178 __ Push(ra, fp, cp, a1); | 176 __ Push(ra, fp, cp, a1); |
| 179 // Load undefined value here, so the value is ready for the loop | 177 // Load undefined value here, so the value is ready for the loop |
| 180 // below. | 178 // below. |
| 181 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 179 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 182 // Adjust fp to point to caller's fp. | 180 // Adjust fp to point to caller's fp. |
| 183 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 181 __ Addu(fp, sp, Operand(2 * kPointerSize)); |
| 184 | 182 |
| 185 { Comment cmnt(masm_, "[ Allocate locals"); | 183 { Comment cmnt(masm_, "[ Allocate locals"); |
| 184 int locals_count = info->scope()->num_stack_slots(); |
| 185 // Generators allocate locals, if any, in context slots. |
| 186 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 186 for (int i = 0; i < locals_count; i++) { | 187 for (int i = 0; i < locals_count; i++) { |
| 187 __ push(at); | 188 __ push(at); |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 | 191 |
| 191 bool function_in_register = true; | 192 bool function_in_register = true; |
| 192 | 193 |
| 193 // Possibly allocate a local context. | 194 // Possibly allocate a local context. |
| 194 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 195 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 195 if (heap_slots > 0) { | 196 if (heap_slots > 0) { |
| (...skipping 4406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4602 *context_length = 0; | 4603 *context_length = 0; |
| 4603 return previous_; | 4604 return previous_; |
| 4604 } | 4605 } |
| 4605 | 4606 |
| 4606 | 4607 |
| 4607 #undef __ | 4608 #undef __ |
| 4608 | 4609 |
| 4609 } } // namespace v8::internal | 4610 } } // namespace v8::internal |
| 4610 | 4611 |
| 4611 #endif // V8_TARGET_ARCH_MIPS | 4612 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |