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

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

Issue 2156923002: [builtins] Introduce a builtin for Abort(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moved comment one line down. 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
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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 if (msg != NULL) { 630 if (msg != NULL) {
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 // Check if Abort() has already been initialized.
Michael Starzinger 2016/07/18 08:51:11 nit: Empty newline before this block for readabili
ahaas 2016/07/18 09:04:17 Done
641 Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)), 641 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
642 Assembler::RelocInfoNone()); 642 Move(rdx, Smi::FromInt(static_cast<int>(reason)));
643 Push(kScratchRegister);
644 643
645 if (!has_frame_) { 644 if (!has_frame_) {
646 // We don't actually want to generate a pile of code for this, so just 645 // 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. 646 // claim there is a stack frame, without generating one.
648 FrameScope scope(this, StackFrame::NONE); 647 FrameScope scope(this, StackFrame::NONE);
649 CallRuntime(Runtime::kAbort); 648 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
650 } else { 649 } else {
651 CallRuntime(Runtime::kAbort); 650 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
652 } 651 }
653 // Control will not return here. 652 // Control will not return here.
654 int3(); 653 int3();
655 } 654 }
656 655
657 656
658 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { 657 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
659 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs 658 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs
660 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); 659 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id);
661 } 660 }
(...skipping 5114 matching lines...) Expand 10 before | Expand all | Expand 10 after
5776 movl(rax, dividend); 5775 movl(rax, dividend);
5777 shrl(rax, Immediate(31)); 5776 shrl(rax, Immediate(31));
5778 addl(rdx, rax); 5777 addl(rdx, rax);
5779 } 5778 }
5780 5779
5781 5780
5782 } // namespace internal 5781 } // namespace internal
5783 } // namespace v8 5782 } // namespace v8
5784 5783
5785 #endif // V8_TARGET_ARCH_X64 5784 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/mips64/macro-assembler-mips64.cc ('K') | « src/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698