| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 | 140 |
| 141 void VirtualFrame::AllocateStackSlots() { | 141 void VirtualFrame::AllocateStackSlots() { |
| 142 int count = local_count(); | 142 int count = local_count(); |
| 143 if (count > 0) { | 143 if (count > 0) { |
| 144 Comment cmnt(masm(), "[ Allocate space for locals"); | 144 Comment cmnt(masm(), "[ Allocate space for locals"); |
| 145 Adjust(count); | 145 Adjust(count); |
| 146 // Initialize stack slots with 'undefined' value. | 146 // Initialize stack slots with 'undefined' value. |
| 147 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 147 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 148 } | 148 } |
| 149 if (FLAG_check_stack) { | 149 __ LoadRoot(r2, Heap::kStackLimitRootIndex); |
| 150 __ LoadRoot(r2, Heap::kStackLimitRootIndex); | |
| 151 } | |
| 152 for (int i = 0; i < count; i++) { | 150 for (int i = 0; i < count; i++) { |
| 153 __ push(ip); | 151 __ push(ip); |
| 154 } | 152 } |
| 155 if (FLAG_check_stack) { | 153 // Check the stack for overflow or a break request. |
| 156 // Put the lr setup instruction in the delay slot. The kInstrSize is added | 154 // Put the lr setup instruction in the delay slot. The kInstrSize is added |
| 157 // to the implicit 8 byte offset that always applies to operations with pc | 155 // to the implicit 8 byte offset that always applies to operations with pc |
| 158 // and gives a return address 12 bytes down. | 156 // and gives a return address 12 bytes down. |
| 159 masm()->add(lr, pc, Operand(Assembler::kInstrSize)); | 157 masm()->add(lr, pc, Operand(Assembler::kInstrSize)); |
| 160 masm()->cmp(sp, Operand(r2)); | 158 masm()->cmp(sp, Operand(r2)); |
| 161 StackCheckStub stub; | 159 StackCheckStub stub; |
| 162 // Call the stub if lower. | 160 // Call the stub if lower. |
| 163 masm()->mov(pc, | 161 masm()->mov(pc, |
| 164 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), | 162 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), |
| 165 RelocInfo::CODE_TARGET), | 163 RelocInfo::CODE_TARGET), |
| 166 LeaveCC, | 164 LeaveCC, |
| 167 lo); | 165 lo); |
| 168 } | |
| 169 } | 166 } |
| 170 | 167 |
| 171 | 168 |
| 169 |
| 172 void VirtualFrame::SaveContextRegister() { | 170 void VirtualFrame::SaveContextRegister() { |
| 173 UNIMPLEMENTED(); | 171 UNIMPLEMENTED(); |
| 174 } | 172 } |
| 175 | 173 |
| 176 | 174 |
| 177 void VirtualFrame::RestoreContextRegister() { | 175 void VirtualFrame::RestoreContextRegister() { |
| 178 UNIMPLEMENTED(); | 176 UNIMPLEMENTED(); |
| 179 } | 177 } |
| 180 | 178 |
| 181 | 179 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 ASSERT(stack_pointer_ == element_count() - 1); | 386 ASSERT(stack_pointer_ == element_count() - 1); |
| 389 elements_.Add(FrameElement::MemoryElement()); | 387 elements_.Add(FrameElement::MemoryElement()); |
| 390 stack_pointer_++; | 388 stack_pointer_++; |
| 391 __ push(reg); | 389 __ push(reg); |
| 392 } | 390 } |
| 393 | 391 |
| 394 | 392 |
| 395 #undef __ | 393 #undef __ |
| 396 | 394 |
| 397 } } // namespace v8::internal | 395 } } // namespace v8::internal |
| OLD | NEW |