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

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: 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 #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 Move(a0, Smi::FromInt(static_cast<int>(reason)));
6093 // Disable stub call restrictions to always allow calls to abort. 6094 // Disable stub call restrictions to always allow calls to abort.
6094 if (!has_frame_) { 6095 if (!has_frame_) {
6095 // We don't actually want to generate a pile of code for this, so just 6096 // 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. 6097 // claim there is a stack frame, without generating one.
6097 FrameScope scope(this, StackFrame::NONE); 6098 FrameScope scope(this, StackFrame::NONE);
6098 CallRuntime(Runtime::kAbort); 6099 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
6099 } else { 6100 } else {
6100 CallRuntime(Runtime::kAbort); 6101 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
6101 } 6102 }
6102 // Will not return here. 6103 // Will not return here.
6103 if (is_trampoline_pool_blocked()) { 6104 if (is_trampoline_pool_blocked()) {
6104 // If the calling code cares about the exact number of 6105 // If the calling code cares about the exact number of
6105 // instructions generated, we insert padding here to keep the size 6106 // instructions generated, we insert padding here to keep the size
6106 // of the Abort macro constant. 6107 // of the Abort macro constant.
6107 // Currently in debug mode with debug_code enabled the number of 6108 // Currently in debug mode with debug_code enabled the number of
6108 // generated instructions is 10, so we use this as a maximum value. 6109 // generated instructions is 10, so we use this as a maximum value.
6109 static const int kExpectedAbortInstructions = 10; 6110 static const int kExpectedAbortInstructions = 10;
6110 int abort_instructions = InstructionsGeneratedSince(&abort_start); 6111 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); 7335 if (mag.shift > 0) sra(result, result, mag.shift);
7335 srl(at, dividend, 31); 7336 srl(at, dividend, 31);
7336 Addu(result, result, Operand(at)); 7337 Addu(result, result, Operand(at));
7337 } 7338 }
7338 7339
7339 7340
7340 } // namespace internal 7341 } // namespace internal
7341 } // namespace v8 7342 } // namespace v8
7342 7343
7343 #endif // V8_TARGET_ARCH_MIPS64 7344 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« src/builtins/builtins.h ('K') | « src/isolate.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698