Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 2163263002: Reland of [builtins] Introduce a builtin for Abort(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix the problem on arm64. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 RecordComment("Abort message: "); 631 RecordComment("Abort message: ");
632 RecordComment(msg); 632 RecordComment(msg);
633 } 633 }
634 634
635 if (FLAG_trap_on_abort) { 635 if (FLAG_trap_on_abort) {
636 int3(); 636 int3();
637 return; 637 return;
638 } 638 }
639 #endif 639 #endif
640 640
641 Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)), 641 // Check if Abort() has already been initialized.
642 Assembler::RelocInfoNone()); 642 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
643 Push(kScratchRegister); 643
644 Move(rdx, Smi::FromInt(static_cast<int>(reason)));
644 645
645 if (!has_frame_) { 646 if (!has_frame_) {
646 // We don't actually want to generate a pile of code for this, so just 647 // We don't actually want to generate a pile of code for this, so just
647 // claim there is a stack frame, without generating one. 648 // claim there is a stack frame, without generating one.
648 FrameScope scope(this, StackFrame::NONE); 649 FrameScope scope(this, StackFrame::NONE);
649 CallRuntime(Runtime::kAbort); 650 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
650 } else { 651 } else {
651 CallRuntime(Runtime::kAbort); 652 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
652 } 653 }
653 // Control will not return here. 654 // Control will not return here.
654 int3(); 655 int3();
655 } 656 }
656 657
657 658
658 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { 659 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
659 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs 660 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs
660 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); 661 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id);
661 } 662 }
(...skipping 5114 matching lines...) Expand 10 before | Expand all | Expand 10 after
5776 movl(rax, dividend); 5777 movl(rax, dividend);
5777 shrl(rax, Immediate(31)); 5778 shrl(rax, Immediate(31));
5778 addl(rdx, rax); 5779 addl(rdx, rax);
5779 } 5780 }
5780 5781
5781 5782
5782 } // namespace internal 5783 } // namespace internal
5783 } // namespace v8 5784 } // namespace v8
5784 5785
5785 #endif // V8_TARGET_ARCH_X64 5786 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698