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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 // Open a frame scope to indicate that there is a frame on the stack. The | 150 // Open a frame scope to indicate that there is a frame on the stack. The |
151 // MANUAL indicates that the scope shouldn't actually generate code to set up | 151 // MANUAL indicates that the scope shouldn't actually generate code to set up |
152 // the frame (that is done below). | 152 // the frame (that is done below). |
153 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 153 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
154 | 154 |
155 info->set_prologue_offset(masm_->pc_offset()); | 155 info->set_prologue_offset(masm_->pc_offset()); |
156 __ push(rbp); // Caller's frame pointer. | 156 __ push(rbp); // Caller's frame pointer. |
157 __ movq(rbp, rsp); | 157 __ movq(rbp, rsp); |
158 __ push(rsi); // Callee's context. | 158 if (isolate()->is_memory_constrained()) { |
| 159 // This sequence marks pre-aged code. |
| 160 __ push(rsi); // Callee's context. |
| 161 __ nop(); |
| 162 } else { |
| 163 // This sequence marks non-aged code. |
| 164 __ nop(); |
| 165 __ push(rsi); // Callee's context |
| 166 } |
159 __ push(rdi); // Callee's JS Function. | 167 __ push(rdi); // Callee's JS Function. |
160 info->AddNoFrameRange(0, masm_->pc_offset()); | 168 info->AddNoFrameRange(0, masm_->pc_offset()); |
161 | 169 |
162 { Comment cmnt(masm_, "[ Allocate locals"); | 170 { Comment cmnt(masm_, "[ Allocate locals"); |
163 int locals_count = info->scope()->num_stack_slots(); | 171 int locals_count = info->scope()->num_stack_slots(); |
164 // Generators allocate locals, if any, in context slots. | 172 // Generators allocate locals, if any, in context slots. |
165 ASSERT(!info->function()->is_generator() || locals_count == 0); | 173 ASSERT(!info->function()->is_generator() || locals_count == 0); |
166 if (locals_count == 1) { | 174 if (locals_count == 1) { |
167 __ PushRoot(Heap::kUndefinedValueRootIndex); | 175 __ PushRoot(Heap::kUndefinedValueRootIndex); |
168 } else if (locals_count > 1) { | 176 } else if (locals_count > 1) { |
(...skipping 4707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4876 *context_length = 0; | 4884 *context_length = 0; |
4877 return previous_; | 4885 return previous_; |
4878 } | 4886 } |
4879 | 4887 |
4880 | 4888 |
4881 #undef __ | 4889 #undef __ |
4882 | 4890 |
4883 } } // namespace v8::internal | 4891 } } // namespace v8::internal |
4884 | 4892 |
4885 #endif // V8_TARGET_ARCH_X64 | 4893 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |