OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4572 | 4572 |
4573 DCHECK(!holder_reg.is(scratch)); | 4573 DCHECK(!holder_reg.is(scratch)); |
4574 DCHECK(!scratch.is(kScratchRegister)); | 4574 DCHECK(!scratch.is(kScratchRegister)); |
4575 // Load current lexical context from the active StandardFrame, which | 4575 // Load current lexical context from the active StandardFrame, which |
4576 // may require crawling past STUB frames. | 4576 // may require crawling past STUB frames. |
4577 Label load_context; | 4577 Label load_context; |
4578 Label has_context; | 4578 Label has_context; |
4579 movp(scratch, rbp); | 4579 movp(scratch, rbp); |
4580 bind(&load_context); | 4580 bind(&load_context); |
4581 DCHECK(SmiValuesAre32Bits()); | 4581 DCHECK(SmiValuesAre32Bits()); |
4582 int smi_tag_offset = kSmiShift / kBitsPerByte; | 4582 // This is "JumpIfNotSmi" but without loading the value into a register. |
4583 cmpl(MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset + | 4583 cmpl(MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset), |
4584 smi_tag_offset), | 4584 Immediate(0)); |
4585 Immediate(StackFrame::STUB)); | |
4586 j(not_equal, &has_context); | 4585 j(not_equal, &has_context); |
4587 movp(scratch, MemOperand(scratch, CommonFrameConstants::kCallerFPOffset)); | 4586 movp(scratch, MemOperand(scratch, CommonFrameConstants::kCallerFPOffset)); |
4588 jmp(&load_context); | 4587 jmp(&load_context); |
4589 bind(&has_context); | 4588 bind(&has_context); |
4590 movp(scratch, | 4589 movp(scratch, |
4591 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset)); | 4590 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset)); |
4592 | 4591 |
4593 // When generating debug code, make sure the lexical context is set. | 4592 // When generating debug code, make sure the lexical context is set. |
4594 if (emit_debug_code()) { | 4593 if (emit_debug_code()) { |
4595 cmpp(scratch, Immediate(0)); | 4594 cmpp(scratch, Immediate(0)); |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5665 movl(rax, dividend); | 5664 movl(rax, dividend); |
5666 shrl(rax, Immediate(31)); | 5665 shrl(rax, Immediate(31)); |
5667 addl(rdx, rax); | 5666 addl(rdx, rax); |
5668 } | 5667 } |
5669 | 5668 |
5670 | 5669 |
5671 } // namespace internal | 5670 } // namespace internal |
5672 } // namespace v8 | 5671 } // namespace v8 |
5673 | 5672 |
5674 #endif // V8_TARGET_ARCH_X64 | 5673 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |