| 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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 // claim there is a stack frame, without generating one. | 590 // claim there is a stack frame, without generating one. |
| 591 FrameScope scope(this, StackFrame::NONE); | 591 FrameScope scope(this, StackFrame::NONE); |
| 592 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET); | 592 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET); |
| 593 } else { | 593 } else { |
| 594 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET); | 594 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET); |
| 595 } | 595 } |
| 596 // Control will not return here. | 596 // Control will not return here. |
| 597 int3(); | 597 int3(); |
| 598 } | 598 } |
| 599 | 599 |
| 600 | 600 void MacroAssembler::CallStub(CodeStub* stub) { |
| 601 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | |
| 602 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs | 601 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs |
| 603 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); | 602 Call(stub->GetCode(), RelocInfo::CODE_TARGET); |
| 604 } | 603 } |
| 605 | 604 |
| 606 | 605 |
| 607 void MacroAssembler::TailCallStub(CodeStub* stub) { | 606 void MacroAssembler::TailCallStub(CodeStub* stub) { |
| 608 Jump(stub->GetCode(), RelocInfo::CODE_TARGET); | 607 Jump(stub->GetCode(), RelocInfo::CODE_TARGET); |
| 609 } | 608 } |
| 610 | 609 |
| 611 | 610 |
| 612 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 611 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
| 613 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 612 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| (...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 #ifdef DEBUG | 3114 #ifdef DEBUG |
| 3116 int end_position = pc_offset() + CallSize(destination); | 3115 int end_position = pc_offset() + CallSize(destination); |
| 3117 #endif | 3116 #endif |
| 3118 Move(kScratchRegister, destination, rmode); | 3117 Move(kScratchRegister, destination, rmode); |
| 3119 call(kScratchRegister); | 3118 call(kScratchRegister); |
| 3120 #ifdef DEBUG | 3119 #ifdef DEBUG |
| 3121 CHECK_EQ(pc_offset(), end_position); | 3120 CHECK_EQ(pc_offset(), end_position); |
| 3122 #endif | 3121 #endif |
| 3123 } | 3122 } |
| 3124 | 3123 |
| 3125 | 3124 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { |
| 3126 void MacroAssembler::Call(Handle<Code> code_object, | |
| 3127 RelocInfo::Mode rmode, | |
| 3128 TypeFeedbackId ast_id) { | |
| 3129 #ifdef DEBUG | 3125 #ifdef DEBUG |
| 3130 int end_position = pc_offset() + CallSize(code_object); | 3126 int end_position = pc_offset() + CallSize(code_object); |
| 3131 #endif | 3127 #endif |
| 3132 DCHECK(RelocInfo::IsCodeTarget(rmode) || | 3128 DCHECK(RelocInfo::IsCodeTarget(rmode) || |
| 3133 rmode == RelocInfo::CODE_AGE_SEQUENCE); | 3129 rmode == RelocInfo::CODE_AGE_SEQUENCE); |
| 3134 call(code_object, rmode, ast_id); | 3130 call(code_object, rmode); |
| 3135 #ifdef DEBUG | 3131 #ifdef DEBUG |
| 3136 CHECK_EQ(end_position, pc_offset()); | 3132 CHECK_EQ(end_position, pc_offset()); |
| 3137 #endif | 3133 #endif |
| 3138 } | 3134 } |
| 3139 | 3135 |
| 3140 | 3136 |
| 3141 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { | 3137 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { |
| 3142 if (imm8 == 0) { | 3138 if (imm8 == 0) { |
| 3143 Movd(dst, src); | 3139 Movd(dst, src); |
| 3144 return; | 3140 return; |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5042 movl(rax, dividend); | 5038 movl(rax, dividend); |
| 5043 shrl(rax, Immediate(31)); | 5039 shrl(rax, Immediate(31)); |
| 5044 addl(rdx, rax); | 5040 addl(rdx, rax); |
| 5045 } | 5041 } |
| 5046 | 5042 |
| 5047 | 5043 |
| 5048 } // namespace internal | 5044 } // namespace internal |
| 5049 } // namespace v8 | 5045 } // namespace v8 |
| 5050 | 5046 |
| 5051 #endif // V8_TARGET_ARCH_X64 | 5047 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |