OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); | 136 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); |
137 __ movq(args.GetReceiverOperand(), kScratchRegister); | 137 __ movq(args.GetReceiverOperand(), kScratchRegister); |
138 __ bind(&ok); | 138 __ bind(&ok); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 info()->set_prologue_offset(masm_->pc_offset()); | 142 info()->set_prologue_offset(masm_->pc_offset()); |
143 if (NeedsEagerFrame()) { | 143 if (NeedsEagerFrame()) { |
144 ASSERT(!frame_is_built_); | 144 ASSERT(!frame_is_built_); |
145 frame_is_built_ = true; | 145 frame_is_built_ = true; |
146 __ push(rbp); // Caller's frame pointer. | 146 if (FLAG_optimize_for_size && FLAG_age_code && !info()->IsStub()) { |
147 __ movq(rbp, rsp); | 147 // Pre-age the code. |
148 __ push(rsi); // Callee's context. | 148 __ Call(isolate()->builtins()->MarkCodeAsExecutedOnce(), |
149 if (info()->IsStub()) { | 149 RelocInfo::CODE_AGE_SEQUENCE); |
150 __ Push(Smi::FromInt(StackFrame::STUB)); | 150 __ Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength); |
151 } else { | 151 } else { |
152 __ push(rdi); // Callee's JS function. | 152 __ push(rbp); // Caller's frame pointer. |
| 153 __ movq(rbp, rsp); |
| 154 __ push(rsi); // Callee's context. |
| 155 if (info()->IsStub()) { |
| 156 __ Push(Smi::FromInt(StackFrame::STUB)); |
| 157 } else { |
| 158 __ push(rdi); // Callee's JS function. |
| 159 } |
153 } | 160 } |
154 info()->AddNoFrameRange(0, masm_->pc_offset()); | 161 info()->AddNoFrameRange(0, masm_->pc_offset()); |
155 } | 162 } |
156 | 163 |
157 // Reserve space for the stack slots needed by the code. | 164 // Reserve space for the stack slots needed by the code. |
158 int slots = GetStackSlotCount(); | 165 int slots = GetStackSlotCount(); |
159 if (slots > 0) { | 166 if (slots > 0) { |
160 if (FLAG_debug_code) { | 167 if (FLAG_debug_code) { |
161 __ subq(rsp, Immediate(slots * kPointerSize)); | 168 __ subq(rsp, Immediate(slots * kPointerSize)); |
162 #ifdef _MSC_VER | 169 #ifdef _MSC_VER |
(...skipping 5289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5452 FixedArray::kHeaderSize - kPointerSize)); | 5459 FixedArray::kHeaderSize - kPointerSize)); |
5453 __ bind(&done); | 5460 __ bind(&done); |
5454 } | 5461 } |
5455 | 5462 |
5456 | 5463 |
5457 #undef __ | 5464 #undef __ |
5458 | 5465 |
5459 } } // namespace v8::internal | 5466 } } // namespace v8::internal |
5460 | 5467 |
5461 #endif // V8_TARGET_ARCH_X64 | 5468 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |