Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index d0fd3358aa49d237c0fa27ca03c9745f1f9d7824..5a30ab70a8ec255db25a85b518c9c9d5cb699a47 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -351,7 +351,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
{ |
// Call the runtime system in a fresh internal frame. |
FrameScope scope(masm, StackFrame::INTERNAL); |
- ASSERT(param_count == 0 || |
+ DCHECK(param_count == 0 || |
rax.is(descriptor->GetEnvironmentParameterRegister( |
param_count - 1))); |
// Push arguments |
@@ -400,7 +400,7 @@ class FloatingPointHelper : public AllStatic { |
void DoubleToIStub::Generate(MacroAssembler* masm) { |
Register input_reg = this->source(); |
Register final_result_reg = this->destination(); |
- ASSERT(is_truncating()); |
+ DCHECK(is_truncating()); |
Label check_negative, process_64_bits, done; |
@@ -472,7 +472,7 @@ void DoubleToIStub::Generate(MacroAssembler* masm) { |
__ addp(rsp, Immediate(kDoubleSize)); |
} |
if (!final_result_reg.is(result_reg)) { |
- ASSERT(final_result_reg.is(rcx)); |
+ DCHECK(final_result_reg.is(rcx)); |
__ movl(final_result_reg, result_reg); |
} |
__ popq(save_reg); |
@@ -753,7 +753,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
__ bind(&call_runtime); |
// Move base to the correct argument register. Exponent is already in xmm1. |
__ movsd(xmm0, double_base); |
- ASSERT(double_exponent.is(xmm1)); |
+ DCHECK(double_exponent.is(xmm1)); |
{ |
AllowExternalCallThatCantCauseGC scope(masm); |
__ PrepareCallCFunction(2); |
@@ -1632,8 +1632,8 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
static int NegativeComparisonResult(Condition cc) { |
- ASSERT(cc != equal); |
- ASSERT((cc == less) || (cc == less_equal) |
+ DCHECK(cc != equal); |
+ DCHECK((cc == less) || (cc == less_equal) |
|| (cc == greater) || (cc == greater_equal)); |
return (cc == greater || cc == greater_equal) ? LESS : GREATER; |
} |
@@ -1823,7 +1823,7 @@ void ICCompareStub::GenerateGeneric(MacroAssembler* masm) { |
// If one of the numbers was NaN, then the result is always false. |
// The cc is never not-equal. |
__ bind(&unordered); |
- ASSERT(cc != not_equal); |
+ DCHECK(cc != not_equal); |
if (cc == less || cc == less_equal) { |
__ Set(rax, 1); |
} else { |
@@ -2465,7 +2465,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
__ movp(rdx, r15); // argv. |
__ Move(r8, ExternalReference::isolate_address(isolate())); |
} else { |
- ASSERT_EQ(2, result_size_); |
+ DCHECK_EQ(2, result_size_); |
// Pass a pointer to the result location as the first argument. |
__ leap(rcx, StackSpaceOperand(2)); |
// Pass a pointer to the Arguments object as the second argument. |
@@ -2486,7 +2486,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
#ifdef _WIN64 |
// If return value is on the stack, pop it to registers. |
if (result_size_ > 1) { |
- ASSERT_EQ(2, result_size_); |
+ DCHECK_EQ(2, result_size_); |
// Read result values stored on stack. Result is stored |
// above the four argument mirror slots and the two |
// Arguments object slots. |
@@ -2760,8 +2760,8 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0; |
- ASSERT_EQ(object.code(), InstanceofStub::left().code()); |
- ASSERT_EQ(function.code(), InstanceofStub::right().code()); |
+ DCHECK_EQ(object.code(), InstanceofStub::left().code()); |
+ DCHECK_EQ(function.code(), InstanceofStub::right().code()); |
// Get the object and function - they are always both needed. |
// Go slow case if the object is a smi. |
@@ -2812,7 +2812,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
} else { |
// The constants for the code patching are based on push instructions |
// at the call site. |
- ASSERT(!HasArgsInRegisters()); |
+ DCHECK(!HasArgsInRegisters()); |
// Get return address and delta to inlined map check. |
__ movq(kScratchRegister, StackOperandForReturnAddress(0)); |
__ subp(kScratchRegister, args.GetArgumentOperand(2)); |
@@ -2855,7 +2855,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
int true_offset = 0x100 + |
(Heap::kTrueValueRootIndex << kPointerSizeLog2) - kRootRegisterBias; |
// Assert it is a 1-byte signed value. |
- ASSERT(true_offset >= 0 && true_offset < 0x100); |
+ DCHECK(true_offset >= 0 && true_offset < 0x100); |
__ movl(rax, Immediate(true_offset)); |
__ movq(kScratchRegister, StackOperandForReturnAddress(0)); |
__ subp(kScratchRegister, args.GetArgumentOperand(2)); |
@@ -2884,7 +2884,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
int false_offset = 0x100 + |
(Heap::kFalseValueRootIndex << kPointerSizeLog2) - kRootRegisterBias; |
// Assert it is a 1-byte signed value. |
- ASSERT(false_offset >= 0 && false_offset < 0x100); |
+ DCHECK(false_offset >= 0 && false_offset < 0x100); |
__ movl(rax, Immediate(false_offset)); |
__ movq(kScratchRegister, StackOperandForReturnAddress(0)); |
__ subp(kScratchRegister, args.GetArgumentOperand(2)); |
@@ -2902,7 +2902,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
__ bind(&slow); |
if (!ReturnTrueFalseObject()) { |
// Tail call the builtin which returns 0 or 1. |
- ASSERT(!HasArgsInRegisters()); |
+ DCHECK(!HasArgsInRegisters()); |
if (HasCallSiteInlineCheck()) { |
// Remove extra value from the stack. |
__ PopReturnAddressTo(rcx); |
@@ -2995,7 +2995,7 @@ void StringCharCodeAtGenerator::GenerateSlow( |
if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
__ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
} else { |
- ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
+ DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
// NumberToSmi discards numbers that are not exact integers. |
__ CallRuntime(Runtime::kNumberToSmi, 1); |
} |
@@ -3596,7 +3596,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
void ICCompareStub::GenerateSmis(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::SMI); |
+ DCHECK(state_ == CompareIC::SMI); |
Label miss; |
__ JumpIfNotBothSmi(rdx, rax, &miss, Label::kNear); |
@@ -3620,7 +3620,7 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) { |
void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::NUMBER); |
+ DCHECK(state_ == CompareIC::NUMBER); |
Label generic_stub; |
Label unordered, maybe_undefined1, maybe_undefined2; |
@@ -3697,8 +3697,8 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { |
void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::INTERNALIZED_STRING); |
- ASSERT(GetCondition() == equal); |
+ DCHECK(state_ == CompareIC::INTERNALIZED_STRING); |
+ DCHECK(GetCondition() == equal); |
// Registers containing left and right operands respectively. |
Register left = rdx; |
@@ -3726,7 +3726,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { |
__ cmpp(left, right); |
// Make sure rax is non-zero. At this point input operands are |
// guaranteed to be non-zero. |
- ASSERT(right.is(rax)); |
+ DCHECK(right.is(rax)); |
__ j(not_equal, &done, Label::kNear); |
STATIC_ASSERT(EQUAL == 0); |
STATIC_ASSERT(kSmiTag == 0); |
@@ -3740,8 +3740,8 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { |
void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::UNIQUE_NAME); |
- ASSERT(GetCondition() == equal); |
+ DCHECK(state_ == CompareIC::UNIQUE_NAME); |
+ DCHECK(GetCondition() == equal); |
// Registers containing left and right operands respectively. |
Register left = rdx; |
@@ -3769,7 +3769,7 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { |
__ cmpp(left, right); |
// Make sure rax is non-zero. At this point input operands are |
// guaranteed to be non-zero. |
- ASSERT(right.is(rax)); |
+ DCHECK(right.is(rax)); |
__ j(not_equal, &done, Label::kNear); |
STATIC_ASSERT(EQUAL == 0); |
STATIC_ASSERT(kSmiTag == 0); |
@@ -3783,7 +3783,7 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { |
void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::STRING); |
+ DCHECK(state_ == CompareIC::STRING); |
Label miss; |
bool equality = Token::IsEqualityOp(op_); |
@@ -3834,7 +3834,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
__ j(not_zero, &do_compare, Label::kNear); |
// Make sure rax is non-zero. At this point input operands are |
// guaranteed to be non-zero. |
- ASSERT(right.is(rax)); |
+ DCHECK(right.is(rax)); |
__ ret(0); |
__ bind(&do_compare); |
} |
@@ -3870,7 +3870,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
void ICCompareStub::GenerateObjects(MacroAssembler* masm) { |
- ASSERT(state_ == CompareIC::OBJECT); |
+ DCHECK(state_ == CompareIC::OBJECT); |
Label miss; |
Condition either_smi = masm->CheckEitherSmi(rdx, rax); |
__ j(either_smi, &miss, Label::kNear); |
@@ -3880,7 +3880,7 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) { |
__ CmpObjectType(rdx, JS_OBJECT_TYPE, rcx); |
__ j(not_equal, &miss, Label::kNear); |
- ASSERT(GetCondition() == equal); |
+ DCHECK(GetCondition() == equal); |
__ subp(rax, rdx); |
__ ret(0); |
@@ -3940,7 +3940,7 @@ void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
Register properties, |
Handle<Name> name, |
Register r0) { |
- ASSERT(name->IsUniqueName()); |
+ DCHECK(name->IsUniqueName()); |
// If names of slots in range from 1 to kProbes - 1 for the hash value are |
// not equal to the name and kProbes-th slot is not used (its name is the |
// undefined value), it guarantees the hash table doesn't contain the |
@@ -3957,12 +3957,12 @@ void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
Immediate(name->Hash() + NameDictionary::GetProbeOffset(i))); |
// Scale the index by multiplying by the entry size. |
- ASSERT(NameDictionary::kEntrySize == 3); |
+ DCHECK(NameDictionary::kEntrySize == 3); |
__ leap(index, Operand(index, index, times_2, 0)); // index *= 3. |
Register entity_name = r0; |
// Having undefined at this place means the name is not contained. |
- ASSERT_EQ(kSmiTagSize, 1); |
+ DCHECK_EQ(kSmiTagSize, 1); |
__ movp(entity_name, Operand(properties, |
index, |
times_pointer_size, |
@@ -4008,10 +4008,10 @@ void NameDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, |
Register name, |
Register r0, |
Register r1) { |
- ASSERT(!elements.is(r0)); |
- ASSERT(!elements.is(r1)); |
- ASSERT(!name.is(r0)); |
- ASSERT(!name.is(r1)); |
+ DCHECK(!elements.is(r0)); |
+ DCHECK(!elements.is(r1)); |
+ DCHECK(!name.is(r0)); |
+ DCHECK(!name.is(r1)); |
__ AssertName(name); |
@@ -4028,7 +4028,7 @@ void NameDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, |
__ andp(r1, r0); |
// Scale the index by multiplying by the entry size. |
- ASSERT(NameDictionary::kEntrySize == 3); |
+ DCHECK(NameDictionary::kEntrySize == 3); |
__ leap(r1, Operand(r1, r1, times_2, 0)); // r1 = r1 * 3 |
// Check if the key is identical to the name. |
@@ -4090,7 +4090,7 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) { |
__ andp(scratch, Operand(rsp, 0)); |
// Scale the index by multiplying by the entry size. |
- ASSERT(NameDictionary::kEntrySize == 3); |
+ DCHECK(NameDictionary::kEntrySize == 3); |
__ leap(index_, Operand(scratch, scratch, times_2, 0)); // index *= 3. |
// Having undefined at this place means the name is not contained. |
@@ -4232,8 +4232,8 @@ void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm) { |
regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
Register address = |
arg_reg_1.is(regs_.address()) ? kScratchRegister : regs_.address(); |
- ASSERT(!address.is(regs_.object())); |
- ASSERT(!address.is(arg_reg_1)); |
+ DCHECK(!address.is(regs_.object())); |
+ DCHECK(!address.is(arg_reg_1)); |
__ Move(address, regs_.address()); |
__ Move(arg_reg_1, regs_.object()); |
// TODO(gc) Can we just set address arg2 in the beginning? |
@@ -4524,12 +4524,12 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm, |
Label normal_sequence; |
if (mode == DONT_OVERRIDE) { |
- ASSERT(FAST_SMI_ELEMENTS == 0); |
- ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); |
- ASSERT(FAST_ELEMENTS == 2); |
- ASSERT(FAST_HOLEY_ELEMENTS == 3); |
- ASSERT(FAST_DOUBLE_ELEMENTS == 4); |
- ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == 5); |
+ DCHECK(FAST_SMI_ELEMENTS == 0); |
+ DCHECK(FAST_HOLEY_SMI_ELEMENTS == 1); |
+ DCHECK(FAST_ELEMENTS == 2); |
+ DCHECK(FAST_HOLEY_ELEMENTS == 3); |
+ DCHECK(FAST_DOUBLE_ELEMENTS == 4); |
+ DCHECK(FAST_HOLEY_DOUBLE_ELEMENTS == 5); |
// is the low bit set? If so, we are holey and that is good. |
__ testb(rdx, Immediate(1)); |
@@ -4888,7 +4888,7 @@ void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
// It's okay if api_function_address == callback_arg |
// but not arguments_arg |
- ASSERT(!api_function_address.is(arguments_arg)); |
+ DCHECK(!api_function_address.is(arguments_arg)); |
// v8::InvocationCallback's argument. |
__ leap(arguments_arg, StackSpaceOperand(0)); |
@@ -4958,7 +4958,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) { |
// It's okay if api_function_address == getter_arg |
// but not accessor_info_arg or name_arg |
- ASSERT(!api_function_address.is(accessor_info_arg) && |
+ DCHECK(!api_function_address.is(accessor_info_arg) && |
!api_function_address.is(name_arg)); |
// The name handler is counted as an argument. |