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

Side by Side Diff: src/mips/macro-assembler-mips.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/isolate.cc ('k') | src/mips64/macro-assembler-mips64.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 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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 5781 matching lines...) Expand 10 before | Expand all | Expand 10 after
5792 RecordComment("Abort message: "); 5792 RecordComment("Abort message: ");
5793 RecordComment(msg); 5793 RecordComment(msg);
5794 } 5794 }
5795 5795
5796 if (FLAG_trap_on_abort) { 5796 if (FLAG_trap_on_abort) {
5797 stop(msg); 5797 stop(msg);
5798 return; 5798 return;
5799 } 5799 }
5800 #endif 5800 #endif
5801 5801
5802 li(a0, Operand(Smi::FromInt(reason))); 5802 // Check if Abort() has already been initialized.
5803 push(a0); 5803 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
5804
5805 Move(a0, Smi::FromInt(static_cast<int>(reason)));
5806
5804 // Disable stub call restrictions to always allow calls to abort. 5807 // Disable stub call restrictions to always allow calls to abort.
5805 if (!has_frame_) { 5808 if (!has_frame_) {
5806 // We don't actually want to generate a pile of code for this, so just 5809 // We don't actually want to generate a pile of code for this, so just
5807 // claim there is a stack frame, without generating one. 5810 // claim there is a stack frame, without generating one.
5808 FrameScope scope(this, StackFrame::NONE); 5811 FrameScope scope(this, StackFrame::NONE);
5809 CallRuntime(Runtime::kAbort); 5812 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
5810 } else { 5813 } else {
5811 CallRuntime(Runtime::kAbort); 5814 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
5812 } 5815 }
5813 // Will not return here. 5816 // Will not return here.
5814 if (is_trampoline_pool_blocked()) { 5817 if (is_trampoline_pool_blocked()) {
5815 // If the calling code cares about the exact number of 5818 // If the calling code cares about the exact number of
5816 // instructions generated, we insert padding here to keep the size 5819 // instructions generated, we insert padding here to keep the size
5817 // of the Abort macro constant. 5820 // of the Abort macro constant.
5818 // Currently in debug mode with debug_code enabled the number of 5821 // Currently in debug mode with debug_code enabled the number of
5819 // generated instructions is 10, so we use this as a maximum value. 5822 // generated instructions is 10, so we use this as a maximum value.
5820 static const int kExpectedAbortInstructions = 10; 5823 static const int kExpectedAbortInstructions = 10;
5821 int abort_instructions = InstructionsGeneratedSince(&abort_start); 5824 int abort_instructions = InstructionsGeneratedSince(&abort_start);
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
6981 if (mag.shift > 0) sra(result, result, mag.shift); 6984 if (mag.shift > 0) sra(result, result, mag.shift);
6982 srl(at, dividend, 31); 6985 srl(at, dividend, 31);
6983 Addu(result, result, Operand(at)); 6986 Addu(result, result, Operand(at));
6984 } 6987 }
6985 6988
6986 6989
6987 } // namespace internal 6990 } // namespace internal
6988 } // namespace v8 6991 } // namespace v8
6989 6992
6990 #endif // V8_TARGET_ARCH_MIPS 6993 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698