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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ASSERT(!frame_is_built_); | 161 ASSERT(!frame_is_built_); |
162 frame_is_built_ = true; | 162 frame_is_built_ = true; |
163 __ push(rbp); // Caller's frame pointer. | 163 __ push(rbp); // Caller's frame pointer. |
164 __ movq(rbp, rsp); | 164 __ movq(rbp, rsp); |
165 __ push(rsi); // Callee's context. | 165 __ push(rsi); // Callee's context. |
166 if (info()->IsStub()) { | 166 if (info()->IsStub()) { |
167 __ Push(Smi::FromInt(StackFrame::STUB)); | 167 __ Push(Smi::FromInt(StackFrame::STUB)); |
168 } else { | 168 } else { |
169 __ push(rdi); // Callee's JS function. | 169 __ push(rdi); // Callee's JS function. |
170 } | 170 } |
| 171 info()->AddNoFrameRange(0, masm_->pc_offset()); |
171 } | 172 } |
172 | 173 |
173 // Reserve space for the stack slots needed by the code. | 174 // Reserve space for the stack slots needed by the code. |
174 int slots = GetStackSlotCount(); | 175 int slots = GetStackSlotCount(); |
175 if (slots > 0) { | 176 if (slots > 0) { |
176 if (FLAG_debug_code) { | 177 if (FLAG_debug_code) { |
177 __ subq(rsp, Immediate(slots * kPointerSize)); | 178 __ subq(rsp, Immediate(slots * kPointerSize)); |
178 __ push(rax); | 179 __ push(rax); |
179 __ Set(rax, slots); | 180 __ Set(rax, slots); |
180 __ movq(kScratchRegister, kSlotsZapValue, RelocInfo::NONE64); | 181 __ movq(kScratchRegister, kSlotsZapValue, RelocInfo::NONE64); |
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2526 BitVector* doubles = chunk()->allocated_double_registers(); | 2527 BitVector* doubles = chunk()->allocated_double_registers(); |
2527 BitVector::Iterator save_iterator(doubles); | 2528 BitVector::Iterator save_iterator(doubles); |
2528 int count = 0; | 2529 int count = 0; |
2529 while (!save_iterator.Done()) { | 2530 while (!save_iterator.Done()) { |
2530 __ movsd(XMMRegister::FromAllocationIndex(save_iterator.Current()), | 2531 __ movsd(XMMRegister::FromAllocationIndex(save_iterator.Current()), |
2531 MemOperand(rsp, count * kDoubleSize)); | 2532 MemOperand(rsp, count * kDoubleSize)); |
2532 save_iterator.Advance(); | 2533 save_iterator.Advance(); |
2533 count++; | 2534 count++; |
2534 } | 2535 } |
2535 } | 2536 } |
| 2537 int no_frame_start = -1; |
2536 if (NeedsEagerFrame()) { | 2538 if (NeedsEagerFrame()) { |
2537 __ movq(rsp, rbp); | 2539 __ movq(rsp, rbp); |
2538 __ pop(rbp); | 2540 __ pop(rbp); |
| 2541 no_frame_start = masm_->pc_offset(); |
2539 } | 2542 } |
2540 if (instr->has_constant_parameter_count()) { | 2543 if (instr->has_constant_parameter_count()) { |
2541 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, | 2544 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, |
2542 rcx); | 2545 rcx); |
2543 } else { | 2546 } else { |
2544 Register reg = ToRegister(instr->parameter_count()); | 2547 Register reg = ToRegister(instr->parameter_count()); |
2545 // The argument count parameter is a smi | 2548 // The argument count parameter is a smi |
2546 __ SmiToInteger32(reg, reg); | 2549 __ SmiToInteger32(reg, reg); |
2547 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; | 2550 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; |
2548 __ pop(return_addr_reg); | 2551 __ pop(return_addr_reg); |
2549 __ shl(reg, Immediate(kPointerSizeLog2)); | 2552 __ shl(reg, Immediate(kPointerSizeLog2)); |
2550 __ addq(rsp, reg); | 2553 __ addq(rsp, reg); |
2551 __ jmp(return_addr_reg); | 2554 __ jmp(return_addr_reg); |
2552 } | 2555 } |
| 2556 if (no_frame_start != -1) { |
| 2557 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 2558 } |
2553 } | 2559 } |
2554 | 2560 |
2555 | 2561 |
2556 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2562 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
2557 Register result = ToRegister(instr->result()); | 2563 Register result = ToRegister(instr->result()); |
2558 __ LoadGlobalCell(result, instr->hydrogen()->cell()); | 2564 __ LoadGlobalCell(result, instr->hydrogen()->cell()); |
2559 if (instr->hydrogen()->RequiresHoleCheck()) { | 2565 if (instr->hydrogen()->RequiresHoleCheck()) { |
2560 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2566 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
2561 DeoptimizeIf(equal, instr->environment()); | 2567 DeoptimizeIf(equal, instr->environment()); |
2562 } | 2568 } |
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5730 FixedArray::kHeaderSize - kPointerSize)); | 5736 FixedArray::kHeaderSize - kPointerSize)); |
5731 __ bind(&done); | 5737 __ bind(&done); |
5732 } | 5738 } |
5733 | 5739 |
5734 | 5740 |
5735 #undef __ | 5741 #undef __ |
5736 | 5742 |
5737 } } // namespace v8::internal | 5743 } } // namespace v8::internal |
5738 | 5744 |
5739 #endif // V8_TARGET_ARCH_X64 | 5745 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |