| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ASSERT(!frame_is_built_); | 167 ASSERT(!frame_is_built_); |
| 168 frame_is_built_ = true; | 168 frame_is_built_ = true; |
| 169 __ push(rbp); // Caller's frame pointer. | 169 __ push(rbp); // Caller's frame pointer. |
| 170 __ movq(rbp, rsp); | 170 __ movq(rbp, rsp); |
| 171 __ push(rsi); // Callee's context. | 171 __ push(rsi); // Callee's context. |
| 172 if (info()->IsStub()) { | 172 if (info()->IsStub()) { |
| 173 __ Push(Smi::FromInt(StackFrame::STUB)); | 173 __ Push(Smi::FromInt(StackFrame::STUB)); |
| 174 } else { | 174 } else { |
| 175 __ push(rdi); // Callee's JS function. | 175 __ push(rdi); // Callee's JS function. |
| 176 } | 176 } |
| 177 info()->AddNoFrameRange(0, masm_->pc_offset()); |
| 177 } | 178 } |
| 178 | 179 |
| 179 // Reserve space for the stack slots needed by the code. | 180 // Reserve space for the stack slots needed by the code. |
| 180 int slots = GetStackSlotCount(); | 181 int slots = GetStackSlotCount(); |
| 181 if (slots > 0) { | 182 if (slots > 0) { |
| 182 if (FLAG_debug_code) { | 183 if (FLAG_debug_code) { |
| 183 __ subq(rsp, Immediate(slots * kPointerSize)); | 184 __ subq(rsp, Immediate(slots * kPointerSize)); |
| 184 __ push(rax); | 185 __ push(rax); |
| 185 __ Set(rax, slots); | 186 __ Set(rax, slots); |
| 186 __ movq(kScratchRegister, kSlotsZapValue, RelocInfo::NONE64); | 187 __ movq(kScratchRegister, kSlotsZapValue, RelocInfo::NONE64); |
| (...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 BitVector* doubles = chunk()->allocated_double_registers(); | 2515 BitVector* doubles = chunk()->allocated_double_registers(); |
| 2515 BitVector::Iterator save_iterator(doubles); | 2516 BitVector::Iterator save_iterator(doubles); |
| 2516 int count = 0; | 2517 int count = 0; |
| 2517 while (!save_iterator.Done()) { | 2518 while (!save_iterator.Done()) { |
| 2518 __ movsd(XMMRegister::FromAllocationIndex(save_iterator.Current()), | 2519 __ movsd(XMMRegister::FromAllocationIndex(save_iterator.Current()), |
| 2519 MemOperand(rsp, count * kDoubleSize)); | 2520 MemOperand(rsp, count * kDoubleSize)); |
| 2520 save_iterator.Advance(); | 2521 save_iterator.Advance(); |
| 2521 count++; | 2522 count++; |
| 2522 } | 2523 } |
| 2523 } | 2524 } |
| 2525 int no_frame_start = -1; |
| 2524 if (NeedsEagerFrame()) { | 2526 if (NeedsEagerFrame()) { |
| 2525 __ movq(rsp, rbp); | 2527 __ movq(rsp, rbp); |
| 2526 __ pop(rbp); | 2528 __ pop(rbp); |
| 2529 no_frame_start = masm_->pc_offset(); |
| 2527 } | 2530 } |
| 2528 if (instr->has_constant_parameter_count()) { | 2531 if (instr->has_constant_parameter_count()) { |
| 2529 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, | 2532 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, |
| 2530 rcx); | 2533 rcx); |
| 2531 } else { | 2534 } else { |
| 2532 Register reg = ToRegister(instr->parameter_count()); | 2535 Register reg = ToRegister(instr->parameter_count()); |
| 2533 // The argument count parameter is a smi | 2536 // The argument count parameter is a smi |
| 2534 __ SmiToInteger32(reg, reg); | 2537 __ SmiToInteger32(reg, reg); |
| 2535 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; | 2538 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; |
| 2536 __ pop(return_addr_reg); | 2539 __ pop(return_addr_reg); |
| 2537 __ shl(reg, Immediate(kPointerSizeLog2)); | 2540 __ shl(reg, Immediate(kPointerSizeLog2)); |
| 2538 __ addq(rsp, reg); | 2541 __ addq(rsp, reg); |
| 2539 __ jmp(return_addr_reg); | 2542 __ jmp(return_addr_reg); |
| 2540 } | 2543 } |
| 2544 if (no_frame_start != -1) { |
| 2545 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 2546 } |
| 2541 } | 2547 } |
| 2542 | 2548 |
| 2543 | 2549 |
| 2544 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2550 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
| 2545 Register result = ToRegister(instr->result()); | 2551 Register result = ToRegister(instr->result()); |
| 2546 __ LoadGlobalCell(result, instr->hydrogen()->cell()); | 2552 __ LoadGlobalCell(result, instr->hydrogen()->cell()); |
| 2547 if (instr->hydrogen()->RequiresHoleCheck()) { | 2553 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2548 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2554 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 2549 DeoptimizeIf(equal, instr->environment()); | 2555 DeoptimizeIf(equal, instr->environment()); |
| 2550 } | 2556 } |
| (...skipping 3043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5594 FixedArray::kHeaderSize - kPointerSize)); | 5600 FixedArray::kHeaderSize - kPointerSize)); |
| 5595 __ bind(&done); | 5601 __ bind(&done); |
| 5596 } | 5602 } |
| 5597 | 5603 |
| 5598 | 5604 |
| 5599 #undef __ | 5605 #undef __ |
| 5600 | 5606 |
| 5601 } } // namespace v8::internal | 5607 } } // namespace v8::internal |
| 5602 | 5608 |
| 5603 #endif // V8_TARGET_ARCH_X64 | 5609 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |