Revision: 19038
Author: [email protected]
Date: Mon Feb 3 18:20:14 2014 UTC
Log: A64: Add more descriptive messages to aborts
BUG=
[email protected]
Review URL: https://codereview.chromium.org/146703008
http://code.google.com/p/v8/source/detail?r=19038
Modified:
/branches/experimental/a64/src/a64/lithium-codegen-a64.cc
/branches/experimental/a64/src/a64/macro-assembler-a64.cc
/branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc
/branches/experimental/a64/src/objects.h
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 3
17:17:35 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Mon Feb 3
18:20:14 2014 UTC
@@ -1173,9 +1173,7 @@
: static_cast<uint32_t>(constant->Integer32Value()));
} else {
// Other constants not implemented.
- // TODO(all): Add this error code to objects.h.
- // Abort(kToOperand32UnsupportedImmediate);
- Abort(kUnknown);
+ Abort(kToOperand32UnsupportedImmediate);
}
}
// Other cases are not implemented.
@@ -1671,9 +1669,7 @@
void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) {
if (FLAG_debug_code && check->hydrogen()->skip_check()) {
- // TODO(all): Add this error code to objects.h.
- // __ Assert(InvertCondition(cc), kEliminatedBoundsCheckFailed);
- __ Assert(InvertCondition(cc), kUnknown);
+ __ Assert(InvertCondition(cc), kEliminatedBoundsCheckFailed);
} else {
DeoptimizeIf(cc, check->environment());
}
@@ -1873,9 +1869,7 @@
Label is_not_smi;
// Try to confirm that function_reg (x1) is a tagged pointer.
__ JumpIfNotSmi(function_reg, &is_not_smi);
- // TODO(all): Add this error code to objects.h.
- // __ Abort(kExpectedFunctionObject);
- __ Abort(kUnknown);
+ __ Abort(kExpectedFunctionObject);
__ Bind(&is_not_smi);
}
@@ -4343,9 +4337,7 @@
__ Mov(scratch1, Operand(new_space_allocation_top));
__ Ldr(scratch1, MemOperand(scratch1));
__ Cmp(dst, scratch1);
- // TODO(all): Add this error code to objects.h.
- // __ Check(eq, kRegisterDstDoesNotContainAllocationTop);
- __ Check(eq, kUnknown);
+ __ Check(eq, kUnexpectedAllocationTop);
}
{
@@ -4480,9 +4472,7 @@
void LCodeGen::DoPushArgument(LPushArgument* instr) {
LOperand* argument = instr->value();
if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
- // TODO(all): Add this error code to objects.h.
- // Abort(kDoPushArgumentNotImplementedForDoubleTypes);
- Abort(kUnknown);
+ Abort(kDoPushArgumentNotImplementedForDoubleType);
} else {
__ Push(ToRegister(argument));
}
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.cc Mon Feb 3
17:17:35 2014 UTC
+++ /branches/experimental/a64/src/a64/macro-assembler-a64.cc Mon Feb 3
18:20:14 2014 UTC
@@ -2017,18 +2017,14 @@
if (emit_debug_code()) {
// Check copy length.
Cmp(length, 0);
- // TODO(all): Add this error code to objects.h.
- // Assert(ge, kCopyLengthIsBelowZero);
- Assert(ge, kUnknown);
+ Assert(ge, kUnexpectedNegativeValue);
// Check src and dst buffers don't overlap.
Add(scratch, src, length); // Calculate end of src buffer.
Cmp(scratch, dst);
Add(scratch, dst, length); // Calculate end of dst buffer.
Ccmp(scratch, src, ZFlag, gt);
- // TODO(all): Add this error code to objects.h.
- // Assert(le, kCopyBytesSrcAndDstBuffersOverlap);
- Assert(le, kUnknown);
+ Assert(le, kCopyBuffersOverlap);
}
Label loop, done;
@@ -2072,9 +2068,9 @@
Label not_smi;
JumpIfEitherSmi(first, second, NULL, ¬_smi);
- // TODO(all): Add this error code to objects.h.
- // Abort(kAtLeastOneInputIsASmi);
- Abort(kUnknown);
+ // At least one input is a smi, but the flags indicated a smi check
wasn't
+ // needed.
+ Abort(kUnexpectedSmi);
Bind(¬_smi);
}
@@ -2438,9 +2434,8 @@
if (emit_debug_code()) {
Cmp(exponent, HeapNumber::kExponentBias + 63);
- // TODO(all): Add this error code to objects.h.
- // Check(ge, kThisInputShouldHaveBeenHandledByTheFPU);
- Check(ge, kUnknown);
+ // Exponents less than this should have been handled by the Fcvt case.
+ Check(ge, kUnexpectedValue);
}
// Isolate the mantissa bits, and set the implicit '1'.
@@ -2489,9 +2484,7 @@
// Verify we indeed have a HeapNumber.
Label ok;
JumpIfHeapNumber(heap_number, &ok);
- // TODO(all): Add this error code to objects.h.
- // Abort(kExpectedHeapNumber);
- Abort(kUnknown);
+ Abort(kExpectedHeapNumber);
Bind(&ok);
}
@@ -2921,9 +2914,7 @@
Mov(scratch, Operand(new_space_allocation_top));
Ldr(scratch, MemOperand(scratch));
Cmp(object, scratch);
- // TODO(all): Add this error code to objects.h.
- // Check(lt, kTryingToUndoAllocationOfNonAllocatedMemory);
- Check(lt, kUnknown);
+ Check(lt, kUndoAllocationOfNonAllocatedMemory);
#endif
// Write the address of the object to un-allocate as the current top.
Mov(scratch, Operand(new_space_allocation_top));
@@ -3505,9 +3496,7 @@
Register temp = Tmp1();
Ldr(temp, FieldMemOperand(scratch, HeapObject::kMapOffset));
CompareRoot(temp, Heap::kNativeContextMapRootIndex);
- // TODO(all): Add this error code to objects.h.
- // Check(eq, kExpectedNativeContext);
- Check(eq, kUnknown);
+ Check(eq, kExpectedNativeContext);
}
// Check if both contexts are the same.
@@ -3521,15 +3510,11 @@
Register temp = Tmp1();
mov(temp, Tmp0());
CompareRoot(temp, Heap::kNullValueRootIndex);
- // TODO(all): Add this error code to objects.h.
- // Check(ne, kExpectedNonNullContext);
- Check(ne, kUnknown);
+ Check(ne, kExpectedNonNullContext);
Ldr(temp, FieldMemOperand(temp, HeapObject::kMapOffset));
CompareRoot(temp, Heap::kNativeContextMapRootIndex);
- // TODO(all): Add this error code to objects.h.
- // Check(eq, kExpectedNativeContext);
- Check(eq, kUnknown);
+ Check(eq, kExpectedNativeContext);
// Let's consider that Tmp0() has been cloberred by the MacroAssembler.
// We reload it with its value.
@@ -3657,9 +3642,7 @@
if (emit_debug_code()) {
Label ok;
JumpIfNotInNewSpace(object, &ok);
- // TODO(all): Add this error code to objects.h.
- // Abort(kRememberedSetPointerIsInNewSpace);
- Abort(kUnknown);
+ Abort(kRememberedSetPointerInNewSpace);
bind(&ok);
}
// Load store buffer top.
@@ -3791,9 +3774,7 @@
Label ok;
Tst(scratch, (1 << kPointerSizeLog2) - 1);
B(eq, &ok);
- // TODO(all): Add this error code to objects.h.
- // Abort(kUnalignedCellInWriteBarrier);
- Abort(kUnknown);
+ Abort(kUnalignedCellInWriteBarrier);
Bind(&ok);
}
@@ -3899,9 +3880,7 @@
Label color_is_valid;
Tbnz(reg, 0, &color_is_valid);
Tbz(reg, 1, &color_is_valid);
- // TODO(all): Add this error code to objects.h.
- // Abort(kImpossibleColorBitPatternFound);
- Abort(kUnknown);
+ Abort(kUnexpectedColorFound);
Bind(&color_is_valid);
}
}
@@ -3998,9 +3977,7 @@
if (emit_debug_code()) {
And(result, result, LoadLiteralFMask);
Cmp(result, LoadLiteralFixed);
- // TODO(all): Add this error code to objects.h.
- // Check(eq, kTheInstructionToPatchShouldBeALoadLiteral);
- Check(eq, kUnknown);
+ Check(eq, kTheInstructionToPatchShouldBeAnLdrLiteral);
// The instruction was clobbered. Reload it.
Ldr(result, MemOperand(ldr_location));
}
@@ -4310,9 +4287,7 @@
CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, DO_SMI_CHECK);
B(&ok);
Bind(&fail);
- // TODO(all): Add this error code to objects.h.
- // Abort(kGlobalFunctionMustHaveInitialMap);
- Abort(kUnknown);
+ Abort(kGlobalFunctionsMustHaveInitialMap);
Bind(&ok);
}
}
=======================================
--- /branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc Fri
Jan 31 15:15:09 2014 UTC
+++ /branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc Mon
Feb 3 18:20:14 2014 UTC
@@ -384,9 +384,7 @@
__ Cmp(current_input_offset().X(), Operand(current_input_offset(),
SXTW));
__ Ccmp(current_input_offset(), 0, NoFlag, eq);
// The current input offset should be <= 0, and fit in a W register.
- // TODO(all): Add this error code to objects.h.
- // __ Check(le, kCurrentInputOffsetOutOfRange);
- __ Check(le, kUnknown);
+ __ Check(le, kOffsetOutOfRange);
}
} else {
ASSERT(mode_ == UC16);
@@ -487,9 +485,7 @@
__ Cmp(current_input_offset().X(), Operand(current_input_offset(),
SXTW));
__ Ccmp(current_input_offset(), 0, NoFlag, eq);
// The current input offset should be <= 0, and fit in a W register.
- // TODO(all): Add this error code to objects.h.
- // __ Check(le, kCurrentInputOffsetOutOfRange);
- __ Check(le, kUnknown);
+ __ Check(le, kOffsetOutOfRange);
}
__ Bind(&fallthrough);
}
@@ -777,9 +773,7 @@
// Check that the input string length is < 2^30.
__ Neg(x11, x10);
__ Cmp(x11, (1<<30) - 1);
- // TODO(all): Add this error code to objects.h.
- // __ Check(ls, kInputStringTooLong);
- __ Check(ls, kUnknown);
+ __ Check(ls, kInputStringTooLong);
}
__ Mov(current_input_offset(), w10);
@@ -844,9 +838,7 @@
if (masm_->emit_debug_code()) {
// Check that the input string length is < 2^30.
__ Cmp(x10, (1<<30) - 1);
- // TODO(all): Add this error code to objects.h.
- // __ Check(ls, kInputStringTooLong);
- __ Check(ls, kUnknown);
+ __ Check(ls, kInputStringTooLong);
}
// input_start has a start_offset offset on entry. We need to include
// it when computing the length of the whole string.
@@ -1144,9 +1136,7 @@
if (masm_->emit_debug_code()) {
__ Cmp(x10, kWRegMask);
// The code offset has to fit in a W register.
- // TODO(all): Add this error code to objects.h.
- // __ Check(ls, kCodeOffsetOutOfRange);
- __ Check(ls, kUnknown);
+ __ Check(ls, kOffsetOutOfRange);
}
}
Push(w10);
@@ -1304,9 +1294,7 @@
if (masm_->emit_debug_code()) {
__ Cmp(x10, Operand(w10, SXTW));
// The stack offset needs to fit in a W register.
- // TODO(all): Add this error code to objects.h.
- // __ Check(eq, kStackOffsetIsTooLarge);
- __ Check(eq, kUnknown);
+ __ Check(eq, kOffsetOutOfRange);
}
StoreRegister(reg, w10);
}
@@ -1709,9 +1697,7 @@
__ Add(x10, x10, Operand(current_input_offset(), SXTW));
__ Cmp(x10, Operand(w10, SXTW));
// The offset needs to fit in a W register.
- // TODO(all): Add this error code to objects.h.
- // __ Check(eq, kCurrentInputOffsetOutOfRange);
- __ Check(eq, kUnknown);
+ __ Check(eq, kOffsetOutOfRange);
} else {
__ Add(w10, current_input_offset(), cp_offset * char_size());
}
=======================================
--- /branches/experimental/a64/src/objects.h Mon Feb 3 17:17:35 2014 UTC
+++ /branches/experimental/a64/src/objects.h Mon Feb 3 18:20:14 2014 UTC
@@ -1098,6 +1098,7 @@
V(kCodeObjectNotProperlyPatched, "code object not properly
patched") \
V(kCompoundAssignmentToLookupSlot, "compound assignment to lookup
slot") \
V(kContextAllocatedArguments, "context-allocated
arguments") \
+ V(kCopyBuffersOverlap, "copy buffers
overlap") \
V(kCouldNotGenerateZero, "could not generate
+0.0") \
V(kCouldNotGenerateNegativeZero, "could not generate
-0.0") \
V(kDebuggerIsActive, "debugger is
active") \
@@ -1112,12 +1113,17 @@
"DontDelete cells can't contain the
hole") \
V(kDoPushArgumentNotImplementedForDoubleType,
\
"DoPushArgument not implemented for double
type") \
+ V(kEliminatedBoundsCheckFailed, "eliminated bounds check
failed") \
V(kEmitLoadRegisterUnsupportedDoubleImmediate,
\
"EmitLoadRegister: Unsupported double
immediate") \
V(kEval, "eval")
\
V(kExpected0AsASmiSentinel, "Expected 0 as a Smi
sentinel") \
V(kExpectedAlignmentMarker, "expected alignment
marker") \
+ V(kExpectedFunctionObject, "expected function object in
register") \
+ V(kExpectedHeapNumber, "expected
HeapNumber") \
+ V(kExpectedNativeContext, "expected native
context") \
V(kExpectedNonIdenticalObjects, "expected non-identical
objects") \
+ V(kExpectedNonNullContext, "expected non-null
context") \
V(kExpectedPositiveZero, "expected
+0.0") \
V(kExpectedPropertyCellInTypeInfoCell,
\
"Expected property cell in
type_info_cell") \
@@ -1171,6 +1177,7 @@
V(kInliningBailedOut, "inlining bailed
out") \
V(kInputGPRIsExpectedToHaveUpper32Cleared,
\
"input GPR is expected to have upper32
cleared") \
+ V(kInputStringTooLong, "input string too
long") \
V(kInstanceofStubUnexpectedCallSiteCacheCheck,
\
"InstanceofStub unexpected call site cache
(check)") \
V(kInstanceofStubUnexpectedCallSiteCacheCmp1,
\
@@ -1226,6 +1233,7 @@
"Object literal with complex
property") \
V(kOddballInStringTableIsNotUndefinedOrTheHole,
\
"oddball in string table is not undefined or the
hole") \
+ V(kOffsetOutOfRange, "offset out of
range") \
V(kOperandIsASmiAndNotAName, "Operand is a smi and not a
name") \
V(kOperandIsASmiAndNotAString, "Operand is a smi and not a
string") \
V(kOperandIsASmi, "Operand is a
smi") \
@@ -1250,6 +1258,7 @@
V(kReferenceToUninitializedVariable, "reference to uninitialized
variable") \
V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected
root") \
V(kRegisterWasClobbered, "register was
clobbered") \
+ V(kRememberedSetPointerInNewSpace, "remembered set pointer is in new
space") \
V(kReturnAddressNotFoundInFrame, "return address not found in
frame") \
V(kRhsHasBeenClobbered, "rhs has been
clobbered") \
V(kScopedBlock, "ScopedBlock")
\
@@ -1267,6 +1276,8 @@
V(kTheInstructionShouldBeAnOri, "The instruction should be an
ori") \
V(kTheInstructionToPatchShouldBeALoadFromPc,
\
"The instruction to patch should be a load from
pc") \
+
V(kTheInstructionToPatchShouldBeAnLdrLiteral,
\
+ "The instruction to patch should be a ldr
literal") \
V(kTheInstructionToPatchShouldBeALui,
\
"The instruction to patch should be a
lui") \
V(kTheInstructionToPatchShouldBeAnOri,
\
@@ -1278,6 +1289,7 @@
V(kTooManyParametersLocals, "too many
parameters/locals") \
V(kTooManyParameters, "too many
parameters") \
V(kTooManySpillSlotsNeededForOSR, "Too many spill slots needed for
OSR") \
+ V(kToOperand32UnsupportedImmediate, "ToOperand32 unsupported
immediate.") \
V(kToOperandIsDoubleRegisterUnimplemented,
\
"ToOperand IsDoubleRegister
unimplemented") \
V(kToOperandUnsupportedDoubleImmediate,
\
@@ -1286,10 +1298,12 @@
V(kTryFinallyStatement, "TryFinallyStatement")
\
V(kUnableToEncodeValueAsSmi, "Unable to encode value as
smi") \
V(kUnalignedAllocationInNewSpace, "Unaligned allocation in new
space") \
+ V(kUnalignedCellInWriteBarrier, "Unaligned cell in write
barrier") \
V(kUndefinedValueNotLoaded, "Undefined value not
loaded") \
V(kUndoAllocationOfNonAllocatedMemory,
\
"Undo allocation of non allocated
memory") \
V(kUnexpectedAllocationTop, "Unexpected allocation
top") \
+ V(kUnexpectedColorFound, "Unexpected color bit pattern
found") \
V(kUnexpectedElementsKindInArrayConstructor,
\
"Unexpected ElementsKind in array
constructor") \
V(kUnexpectedFallthroughFromCharCodeAtSlowCase,
\
@@ -1316,18 +1330,19 @@
"Unexpected initial map for InternalArray
function") \
V(kUnexpectedLevelAfterReturnFromApiCall,
\
"Unexpected level after return from api
call") \
+ V(kUnexpectedNegativeValue, "Unexpected negative
value") \
V(kUnexpectedNumberOfPreAllocatedPropertyFields,
\
"Unexpected number of pre-allocated property
fields") \
+ V(kUnexpectedSmi, "Unexpected smi
value") \
V(kUnexpectedStringFunction, "Unexpected String
function") \
V(kUnexpectedStringType, "Unexpected string
type") \
V(kUnexpectedStringWrapperInstanceSize,
\
"Unexpected string wrapper instance
size") \
V(kUnexpectedTypeForRegExpDataFixedArrayExpected,
\
"Unexpected type for RegExp data, FixedArray
expected") \
+ V(kUnexpectedValue, "Unexpected
value") \
V(kUnexpectedUnusedPropertiesOfStringWrapper,
\
"Unexpected unused properties of string
wrapper") \
-
V(kUnimplementedHydrogenInstruction,
\
- "unimplemented Hydrogen
instruction") \
V(kUninitializedKSmiConstantRegister, "Uninitialized
kSmiConstantRegister") \
V(kUnknown, "unknown")
\
V(kUnsupportedConstCompoundAssignment,
\
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.