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/arm64/macro-assembler-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 4635 matching lines...) Expand 10 before | Expand all | Expand 10 after
4646 4646
4647 // We need some scratch registers for the MacroAssembler, so make sure we have 4647 // We need some scratch registers for the MacroAssembler, so make sure we have
4648 // some. This is safe here because Abort never returns. 4648 // some. This is safe here because Abort never returns.
4649 RegList old_tmp_list = TmpList()->list(); 4649 RegList old_tmp_list = TmpList()->list();
4650 TmpList()->Combine(MacroAssembler::DefaultTmpList()); 4650 TmpList()->Combine(MacroAssembler::DefaultTmpList());
4651 4651
4652 if (use_real_aborts()) { 4652 if (use_real_aborts()) {
4653 // Avoid infinite recursion; Push contains some assertions that use Abort. 4653 // Avoid infinite recursion; Push contains some assertions that use Abort.
4654 NoUseRealAbortsScope no_real_aborts(this); 4654 NoUseRealAbortsScope no_real_aborts(this);
4655 4655
4656 Mov(x0, Smi::FromInt(reason)); 4656 // Check if Abort() has already been initialized.
4657 Push(x0); 4657 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
4658 Move(x1, Smi::FromInt(static_cast<int>(reason)));
4658 4659
4659 if (!has_frame_) { 4660 if (!has_frame_) {
4660 // We don't actually want to generate a pile of code for this, so just 4661 // We don't actually want to generate a pile of code for this, so just
4661 // claim there is a stack frame, without generating one. 4662 // claim there is a stack frame, without generating one.
4662 FrameScope scope(this, StackFrame::NONE); 4663 FrameScope scope(this, StackFrame::NONE);
4663 CallRuntime(Runtime::kAbort); 4664 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
4664 } else { 4665 } else {
4665 CallRuntime(Runtime::kAbort); 4666 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
4666 } 4667 }
4667 } else { 4668 } else {
4668 // Load the string to pass to Printf. 4669 // Load the string to pass to Printf.
4669 Label msg_address; 4670 Label msg_address;
4670 Adr(x0, &msg_address); 4671 Adr(x0, &msg_address);
4671 4672
4672 // Call Printf directly to report the error. 4673 // Call Printf directly to report the error.
4673 CallPrintf(); 4674 CallPrintf();
4674 4675
4675 // We need a way to stop execution on both the simulator and real hardware, 4676 // We need a way to stop execution on both the simulator and real hardware,
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5151 } 5152 }
5152 5153
5153 5154
5154 #undef __ 5155 #undef __
5155 5156
5156 5157
5157 } // namespace internal 5158 } // namespace internal
5158 } // namespace v8 5159 } // namespace v8
5159 5160
5160 #endif // V8_TARGET_ARCH_ARM64 5161 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698