| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); | 157 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); |
| 158 __ movq(Operand(rsp, receiver_offset), kScratchRegister); | 158 __ movq(Operand(rsp, receiver_offset), kScratchRegister); |
| 159 __ bind(&ok); | 159 __ bind(&ok); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 info()->set_prologue_offset(masm_->pc_offset()); | 163 info()->set_prologue_offset(masm_->pc_offset()); |
| 164 if (NeedsEagerFrame()) { | 164 if (NeedsEagerFrame()) { |
| 165 ASSERT(!frame_is_built_); | 165 ASSERT(!frame_is_built_); |
| 166 frame_is_built_ = true; | 166 frame_is_built_ = true; |
| 167 __ push(rbp); // Caller's frame pointer. | 167 if (FLAG_optimize_for_size && FLAG_age_code && !info()->IsStub()) { |
| 168 __ movq(rbp, rsp); | 168 // Pre-age the code. |
| 169 __ push(rsi); // Callee's context. | 169 __ Call(isolate()->builtins()->MarkCodeAsExecutedOnce(), |
| 170 if (info()->IsStub()) { | 170 RelocInfo::CODE_AGE_SEQUENCE); |
| 171 __ Push(Smi::FromInt(StackFrame::STUB)); | 171 for (int i = Assembler::kShortCallInstructionLength; |
| 172 i < kNoCodeAgeSequenceLength; |
| 173 i++) { |
| 174 __ nop(); |
| 175 } |
| 172 } else { | 176 } else { |
| 173 __ push(rdi); // Callee's JS function. | 177 __ push(rbp); // Caller's frame pointer. |
| 178 __ movq(rbp, rsp); |
| 179 __ push(rsi); // Callee's context. |
| 180 if (info()->IsStub()) { |
| 181 __ Push(Smi::FromInt(StackFrame::STUB)); |
| 182 } else { |
| 183 __ push(rdi); // Callee's JS function. |
| 184 } |
| 174 } | 185 } |
| 175 info()->AddNoFrameRange(0, masm_->pc_offset()); | 186 info()->AddNoFrameRange(0, masm_->pc_offset()); |
| 176 } | 187 } |
| 177 | 188 |
| 178 // Reserve space for the stack slots needed by the code. | 189 // Reserve space for the stack slots needed by the code. |
| 179 int slots = GetStackSlotCount(); | 190 int slots = GetStackSlotCount(); |
| 180 if (slots > 0) { | 191 if (slots > 0) { |
| 181 if (FLAG_debug_code) { | 192 if (FLAG_debug_code) { |
| 182 __ subq(rsp, Immediate(slots * kPointerSize)); | 193 __ subq(rsp, Immediate(slots * kPointerSize)); |
| 183 #ifdef _MSC_VER | 194 #ifdef _MSC_VER |
| (...skipping 5327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5511 FixedArray::kHeaderSize - kPointerSize)); | 5522 FixedArray::kHeaderSize - kPointerSize)); |
| 5512 __ bind(&done); | 5523 __ bind(&done); |
| 5513 } | 5524 } |
| 5514 | 5525 |
| 5515 | 5526 |
| 5516 #undef __ | 5527 #undef __ |
| 5517 | 5528 |
| 5518 } } // namespace v8::internal | 5529 } } // namespace v8::internal |
| 5519 | 5530 |
| 5520 #endif // V8_TARGET_ARCH_X64 | 5531 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |