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

Unified Diff: src/x87/lithium-codegen-x87.cc

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x87/lithium-codegen-x87.h ('k') | src/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index 2dfb389642e1ab85656ef54195d4fe014e0219a5..8ba73c62367520db89d3d7edb0b57717acec08b1 100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -47,7 +47,7 @@ class SafepointGenerator V8_FINAL : public CallWrapper {
bool LCodeGen::GenerateCode() {
LPhase phase("Z_Code generation", chunk());
- ASSERT(is_unused());
+ DCHECK(is_unused());
status_ = GENERATING;
// Open a frame scope to indicate that there is a frame on the stack. The
@@ -71,7 +71,7 @@ bool LCodeGen::GenerateCode() {
void LCodeGen::FinishCode(Handle<Code> code) {
- ASSERT(is_done());
+ DCHECK(is_done());
code->set_stack_slots(GetStackSlotCount());
code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code);
@@ -93,7 +93,7 @@ void LCodeGen::MakeSureStackPagesMapped(int offset) {
bool LCodeGen::GeneratePrologue() {
- ASSERT(is_generating());
+ DCHECK(is_generating());
if (info()->IsOptimizing()) {
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -155,7 +155,7 @@ bool LCodeGen::GeneratePrologue() {
info()->set_prologue_offset(masm_->pc_offset());
if (NeedsEagerFrame()) {
- ASSERT(!frame_is_built_);
+ DCHECK(!frame_is_built_);
frame_is_built_ = true;
if (info()->IsStub()) {
__ StubPrologue();
@@ -174,7 +174,7 @@ bool LCodeGen::GeneratePrologue() {
// Reserve space for the stack slots needed by the code.
int slots = GetStackSlotCount();
- ASSERT(slots != 0 || !info()->IsOptimizing());
+ DCHECK(slots != 0 || !info()->IsOptimizing());
if (slots > 0) {
if (slots == 1) {
if (dynamic_frame_alignment_) {
@@ -323,7 +323,7 @@ void LCodeGen::GenerateOsrPrologue() {
// Adjust the frame size, subsuming the unoptimized frame into the
// optimized frame.
int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots();
- ASSERT(slots >= 1);
+ DCHECK(slots >= 1);
__ sub(esp, Immediate((slots - 1) * kPointerSize));
}
@@ -346,9 +346,9 @@ void LCodeGen::GenerateBodyInstructionPost(LInstruction* instr) {
!instr->IsGap() && !instr->IsReturn()) {
if (instr->ClobbersDoubleRegisters(isolate())) {
if (instr->HasDoubleRegisterResult()) {
- ASSERT_EQ(1, x87_stack_.depth());
+ DCHECK_EQ(1, x87_stack_.depth());
} else {
- ASSERT_EQ(0, x87_stack_.depth());
+ DCHECK_EQ(0, x87_stack_.depth());
}
}
__ VerifyX87StackDepth(x87_stack_.depth());
@@ -372,7 +372,7 @@ bool LCodeGen::GenerateJumpTable() {
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
if (jump_table_[i].needs_frame) {
- ASSERT(!info()->saves_caller_doubles());
+ DCHECK(!info()->saves_caller_doubles());
__ push(Immediate(ExternalReference::ForDeoptEntry(entry)));
if (needs_frame.is_bound()) {
__ jmp(&needs_frame);
@@ -382,7 +382,7 @@ bool LCodeGen::GenerateJumpTable() {
// This variant of deopt can only be used with stubs. Since we don't
// have a function pointer to install in the stack frame that we're
// building, install a special marker there instead.
- ASSERT(info()->IsStub());
+ DCHECK(info()->IsStub());
__ push(Immediate(Smi::FromInt(StackFrame::STUB)));
// Push a PC inside the function so that the deopt code can find where
// the deopt comes from. It doesn't have to be the precise return
@@ -407,7 +407,7 @@ bool LCodeGen::GenerateJumpTable() {
bool LCodeGen::GenerateDeferredCode() {
- ASSERT(is_generating());
+ DCHECK(is_generating());
if (deferred_.length() > 0) {
for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
LDeferredCode* code = deferred_[i];
@@ -427,8 +427,8 @@ bool LCodeGen::GenerateDeferredCode() {
__ bind(code->entry());
if (NeedsDeferredFrame()) {
Comment(";;; Build frame");
- ASSERT(!frame_is_built_);
- ASSERT(info()->IsStub());
+ DCHECK(!frame_is_built_);
+ DCHECK(info()->IsStub());
frame_is_built_ = true;
// Build the frame in such a way that esi isn't trashed.
__ push(ebp); // Caller's frame pointer.
@@ -441,7 +441,7 @@ bool LCodeGen::GenerateDeferredCode() {
if (NeedsDeferredFrame()) {
__ bind(code->done());
Comment(";;; Destroy frame");
- ASSERT(frame_is_built_);
+ DCHECK(frame_is_built_);
frame_is_built_ = false;
__ mov(esp, ebp);
__ pop(ebp);
@@ -458,7 +458,7 @@ bool LCodeGen::GenerateDeferredCode() {
bool LCodeGen::GenerateSafepointTable() {
- ASSERT(is_done());
+ DCHECK(is_done());
if (!info()->IsStub()) {
// For lazy deoptimization we need space to patch a call after every call.
// Ensure there is always space for such patching, even if the code ends
@@ -484,15 +484,15 @@ X87Register LCodeGen::ToX87Register(int index) const {
void LCodeGen::X87LoadForUsage(X87Register reg) {
- ASSERT(x87_stack_.Contains(reg));
+ DCHECK(x87_stack_.Contains(reg));
x87_stack_.Fxch(reg);
x87_stack_.pop();
}
void LCodeGen::X87LoadForUsage(X87Register reg1, X87Register reg2) {
- ASSERT(x87_stack_.Contains(reg1));
- ASSERT(x87_stack_.Contains(reg2));
+ DCHECK(x87_stack_.Contains(reg1));
+ DCHECK(x87_stack_.Contains(reg2));
x87_stack_.Fxch(reg1, 1);
x87_stack_.Fxch(reg2);
x87_stack_.pop();
@@ -501,8 +501,8 @@ void LCodeGen::X87LoadForUsage(X87Register reg1, X87Register reg2) {
void LCodeGen::X87Stack::Fxch(X87Register reg, int other_slot) {
- ASSERT(is_mutable_);
- ASSERT(Contains(reg) && stack_depth_ > other_slot);
+ DCHECK(is_mutable_);
+ DCHECK(Contains(reg) && stack_depth_ > other_slot);
int i = ArrayIndex(reg);
int st = st2idx(i);
if (st != other_slot) {
@@ -546,8 +546,8 @@ bool LCodeGen::X87Stack::Contains(X87Register reg) {
void LCodeGen::X87Stack::Free(X87Register reg) {
- ASSERT(is_mutable_);
- ASSERT(Contains(reg));
+ DCHECK(is_mutable_);
+ DCHECK(Contains(reg));
int i = ArrayIndex(reg);
int st = st2idx(i);
if (st > 0) {
@@ -572,7 +572,7 @@ void LCodeGen::X87Mov(X87Register dst, Operand src, X87OperandType opts) {
void LCodeGen::X87Fld(Operand src, X87OperandType opts) {
- ASSERT(!src.is_reg_only());
+ DCHECK(!src.is_reg_only());
switch (opts) {
case kX87DoubleOperand:
__ fld_d(src);
@@ -590,7 +590,7 @@ void LCodeGen::X87Fld(Operand src, X87OperandType opts) {
void LCodeGen::X87Mov(Operand dst, X87Register src, X87OperandType opts) {
- ASSERT(!dst.is_reg_only());
+ DCHECK(!dst.is_reg_only());
x87_stack_.Fxch(src);
switch (opts) {
case kX87DoubleOperand:
@@ -606,7 +606,7 @@ void LCodeGen::X87Mov(Operand dst, X87Register src, X87OperandType opts) {
void LCodeGen::X87Stack::PrepareToWrite(X87Register reg) {
- ASSERT(is_mutable_);
+ DCHECK(is_mutable_);
if (Contains(reg)) {
Free(reg);
}
@@ -616,9 +616,9 @@ void LCodeGen::X87Stack::PrepareToWrite(X87Register reg) {
void LCodeGen::X87Stack::CommitWrite(X87Register reg) {
- ASSERT(is_mutable_);
+ DCHECK(is_mutable_);
// Assert the reg is prepared to write, but not on the virtual stack yet
- ASSERT(!Contains(reg) && stack_[stack_depth_].is(reg) &&
+ DCHECK(!Contains(reg) && stack_[stack_depth_].is(reg) &&
stack_depth_ < X87Register::kMaxNumAllocatableRegisters);
stack_depth_++;
}
@@ -627,7 +627,7 @@ void LCodeGen::X87Stack::CommitWrite(X87Register reg) {
void LCodeGen::X87PrepareBinaryOp(
X87Register left, X87Register right, X87Register result) {
// You need to use DefineSameAsFirst for x87 instructions
- ASSERT(result.is(left));
+ DCHECK(result.is(left));
x87_stack_.Fxch(right, 1);
x87_stack_.Fxch(left);
}
@@ -660,7 +660,7 @@ void LCodeGen::X87Stack::FlushIfNecessary(LInstruction* instr, LCodeGen* cgen) {
void LCodeGen::X87Stack::LeavingBlock(int current_block_id, LGoto* goto_instr) {
- ASSERT(stack_depth_ <= 1);
+ DCHECK(stack_depth_ <= 1);
// If ever used for new stubs producing two pairs of doubles joined into two
// phis this assert hits. That situation is not handled, since the two stacks
// might have st0 and st1 swapped.
@@ -677,7 +677,7 @@ void LCodeGen::EmitFlushX87ForDeopt() {
// The deoptimizer does not support X87 Registers. But as long as we
// deopt from a stub its not a problem, since we will re-materialize the
// original stub inputs, which can't be double registers.
- ASSERT(info()->IsStub());
+ DCHECK(info()->IsStub());
if (FLAG_debug_code && FLAG_enable_slow_asserts) {
__ pushfd();
__ VerifyX87StackDepth(x87_stack_.depth());
@@ -688,13 +688,13 @@ void LCodeGen::EmitFlushX87ForDeopt() {
Register LCodeGen::ToRegister(LOperand* op) const {
- ASSERT(op->IsRegister());
+ DCHECK(op->IsRegister());
return ToRegister(op->index());
}
X87Register LCodeGen::ToX87Register(LOperand* op) const {
- ASSERT(op->IsDoubleRegister());
+ DCHECK(op->IsDoubleRegister());
return ToX87Register(op->index());
}
@@ -709,28 +709,28 @@ int32_t LCodeGen::ToRepresentation(LConstantOperand* op,
HConstant* constant = chunk_->LookupConstant(op);
int32_t value = constant->Integer32Value();
if (r.IsInteger32()) return value;
- ASSERT(r.IsSmiOrTagged());
+ DCHECK(r.IsSmiOrTagged());
return reinterpret_cast<int32_t>(Smi::FromInt(value));
}
Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const {
HConstant* constant = chunk_->LookupConstant(op);
- ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged());
+ DCHECK(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged());
return constant->handle(isolate());
}
double LCodeGen::ToDouble(LConstantOperand* op) const {
HConstant* constant = chunk_->LookupConstant(op);
- ASSERT(constant->HasDoubleValue());
+ DCHECK(constant->HasDoubleValue());
return constant->DoubleValue();
}
ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const {
HConstant* constant = chunk_->LookupConstant(op);
- ASSERT(constant->HasExternalReferenceValue());
+ DCHECK(constant->HasExternalReferenceValue());
return constant->ExternalReferenceValue();
}
@@ -746,15 +746,15 @@ bool LCodeGen::IsSmi(LConstantOperand* op) const {
static int ArgumentsOffsetWithoutFrame(int index) {
- ASSERT(index < 0);
+ DCHECK(index < 0);
return -(index + 1) * kPointerSize + kPCOnStackSize;
}
Operand LCodeGen::ToOperand(LOperand* op) const {
if (op->IsRegister()) return Operand(ToRegister(op));
- ASSERT(!op->IsDoubleRegister());
- ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
+ DCHECK(!op->IsDoubleRegister());
+ DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
if (NeedsEagerFrame()) {
return Operand(ebp, StackSlotOffset(op->index()));
} else {
@@ -766,7 +766,7 @@ Operand LCodeGen::ToOperand(LOperand* op) const {
Operand LCodeGen::HighOperand(LOperand* op) {
- ASSERT(op->IsDoubleStackSlot());
+ DCHECK(op->IsDoubleStackSlot());
if (NeedsEagerFrame()) {
return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize);
} else {
@@ -801,13 +801,13 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
translation->BeginConstructStubFrame(closure_id, translation_size);
break;
case JS_GETTER:
- ASSERT(translation_size == 1);
- ASSERT(height == 0);
+ DCHECK(translation_size == 1);
+ DCHECK(height == 0);
translation->BeginGetterStubFrame(closure_id);
break;
case JS_SETTER:
- ASSERT(translation_size == 2);
- ASSERT(height == 0);
+ DCHECK(translation_size == 2);
+ DCHECK(height == 0);
translation->BeginSetterStubFrame(closure_id);
break;
case ARGUMENTS_ADAPTOR:
@@ -904,7 +904,7 @@ void LCodeGen::CallCodeGeneric(Handle<Code> code,
RelocInfo::Mode mode,
LInstruction* instr,
SafepointMode safepoint_mode) {
- ASSERT(instr != NULL);
+ DCHECK(instr != NULL);
__ call(code, mode);
RecordSafepointWithLazyDeopt(instr, safepoint_mode);
@@ -927,14 +927,14 @@ void LCodeGen::CallCode(Handle<Code> code,
void LCodeGen::CallRuntime(const Runtime::Function* fun,
int argc,
LInstruction* instr) {
- ASSERT(instr != NULL);
- ASSERT(instr->HasPointerMap());
+ DCHECK(instr != NULL);
+ DCHECK(instr->HasPointerMap());
__ CallRuntime(fun, argc);
RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
- ASSERT(info()->is_calling());
+ DCHECK(info()->is_calling());
}
@@ -964,7 +964,7 @@ void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id,
RecordSafepointWithRegisters(
instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
- ASSERT(info()->is_calling());
+ DCHECK(info()->is_calling());
}
@@ -1009,9 +1009,9 @@ void LCodeGen::DeoptimizeIf(Condition cc,
LEnvironment* environment,
Deoptimizer::BailoutType bailout_type) {
RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
- ASSERT(environment->HasBeenRegistered());
+ DCHECK(environment->HasBeenRegistered());
int id = environment->deoptimization_index();
- ASSERT(info()->IsOptimizing() || info()->IsStub());
+ DCHECK(info()->IsOptimizing() || info()->IsStub());
Address entry =
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
if (entry == NULL) {
@@ -1032,7 +1032,7 @@ void LCodeGen::DeoptimizeIf(Condition cc,
__ mov(Operand::StaticVariable(count), eax);
__ pop(eax);
__ popfd();
- ASSERT(frame_is_built_);
+ DCHECK(frame_is_built_);
__ call(entry, RelocInfo::RUNTIME_ENTRY);
__ bind(&no_deopt);
__ mov(Operand::StaticVariable(count), eax);
@@ -1058,7 +1058,7 @@ void LCodeGen::DeoptimizeIf(Condition cc,
__ bind(&done);
}
- ASSERT(info()->IsStub() || frame_is_built_);
+ DCHECK(info()->IsStub() || frame_is_built_);
if (cc == no_condition && frame_is_built_) {
__ call(entry, RelocInfo::RUNTIME_ENTRY);
} else {
@@ -1146,7 +1146,7 @@ int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) {
void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() {
- ASSERT(deoptimization_literals_.length() == 0);
+ DCHECK(deoptimization_literals_.length() == 0);
const ZoneList<Handle<JSFunction> >* inlined_closures =
chunk()->inlined_closures();
@@ -1166,7 +1166,7 @@ void LCodeGen::RecordSafepointWithLazyDeopt(
if (safepoint_mode == RECORD_SIMPLE_SAFEPOINT) {
RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt);
} else {
- ASSERT(safepoint_mode == RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
+ DCHECK(safepoint_mode == RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kLazyDeopt);
}
@@ -1178,7 +1178,7 @@ void LCodeGen::RecordSafepoint(
Safepoint::Kind kind,
int arguments,
Safepoint::DeoptMode deopt_mode) {
- ASSERT(kind == expected_safepoint_kind_);
+ DCHECK(kind == expected_safepoint_kind_);
const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands();
Safepoint safepoint =
safepoints_.DefineSafepoint(masm(), kind, arguments, deopt_mode);
@@ -1265,8 +1265,8 @@ void LCodeGen::DoParameter(LParameter* instr) {
void LCodeGen::DoCallStub(LCallStub* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->result()).is(eax));
switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate());
@@ -1297,7 +1297,7 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
- ASSERT(dividend.is(ToRegister(instr->result())));
+ DCHECK(dividend.is(ToRegister(instr->result())));
// Theoretically, a variation of the branch-free code for integer division by
// a power of 2 (calculating the remainder via an additional multiplication
@@ -1330,7 +1330,7 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
void LCodeGen::DoModByConstI(LModByConstI* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->result()).is(eax));
if (divisor == 0) {
DeoptimizeIf(no_condition, instr->environment());
@@ -1358,12 +1358,12 @@ void LCodeGen::DoModI(LModI* instr) {
HMod* hmod = instr->hydrogen();
Register left_reg = ToRegister(instr->left());
- ASSERT(left_reg.is(eax));
+ DCHECK(left_reg.is(eax));
Register right_reg = ToRegister(instr->right());
- ASSERT(!right_reg.is(eax));
- ASSERT(!right_reg.is(edx));
+ DCHECK(!right_reg.is(eax));
+ DCHECK(!right_reg.is(edx));
Register result_reg = ToRegister(instr->result());
- ASSERT(result_reg.is(edx));
+ DCHECK(result_reg.is(edx));
Label done;
// Check for x % 0, idiv would signal a divide error. We have to
@@ -1413,8 +1413,8 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
Register result = ToRegister(instr->result());
- ASSERT(divisor == kMinInt || IsPowerOf2(Abs(divisor)));
- ASSERT(!result.is(dividend));
+ DCHECK(divisor == kMinInt || IsPowerOf2(Abs(divisor)));
+ DCHECK(!result.is(dividend));
// Check for (0 / -x) that will produce negative zero.
HDiv* hdiv = instr->hydrogen();
@@ -1450,7 +1450,7 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
- ASSERT(ToRegister(instr->result()).is(edx));
+ DCHECK(ToRegister(instr->result()).is(edx));
if (divisor == 0) {
DeoptimizeIf(no_condition, instr->environment());
@@ -1482,11 +1482,11 @@ void LCodeGen::DoDivI(LDivI* instr) {
Register dividend = ToRegister(instr->dividend());
Register divisor = ToRegister(instr->divisor());
Register remainder = ToRegister(instr->temp());
- ASSERT(dividend.is(eax));
- ASSERT(remainder.is(edx));
- ASSERT(ToRegister(instr->result()).is(eax));
- ASSERT(!divisor.is(eax));
- ASSERT(!divisor.is(edx));
+ DCHECK(dividend.is(eax));
+ DCHECK(remainder.is(edx));
+ DCHECK(ToRegister(instr->result()).is(eax));
+ DCHECK(!divisor.is(eax));
+ DCHECK(!divisor.is(edx));
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
@@ -1529,7 +1529,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
- ASSERT(dividend.is(ToRegister(instr->result())));
+ DCHECK(dividend.is(ToRegister(instr->result())));
// If the divisor is positive, things are easy: There can be no deopts and we
// can simply do an arithmetic right shift.
@@ -1573,7 +1573,7 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
Register dividend = ToRegister(instr->dividend());
int32_t divisor = instr->divisor();
- ASSERT(ToRegister(instr->result()).is(edx));
+ DCHECK(ToRegister(instr->result()).is(edx));
if (divisor == 0) {
DeoptimizeIf(no_condition, instr->environment());
@@ -1599,7 +1599,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
// In the general case we may need to adjust before and after the truncating
// division to get a flooring division.
Register temp = ToRegister(instr->temp3());
- ASSERT(!temp.is(dividend) && !temp.is(eax) && !temp.is(edx));
+ DCHECK(!temp.is(dividend) && !temp.is(eax) && !temp.is(edx));
Label needs_adjustment, done;
__ cmp(dividend, Immediate(0));
__ j(divisor > 0 ? less : greater, &needs_adjustment, Label::kNear);
@@ -1622,11 +1622,11 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
Register divisor = ToRegister(instr->divisor());
Register remainder = ToRegister(instr->temp());
Register result = ToRegister(instr->result());
- ASSERT(dividend.is(eax));
- ASSERT(remainder.is(edx));
- ASSERT(result.is(eax));
- ASSERT(!divisor.is(eax));
- ASSERT(!divisor.is(edx));
+ DCHECK(dividend.is(eax));
+ DCHECK(remainder.is(edx));
+ DCHECK(result.is(eax));
+ DCHECK(!divisor.is(eax));
+ DCHECK(!divisor.is(edx));
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
@@ -1756,8 +1756,8 @@ void LCodeGen::DoMulI(LMulI* instr) {
void LCodeGen::DoBitI(LBitI* instr) {
LOperand* left = instr->left();
LOperand* right = instr->right();
- ASSERT(left->Equals(instr->result()));
- ASSERT(left->IsRegister());
+ DCHECK(left->Equals(instr->result()));
+ DCHECK(left->IsRegister());
if (right->IsConstantOperand()) {
int32_t right_operand =
@@ -1803,10 +1803,10 @@ void LCodeGen::DoBitI(LBitI* instr) {
void LCodeGen::DoShiftI(LShiftI* instr) {
LOperand* left = instr->left();
LOperand* right = instr->right();
- ASSERT(left->Equals(instr->result()));
- ASSERT(left->IsRegister());
+ DCHECK(left->Equals(instr->result()));
+ DCHECK(left->IsRegister());
if (right->IsRegister()) {
- ASSERT(ToRegister(right).is(ecx));
+ DCHECK(ToRegister(right).is(ecx));
switch (instr->op()) {
case Token::ROR:
@@ -1883,7 +1883,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
void LCodeGen::DoSubI(LSubI* instr) {
LOperand* left = instr->left();
LOperand* right = instr->right();
- ASSERT(left->Equals(instr->result()));
+ DCHECK(left->Equals(instr->result()));
if (right->IsConstantOperand()) {
__ sub(ToOperand(left),
@@ -1912,7 +1912,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) {
uint64_t int_val = BitCast<uint64_t, double>(v);
int32_t lower = static_cast<int32_t>(int_val);
int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
- ASSERT(instr->result()->IsDoubleRegister());
+ DCHECK(instr->result()->IsDoubleRegister());
__ push(Immediate(upper));
__ push(Immediate(lower));
@@ -1948,8 +1948,8 @@ void LCodeGen::DoDateField(LDateField* instr) {
Register scratch = ToRegister(instr->temp());
Smi* index = instr->index();
Label runtime, done;
- ASSERT(object.is(result));
- ASSERT(object.is(eax));
+ DCHECK(object.is(result));
+ DCHECK(object.is(eax));
__ test(object, Immediate(kSmiTagMask));
DeoptimizeIf(zero, instr->environment());
@@ -2044,12 +2044,12 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
if (instr->value()->IsConstantOperand()) {
int value = ToRepresentation(LConstantOperand::cast(instr->value()),
Representation::Integer32());
- ASSERT_LE(0, value);
+ DCHECK_LE(0, value);
if (encoding == String::ONE_BYTE_ENCODING) {
- ASSERT_LE(value, String::kMaxOneByteCharCode);
+ DCHECK_LE(value, String::kMaxOneByteCharCode);
__ mov_b(operand, static_cast<int8_t>(value));
} else {
- ASSERT_LE(value, String::kMaxUtf16CodeUnit);
+ DCHECK_LE(value, String::kMaxUtf16CodeUnit);
__ mov_w(operand, static_cast<int16_t>(value));
}
} else {
@@ -2093,7 +2093,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
LOperand* left = instr->left();
LOperand* right = instr->right();
- ASSERT(left->Equals(instr->result()));
+ DCHECK(left->Equals(instr->result()));
HMathMinMax::Operation operation = instr->hydrogen()->operation();
if (instr->hydrogen()->representation().IsSmiOrInteger32()) {
Label return_left;
@@ -2148,7 +2148,7 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
X87Mov(Operand(esp, 1 * kDoubleSize), right);
X87Mov(Operand(esp, 0), left);
X87Free(right);
- ASSERT(left.is(result));
+ DCHECK(left.is(result));
X87PrepareToWrite(result);
__ CallCFunction(
ExternalReference::mod_two_doubles_operation(isolate()),
@@ -2166,10 +2166,10 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->left()).is(edx));
- ASSERT(ToRegister(instr->right()).is(eax));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->left()).is(edx));
+ DCHECK(ToRegister(instr->right()).is(eax));
+ DCHECK(ToRegister(instr->result()).is(eax));
BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
@@ -2216,24 +2216,24 @@ void LCodeGen::DoBranch(LBranch* instr) {
} else if (r.IsDouble()) {
UNREACHABLE();
} else {
- ASSERT(r.IsTagged());
+ DCHECK(r.IsTagged());
Register reg = ToRegister(instr->value());
HType type = instr->hydrogen()->value()->type();
if (type.IsBoolean()) {
- ASSERT(!info()->IsStub());
+ DCHECK(!info()->IsStub());
__ cmp(reg, factory()->true_value());
EmitBranch(instr, equal);
} else if (type.IsSmi()) {
- ASSERT(!info()->IsStub());
+ DCHECK(!info()->IsStub());
__ test(reg, Operand(reg));
EmitBranch(instr, not_equal);
} else if (type.IsJSArray()) {
- ASSERT(!info()->IsStub());
+ DCHECK(!info()->IsStub());
EmitBranch(instr, no_condition);
} else if (type.IsHeapNumber()) {
UNREACHABLE();
} else if (type.IsString()) {
- ASSERT(!info()->IsStub());
+ DCHECK(!info()->IsStub());
__ cmp(FieldOperand(reg, String::kLengthOffset), Immediate(0));
EmitBranch(instr, not_equal);
} else {
@@ -2273,7 +2273,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
Register map = no_reg; // Keep the compiler happy.
if (expected.NeedsMap()) {
map = ToRegister(instr->temp());
- ASSERT(!map.is(reg));
+ DCHECK(!map.is(reg));
__ mov(map, FieldOperand(reg, HeapObject::kMapOffset));
if (expected.CanBeUndetectable()) {
@@ -2467,7 +2467,7 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
Representation rep = instr->hydrogen()->value()->representation();
- ASSERT(!rep.IsInteger32());
+ DCHECK(!rep.IsInteger32());
if (rep.IsDouble()) {
UNREACHABLE();
@@ -2608,7 +2608,7 @@ static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
InstanceType from = instr->from();
InstanceType to = instr->to();
if (from == FIRST_TYPE) return to;
- ASSERT(from == to || to == LAST_TYPE);
+ DCHECK(from == to || to == LAST_TYPE);
return from;
}
@@ -2666,9 +2666,9 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
Register input,
Register temp,
Register temp2) {
- ASSERT(!input.is(temp));
- ASSERT(!input.is(temp2));
- ASSERT(!temp.is(temp2));
+ DCHECK(!input.is(temp));
+ DCHECK(!input.is(temp2));
+ DCHECK(!temp.is(temp2));
__ JumpIfSmi(input, is_false);
if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
@@ -2746,7 +2746,7 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
// Object and function are in fixed registers defined by the stub.
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
@@ -2843,7 +2843,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
// stack is used to pass the offset to the location of the map check to
// the stub.
Register temp = ToRegister(instr->temp());
- ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0);
+ DCHECK(MacroAssembler::SafepointRegisterStackIndex(temp) == 0);
__ LoadHeapObject(InstanceofStub::right(), instr->function());
static const int kAdditionalDelta = 13;
int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta;
@@ -2899,7 +2899,7 @@ void LCodeGen::EmitReturn(LReturn* instr, bool dynamic_frame_alignment) {
__ SmiUntag(reg);
Register return_addr_reg = reg.is(ecx) ? ebx : ecx;
if (dynamic_frame_alignment && FLAG_debug_code) {
- ASSERT(extra_value_count == 2);
+ DCHECK(extra_value_count == 2);
__ cmp(Operand(esp, reg, times_pointer_size,
extra_value_count * kPointerSize),
Immediate(kAlignmentZapValue));
@@ -2966,17 +2966,17 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
+ DCHECK(ToRegister(instr->result()).is(eax));
__ mov(LoadIC::NameRegister(), instr->name());
if (FLAG_vector_ics) {
Register vector = ToRegister(instr->temp_vector());
- ASSERT(vector.is(LoadIC::VectorRegister()));
+ DCHECK(vector.is(LoadIC::VectorRegister()));
__ mov(vector, instr->hydrogen()->feedback_vector());
// No need to allocate this register.
- ASSERT(LoadIC::SlotRegister().is(eax));
+ DCHECK(LoadIC::SlotRegister().is(eax));
__ mov(LoadIC::SlotRegister(),
Immediate(Smi::FromInt(instr->hydrogen()->slot())));
}
@@ -3089,7 +3089,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
void LCodeGen::EmitPushTaggedOperand(LOperand* operand) {
- ASSERT(!operand->IsDoubleRegister());
+ DCHECK(!operand->IsDoubleRegister());
if (operand->IsConstantOperand()) {
Handle<Object> object = ToHandle(LConstantOperand::cast(operand));
AllowDeferredHandleDereference smi_check;
@@ -3107,17 +3107,17 @@ void LCodeGen::EmitPushTaggedOperand(LOperand* operand) {
void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
+ DCHECK(ToRegister(instr->result()).is(eax));
__ mov(LoadIC::NameRegister(), instr->name());
if (FLAG_vector_ics) {
Register vector = ToRegister(instr->temp_vector());
- ASSERT(vector.is(LoadIC::VectorRegister()));
+ DCHECK(vector.is(LoadIC::VectorRegister()));
__ mov(vector, instr->hydrogen()->feedback_vector());
// No need to allocate this register.
- ASSERT(LoadIC::SlotRegister().is(eax));
+ DCHECK(LoadIC::SlotRegister().is(eax));
__ mov(LoadIC::SlotRegister(),
Immediate(Smi::FromInt(instr->hydrogen()->slot())));
}
@@ -3338,16 +3338,16 @@ Operand LCodeGen::BuildFastArrayOperand(
void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
- ASSERT(ToRegister(instr->key()).is(LoadIC::NameRegister()));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
+ DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
if (FLAG_vector_ics) {
Register vector = ToRegister(instr->temp_vector());
- ASSERT(vector.is(LoadIC::VectorRegister()));
+ DCHECK(vector.is(LoadIC::VectorRegister()));
__ mov(vector, instr->hydrogen()->feedback_vector());
// No need to allocate this register.
- ASSERT(LoadIC::SlotRegister().is(eax));
+ DCHECK(LoadIC::SlotRegister().is(eax));
__ mov(LoadIC::SlotRegister(),
Immediate(Smi::FromInt(instr->hydrogen()->slot())));
}
@@ -3462,9 +3462,9 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
Register function = ToRegister(instr->function());
Register length = ToRegister(instr->length());
Register elements = ToRegister(instr->elements());
- ASSERT(receiver.is(eax)); // Used for parameter count.
- ASSERT(function.is(edi)); // Required by InvokeFunction.
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(receiver.is(eax)); // Used for parameter count.
+ DCHECK(function.is(edi)); // Required by InvokeFunction.
+ DCHECK(ToRegister(instr->result()).is(eax));
// Copy the arguments to this function possibly from the
// adaptor frame below it.
@@ -3488,7 +3488,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
// Invoke the function.
__ bind(&invoke);
- ASSERT(instr->HasPointerMap());
+ DCHECK(instr->HasPointerMap());
LPointerMap* pointers = instr->pointer_map();
SafepointGenerator safepoint_generator(
this, pointers, Safepoint::kLazyDeopt);
@@ -3525,13 +3525,13 @@ void LCodeGen::DoContext(LContext* instr) {
__ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset));
} else {
// If there is no frame, the context must be in esi.
- ASSERT(result.is(esi));
+ DCHECK(result.is(esi));
}
}
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
__ push(esi); // The context is the first argument.
__ push(Immediate(instr->hydrogen()->pairs()));
__ push(Immediate(Smi::FromInt(instr->hydrogen()->flags())));
@@ -3583,7 +3583,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) {
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->result()).is(eax));
LPointerMap* pointers = instr->pointer_map();
SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
@@ -3594,7 +3594,7 @@ void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) {
generator.BeforeCall(__ CallSize(code, RelocInfo::CODE_TARGET));
__ call(code, RelocInfo::CODE_TARGET);
} else {
- ASSERT(instr->target()->IsRegister());
+ DCHECK(instr->target()->IsRegister());
Register target = ToRegister(instr->target());
generator.BeforeCall(__ CallSize(Operand(target)));
__ add(target, Immediate(Code::kHeaderSize - kHeapObjectTag));
@@ -3605,8 +3605,8 @@ void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) {
void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) {
- ASSERT(ToRegister(instr->function()).is(edi));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->function()).is(edi));
+ DCHECK(ToRegister(instr->result()).is(eax));
if (instr->hydrogen()->pass_argument_count()) {
__ mov(eax, instr->arity());
@@ -3705,7 +3705,7 @@ void LCodeGen::DoMathAbs(LMathAbs* instr) {
LMathAbs* instr_;
};
- ASSERT(instr->value()->Equals(instr->result()));
+ DCHECK(instr->value()->Equals(instr->result()));
Representation r = instr->hydrogen()->value()->representation();
if (r.IsDouble()) {
@@ -3770,9 +3770,9 @@ void LCodeGen::DoMathExp(LMathExp* instr) {
void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->function()).is(edi));
- ASSERT(instr->HasPointerMap());
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->function()).is(edi));
+ DCHECK(instr->HasPointerMap());
Handle<JSFunction> known_function = instr->hydrogen()->known_function();
if (known_function.is_null()) {
@@ -3792,9 +3792,9 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
void LCodeGen::DoCallFunction(LCallFunction* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->function()).is(edi));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->function()).is(edi));
+ DCHECK(ToRegister(instr->result()).is(eax));
int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
@@ -3803,9 +3803,9 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
void LCodeGen::DoCallNew(LCallNew* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->constructor()).is(edi));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->constructor()).is(edi));
+ DCHECK(ToRegister(instr->result()).is(eax));
// No cell in ebx for construct type feedback in optimized code
__ mov(ebx, isolate()->factory()->undefined_value());
@@ -3816,9 +3816,9 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->constructor()).is(edi));
- ASSERT(ToRegister(instr->result()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->constructor()).is(edi));
+ DCHECK(ToRegister(instr->result()).is(eax));
__ Move(eax, Immediate(instr->arity()));
__ mov(ebx, isolate()->factory()->undefined_value());
@@ -3861,7 +3861,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
CallRuntime(instr->function(), instr->arity(), instr);
}
@@ -3894,7 +3894,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
int offset = access.offset();
if (access.IsExternalMemory()) {
- ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+ DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
MemOperand operand = instr->object()->IsConstantOperand()
? MemOperand::StaticVariable(
ToExternalReference(LConstantOperand::cast(instr->object())))
@@ -3911,13 +3911,13 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
Register object = ToRegister(instr->object());
__ AssertNotSmi(object);
- ASSERT(!representation.IsSmi() ||
+ DCHECK(!representation.IsSmi() ||
!instr->value()->IsConstantOperand() ||
IsSmi(LConstantOperand::cast(instr->value())));
if (representation.IsDouble()) {
- ASSERT(access.IsInobject());
- ASSERT(!instr->hydrogen()->has_transition());
- ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+ DCHECK(access.IsInobject());
+ DCHECK(!instr->hydrogen()->has_transition());
+ DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
X87Register value = ToX87Register(instr->value());
X87Mov(FieldOperand(object, offset), value);
return;
@@ -3952,11 +3952,11 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ Store(value, operand, representation);
} else if (representation.IsInteger32()) {
Immediate immediate = ToImmediate(operand_value, representation);
- ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+ DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
__ mov(operand, immediate);
} else {
Handle<Object> handle_value = ToHandle(operand_value);
- ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+ DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
__ mov(operand, handle_value);
}
} else {
@@ -3980,9 +3980,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->object()).is(StoreIC::ReceiverRegister()));
- ASSERT(ToRegister(instr->value()).is(StoreIC::ValueRegister()));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister()));
+ DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister()));
__ mov(StoreIC::NameRegister(), instr->name());
Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
@@ -4153,16 +4153,16 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
Immediate immediate = ToImmediate(operand_value, Representation::Smi());
__ mov(operand, immediate);
} else {
- ASSERT(!IsInteger32(operand_value));
+ DCHECK(!IsInteger32(operand_value));
Handle<Object> handle_value = ToHandle(operand_value);
__ mov(operand, handle_value);
}
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
- ASSERT(instr->value()->IsRegister());
+ DCHECK(instr->value()->IsRegister());
Register value = ToRegister(instr->value());
- ASSERT(!instr->key()->IsConstantOperand());
+ DCHECK(!instr->key()->IsConstantOperand());
SmiCheck check_needed =
instr->hydrogen()->value()->type().IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
@@ -4191,10 +4191,10 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister()));
- ASSERT(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister()));
- ASSERT(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister()));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister()));
+ DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister()));
+ DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister()));
Handle<Code> ic = instr->strict_mode() == STRICT
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
@@ -4233,12 +4233,12 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
__ mov(FieldOperand(object_reg, HeapObject::kMapOffset),
Immediate(to_map));
// Write barrier.
- ASSERT_NE(instr->temp(), NULL);
+ DCHECK_NE(instr->temp(), NULL);
__ RecordWriteForMap(object_reg, to_map, new_map_reg,
ToRegister(instr->temp()));
} else {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(object_reg.is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(object_reg.is(eax));
PushSafepointRegistersScope scope(this);
__ mov(ebx, to_map);
bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE;
@@ -4328,10 +4328,10 @@ void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
DeferredStringCharFromCode* deferred =
new(zone()) DeferredStringCharFromCode(this, instr, x87_stack_);
- ASSERT(instr->hydrogen()->value()->representation().IsInteger32());
+ DCHECK(instr->hydrogen()->value()->representation().IsInteger32());
Register char_code = ToRegister(instr->char_code());
Register result = ToRegister(instr->result());
- ASSERT(!char_code.is(result));
+ DCHECK(!char_code.is(result));
__ cmp(char_code, String::kMaxOneByteCharCode);
__ j(above, deferred->entry());
@@ -4363,9 +4363,9 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
void LCodeGen::DoStringAdd(LStringAdd* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- ASSERT(ToRegister(instr->left()).is(edx));
- ASSERT(ToRegister(instr->right()).is(eax));
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->left()).is(edx));
+ DCHECK(ToRegister(instr->right()).is(eax));
StringAddStub stub(isolate(),
instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag());
@@ -4376,8 +4376,8 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
LOperand* input = instr->value();
LOperand* output = instr->result();
- ASSERT(input->IsRegister() || input->IsStackSlot());
- ASSERT(output->IsDoubleRegister());
+ DCHECK(input->IsRegister() || input->IsStackSlot());
+ DCHECK(output->IsDoubleRegister());
if (input->IsRegister()) {
Register input_reg = ToRegister(input);
__ push(input_reg);
@@ -4416,7 +4416,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
};
LOperand* input = instr->value();
- ASSERT(input->IsRegister() && input->Equals(instr->result()));
+ DCHECK(input->IsRegister() && input->Equals(instr->result()));
Register reg = ToRegister(input);
DeferredNumberTagI* deferred =
@@ -4444,7 +4444,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
};
LOperand* input = instr->value();
- ASSERT(input->IsRegister() && input->Equals(instr->result()));
+ DCHECK(input->IsRegister() && input->Equals(instr->result()));
Register reg = ToRegister(input);
DeferredNumberTagU* deferred =
@@ -4590,7 +4590,7 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
LOperand* input = instr->value();
Register result = ToRegister(input);
- ASSERT(input->IsRegister() && input->Equals(instr->result()));
+ DCHECK(input->IsRegister() && input->Equals(instr->result()));
if (instr->needs_check()) {
__ test(result, Immediate(kSmiTagMask));
DeoptimizeIf(not_zero, instr->environment());
@@ -4655,7 +4655,7 @@ void LCodeGen::EmitNumberUntagDNoSSE2(Register input_reg,
}
__ jmp(&done, Label::kNear);
} else {
- ASSERT(mode == NUMBER_CANDIDATE_IS_SMI);
+ DCHECK(mode == NUMBER_CANDIDATE_IS_SMI);
}
__ bind(&load_smi);
@@ -4734,9 +4734,9 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
};
LOperand* input = instr->value();
- ASSERT(input->IsRegister());
+ DCHECK(input->IsRegister());
Register input_reg = ToRegister(input);
- ASSERT(input_reg.is(ToRegister(instr->result())));
+ DCHECK(input_reg.is(ToRegister(instr->result())));
if (instr->hydrogen()->value()->representation().IsSmi()) {
__ SmiUntag(input_reg);
@@ -4757,11 +4757,11 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
LOperand* input = instr->value();
- ASSERT(input->IsRegister());
+ DCHECK(input->IsRegister());
LOperand* temp = instr->temp();
- ASSERT(temp->IsRegister());
+ DCHECK(temp->IsRegister());
LOperand* result = instr->result();
- ASSERT(result->IsDoubleRegister());
+ DCHECK(result->IsDoubleRegister());
Register input_reg = ToRegister(input);
bool deoptimize_on_minus_zero =
@@ -4784,9 +4784,9 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
LOperand* input = instr->value();
- ASSERT(input->IsDoubleRegister());
+ DCHECK(input->IsDoubleRegister());
LOperand* result = instr->result();
- ASSERT(result->IsRegister());
+ DCHECK(result->IsRegister());
Register result_reg = ToRegister(result);
if (instr->truncating()) {
@@ -4809,9 +4809,9 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
LOperand* input = instr->value();
- ASSERT(input->IsDoubleRegister());
+ DCHECK(input->IsDoubleRegister());
LOperand* result = instr->result();
- ASSERT(result->IsRegister());
+ DCHECK(result->IsRegister());
Register result_reg = ToRegister(result);
Label bailout, done;
@@ -4877,7 +4877,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag);
if (IsPowerOf2(mask)) {
- ASSERT(tag == 0 || IsPowerOf2(tag));
+ DCHECK(tag == 0 || IsPowerOf2(tag));
__ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask);
DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment());
} else {
@@ -4949,7 +4949,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
}
LOperand* input = instr->value();
- ASSERT(input->IsRegister());
+ DCHECK(input->IsRegister());
Register reg = ToRegister(input);
DeferredCheckMaps* deferred = NULL;
@@ -4984,7 +4984,7 @@ void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) {
- ASSERT(instr->unclamped()->Equals(instr->result()));
+ DCHECK(instr->unclamped()->Equals(instr->result()));
Register value_reg = ToRegister(instr->result());
__ ClampUint8(value_reg);
}
@@ -5149,11 +5149,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
}
if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
- ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
- ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
} else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
- ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE);
}
@@ -5201,7 +5201,7 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
PushSafepointRegistersScope scope(this);
if (instr->size()->IsRegister()) {
Register size = ToRegister(instr->size());
- ASSERT(!size.is(result));
+ DCHECK(!size.is(result));
__ SmiTag(ToRegister(instr->size()));
__ push(size);
} else {
@@ -5218,11 +5218,11 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
int flags = AllocateDoubleAlignFlag::encode(
instr->hydrogen()->MustAllocateDoubleAligned());
if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
- ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
- ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE);
} else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
- ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
+ DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE);
} else {
flags = AllocateTargetSpace::update(flags, NEW_SPACE);
@@ -5236,14 +5236,14 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
- ASSERT(ToRegister(instr->value()).is(eax));
+ DCHECK(ToRegister(instr->value()).is(eax));
__ push(eax);
CallRuntime(Runtime::kToFastProperties, 1, instr);
}
void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
Label materialized;
// Registers will be used as follows:
// ecx = literals array.
@@ -5295,7 +5295,7 @@ void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
// Use the fast case closure allocation code that allocates in new
// space for nested functions that don't need literals cloning.
bool pretenure = instr->hydrogen()->pretenure();
@@ -5316,7 +5316,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
void LCodeGen::DoTypeof(LTypeof* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
LOperand* input = instr->value();
EmitPushTaggedOperand(input);
CallRuntime(Runtime::kTypeof, 1, instr);
@@ -5450,7 +5450,7 @@ void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
last_lazy_deopt_pc_ = masm()->pc_offset();
- ASSERT(instr->HasEnvironment());
+ DCHECK(instr->HasEnvironment());
LEnvironment* env = instr->environment();
RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt);
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
@@ -5487,7 +5487,7 @@ void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
__ CallRuntime(Runtime::kStackGuard);
RecordSafepointWithLazyDeopt(
instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
- ASSERT(instr->HasEnvironment());
+ DCHECK(instr->HasEnvironment());
LEnvironment* env = instr->environment();
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
}
@@ -5508,7 +5508,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) {
LStackCheck* instr_;
};
- ASSERT(instr->HasEnvironment());
+ DCHECK(instr->HasEnvironment());
LEnvironment* env = instr->environment();
// There is no LLazyBailout instruction for stack-checks. We have to
// prepare for lazy deoptimization explicitly here.
@@ -5520,14 +5520,14 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) {
__ cmp(esp, Operand::StaticVariable(stack_limit));
__ j(above_equal, &done, Label::kNear);
- ASSERT(instr->context()->IsRegister());
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(instr->context()->IsRegister());
+ DCHECK(ToRegister(instr->context()).is(esi));
CallCode(isolate()->builtins()->StackCheck(),
RelocInfo::CODE_TARGET,
instr);
__ bind(&done);
} else {
- ASSERT(instr->hydrogen()->is_backwards_branch());
+ DCHECK(instr->hydrogen()->is_backwards_branch());
// Perform stack overflow check if this goto needs it before jumping.
DeferredStackCheck* deferred_stack_check =
new(zone()) DeferredStackCheck(this, instr, x87_stack_);
@@ -5554,7 +5554,7 @@ void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
// If the environment were already registered, we would have no way of
// backpatching it with the spill slot operands.
- ASSERT(!environment->HasBeenRegistered());
+ DCHECK(!environment->HasBeenRegistered());
RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
GenerateOsrPrologue();
@@ -5562,7 +5562,7 @@ void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->context()).is(esi));
__ cmp(eax, isolate()->factory()->undefined_value());
DeoptimizeIf(equal, instr->environment());
« no previous file with comments | « src/x87/lithium-codegen-x87.h ('k') | src/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698