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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 2163263002: Reland of [builtins] Introduce a builtin for Abort(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix the problem on arm64. 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 | « no previous file | src/arm64/macro-assembler-arm64.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_ARM 7 #if V8_TARGET_ARCH_ARM
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 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2958 RecordComment("Abort message: "); 2958 RecordComment("Abort message: ");
2959 RecordComment(msg); 2959 RecordComment(msg);
2960 } 2960 }
2961 2961
2962 if (FLAG_trap_on_abort) { 2962 if (FLAG_trap_on_abort) {
2963 stop(msg); 2963 stop(msg);
2964 return; 2964 return;
2965 } 2965 }
2966 #endif 2966 #endif
2967 2967
2968 mov(r0, Operand(Smi::FromInt(reason))); 2968 // Check if Abort() has already been initialized.
2969 push(r0); 2969 DCHECK(isolate()->builtins()->Abort()->IsHeapObject());
2970
2971 Move(r1, Smi::FromInt(static_cast<int>(reason)));
2970 2972
2971 // Disable stub call restrictions to always allow calls to abort. 2973 // Disable stub call restrictions to always allow calls to abort.
2972 if (!has_frame_) { 2974 if (!has_frame_) {
2973 // We don't actually want to generate a pile of code for this, so just 2975 // We don't actually want to generate a pile of code for this, so just
2974 // claim there is a stack frame, without generating one. 2976 // claim there is a stack frame, without generating one.
2975 FrameScope scope(this, StackFrame::NONE); 2977 FrameScope scope(this, StackFrame::NONE);
2976 CallRuntime(Runtime::kAbort); 2978 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
2977 } else { 2979 } else {
2978 CallRuntime(Runtime::kAbort); 2980 Call(isolate()->builtins()->Abort(), RelocInfo::CODE_TARGET);
2979 } 2981 }
2980 // will not return here 2982 // will not return here
2981 if (is_const_pool_blocked()) { 2983 if (is_const_pool_blocked()) {
2982 // If the calling code cares about the exact number of 2984 // If the calling code cares about the exact number of
2983 // instructions generated, we insert padding here to keep the size 2985 // instructions generated, we insert padding here to keep the size
2984 // of the Abort macro constant. 2986 // of the Abort macro constant.
2985 static const int kExpectedAbortInstructions = 7; 2987 static const int kExpectedAbortInstructions = 7;
2986 int abort_instructions = InstructionsGeneratedSince(&abort_start); 2988 int abort_instructions = InstructionsGeneratedSince(&abort_start);
2987 DCHECK(abort_instructions <= kExpectedAbortInstructions); 2989 DCHECK(abort_instructions <= kExpectedAbortInstructions);
2988 while (abort_instructions++ < kExpectedAbortInstructions) { 2990 while (abort_instructions++ < kExpectedAbortInstructions) {
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 } 4038 }
4037 } 4039 }
4038 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 4040 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
4039 add(result, result, Operand(dividend, LSR, 31)); 4041 add(result, result, Operand(dividend, LSR, 31));
4040 } 4042 }
4041 4043
4042 } // namespace internal 4044 } // namespace internal
4043 } // namespace v8 4045 } // namespace v8
4044 4046
4045 #endif // V8_TARGET_ARCH_ARM 4047 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698