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

Side by Side Diff: src/mips64/macro-assembler-mips64.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/mips/macro-assembler-mips.cc ('k') | src/x64/macro-assembler-x64.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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 6070 matching lines...) Expand 10 before | Expand all | Expand 10 after
6081 RecordComment("Abort message: "); 6081 RecordComment("Abort message: ");
6082 RecordComment(msg); 6082 RecordComment(msg);
6083 } 6083 }
6084 6084
6085 if (FLAG_trap_on_abort) { 6085 if (FLAG_trap_on_abort) {
6086 stop(msg); 6086 stop(msg);
6087 return; 6087 return;
6088 } 6088 }
6089 #endif 6089 #endif
6090 6090
6091 li(a0, Operand(Smi::FromInt(reason))); 6091 // Check if Abort() has already been initialized.
6092 push(a0); 6092 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
6093
6094 Move(a0, Smi::FromInt(static_cast<int>(reason)));
6095
6093 // Disable stub call restrictions to always allow calls to abort. 6096 // Disable stub call restrictions to always allow calls to abort.
6094 if (!has_frame_) { 6097 if (!has_frame_) {
6095 // We don't actually want to generate a pile of code for this, so just 6098 // We don't actually want to generate a pile of code for this, so just
6096 // claim there is a stack frame, without generating one. 6099 // claim there is a stack frame, without generating one.
6097 FrameScope scope(this, StackFrame::NONE); 6100 FrameScope scope(this, StackFrame::NONE);
6098 CallRuntime(Runtime::kAbort); 6101 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
6099 } else { 6102 } else {
6100 CallRuntime(Runtime::kAbort); 6103 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
6101 } 6104 }
6102 // Will not return here. 6105 // Will not return here.
6103 if (is_trampoline_pool_blocked()) { 6106 if (is_trampoline_pool_blocked()) {
6104 // If the calling code cares about the exact number of 6107 // If the calling code cares about the exact number of
6105 // instructions generated, we insert padding here to keep the size 6108 // instructions generated, we insert padding here to keep the size
6106 // of the Abort macro constant. 6109 // of the Abort macro constant.
6107 // Currently in debug mode with debug_code enabled the number of 6110 // Currently in debug mode with debug_code enabled the number of
6108 // generated instructions is 10, so we use this as a maximum value. 6111 // generated instructions is 10, so we use this as a maximum value.
6109 static const int kExpectedAbortInstructions = 10; 6112 static const int kExpectedAbortInstructions = 10;
6110 int abort_instructions = InstructionsGeneratedSince(&abort_start); 6113 int abort_instructions = InstructionsGeneratedSince(&abort_start);
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
7334 if (mag.shift > 0) sra(result, result, mag.shift); 7337 if (mag.shift > 0) sra(result, result, mag.shift);
7335 srl(at, dividend, 31); 7338 srl(at, dividend, 31);
7336 Addu(result, result, Operand(at)); 7339 Addu(result, result, Operand(at));
7337 } 7340 }
7338 7341
7339 7342
7340 } // namespace internal 7343 } // namespace internal
7341 } // namespace v8 7344 } // namespace v8
7342 7345
7343 #endif // V8_TARGET_ARCH_MIPS64 7346 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698