| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 120 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 121 // Adjust FP to point to saved FP. | 121 // Adjust FP to point to saved FP. |
| 122 __ add(fp, sp, Operand(2 * kPointerSize)); | 122 __ add(fp, sp, Operand(2 * kPointerSize)); |
| 123 cgen()->allocator()->Unuse(r1); | 123 cgen()->allocator()->Unuse(r1); |
| 124 cgen()->allocator()->Unuse(lr); | 124 cgen()->allocator()->Unuse(lr); |
| 125 } | 125 } |
| 126 | 126 |
| 127 | 127 |
| 128 void VirtualFrame::Exit() { | 128 void VirtualFrame::Exit() { |
| 129 Comment cmnt(masm(), "[ Exit JS frame"); | 129 Comment cmnt(masm(), "[ Exit JS frame"); |
| 130 // Record the location of the JS exit code for patching when setting |
| 131 // break point. |
| 132 __ RecordJSReturn(); |
| 133 |
| 130 // Drop the execution stack down to the frame pointer and restore the caller | 134 // Drop the execution stack down to the frame pointer and restore the caller |
| 131 // frame pointer and return address. | 135 // frame pointer and return address. |
| 132 __ mov(sp, fp); | 136 __ mov(sp, fp); |
| 133 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | 137 __ ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 134 } | 138 } |
| 135 | 139 |
| 136 | 140 |
| 137 void VirtualFrame::AllocateStackSlots() { | 141 void VirtualFrame::AllocateStackSlots() { |
| 138 int count = local_count(); | 142 int count = local_count(); |
| 139 if (count > 0) { | 143 if (count > 0) { |
| 140 Comment cmnt(masm(), "[ Allocate space for locals"); | 144 Comment cmnt(masm(), "[ Allocate space for locals"); |
| 141 Adjust(count); | 145 Adjust(count); |
| 142 // Initialize stack slots with 'undefined' value. | 146 // Initialize stack slots with 'undefined' value. |
| 143 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 147 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 144 } | 148 } |
| 145 if (FLAG_check_stack) { | 149 if (FLAG_check_stack) { |
| 146 __ LoadRoot(r2, Heap::kStackLimitRootIndex); | 150 __ LoadRoot(r2, Heap::kStackLimitRootIndex); |
| 147 } | 151 } |
| 148 for (int i = 0; i < count; i++) { | 152 for (int i = 0; i < count; i++) { |
| 149 __ push(ip); | 153 __ push(ip); |
| 150 } | 154 } |
| 151 if (FLAG_check_stack) { | 155 if (FLAG_check_stack) { |
| 152 // Put the lr setup instruction in the delay slot. The 'sizeof(Instr)' is | 156 // Put the lr setup instruction in the delay slot. The kInstrSize is added |
| 153 // added to the implicit 8 byte offset that always applies to operations | 157 // to the implicit 8 byte offset that always applies to operations with pc |
| 154 // with pc and gives a return address 12 bytes down. | 158 // and gives a return address 12 bytes down. |
| 155 masm()->add(lr, pc, Operand(sizeof(Instr))); | 159 masm()->add(lr, pc, Operand(Assembler::kInstrSize)); |
| 156 masm()->cmp(sp, Operand(r2)); | 160 masm()->cmp(sp, Operand(r2)); |
| 157 StackCheckStub stub; | 161 StackCheckStub stub; |
| 158 // Call the stub if lower. | 162 // Call the stub if lower. |
| 159 masm()->mov(pc, | 163 masm()->mov(pc, |
| 160 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), | 164 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), |
| 161 RelocInfo::CODE_TARGET), | 165 RelocInfo::CODE_TARGET), |
| 162 LeaveCC, | 166 LeaveCC, |
| 163 lo); | 167 lo); |
| 164 } | 168 } |
| 165 } | 169 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 ASSERT(stack_pointer_ == element_count() - 1); | 388 ASSERT(stack_pointer_ == element_count() - 1); |
| 385 elements_.Add(FrameElement::MemoryElement()); | 389 elements_.Add(FrameElement::MemoryElement()); |
| 386 stack_pointer_++; | 390 stack_pointer_++; |
| 387 __ push(reg); | 391 __ push(reg); |
| 388 } | 392 } |
| 389 | 393 |
| 390 | 394 |
| 391 #undef __ | 395 #undef __ |
| 392 | 396 |
| 393 } } // namespace v8::internal | 397 } } // namespace v8::internal |
| OLD | NEW |