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

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: Rebase 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/arm/macro-assembler-arm.cc ('k') | src/builtins/arm/builtins-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
4659 Move(x1, Smi::FromInt(static_cast<int>(reason)));
4658 4660
4659 if (!has_frame_) { 4661 if (!has_frame_) {
4660 // We don't actually want to generate a pile of code for this, so just 4662 // 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. 4663 // claim there is a stack frame, without generating one.
4662 FrameScope scope(this, StackFrame::NONE); 4664 FrameScope scope(this, StackFrame::NONE);
4663 CallRuntime(Runtime::kAbort); 4665 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
4664 } else { 4666 } else {
4665 CallRuntime(Runtime::kAbort); 4667 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
4666 } 4668 }
4667 } else { 4669 } else {
4668 // Load the string to pass to Printf. 4670 // Load the string to pass to Printf.
4669 Label msg_address; 4671 Label msg_address;
4670 Adr(x0, &msg_address); 4672 Adr(x0, &msg_address);
4671 4673
4672 // Call Printf directly to report the error. 4674 // Call Printf directly to report the error.
4673 CallPrintf(); 4675 CallPrintf();
4674 4676
4675 // We need a way to stop execution on both the simulator and real hardware, 4677 // 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 } 5153 }
5152 5154
5153 5155
5154 #undef __ 5156 #undef __
5155 5157
5156 5158
5157 } // namespace internal 5159 } // namespace internal
5158 } // namespace v8 5160 } // namespace v8
5159 5161
5160 #endif // V8_TARGET_ARCH_ARM64 5162 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/builtins/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698