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

Unified Diff: src/hydrogen.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/hydrogen.h ('k') | src/hydrogen-bce.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 622e37a1959eab9ee845d6a637046fdc1a19a48d..fb127ec4faee25ce8a4df62d7460f796e70fec0f 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -99,27 +99,27 @@ void HBasicBlock::MarkUnreachable() {
void HBasicBlock::AttachLoopInformation() {
- ASSERT(!IsLoopHeader());
+ DCHECK(!IsLoopHeader());
loop_information_ = new(zone()) HLoopInformation(this, zone());
}
void HBasicBlock::DetachLoopInformation() {
- ASSERT(IsLoopHeader());
+ DCHECK(IsLoopHeader());
loop_information_ = NULL;
}
void HBasicBlock::AddPhi(HPhi* phi) {
- ASSERT(!IsStartBlock());
+ DCHECK(!IsStartBlock());
phis_.Add(phi, zone());
phi->SetBlock(this);
}
void HBasicBlock::RemovePhi(HPhi* phi) {
- ASSERT(phi->block() == this);
- ASSERT(phis_.Contains(phi));
+ DCHECK(phi->block() == this);
+ DCHECK(phis_.Contains(phi));
phi->Kill();
phis_.RemoveElement(phi);
phi->SetBlock(NULL);
@@ -128,22 +128,22 @@ void HBasicBlock::RemovePhi(HPhi* phi) {
void HBasicBlock::AddInstruction(HInstruction* instr,
HSourcePosition position) {
- ASSERT(!IsStartBlock() || !IsFinished());
- ASSERT(!instr->IsLinked());
- ASSERT(!IsFinished());
+ DCHECK(!IsStartBlock() || !IsFinished());
+ DCHECK(!instr->IsLinked());
+ DCHECK(!IsFinished());
if (!position.IsUnknown()) {
instr->set_position(position);
}
if (first_ == NULL) {
- ASSERT(last_environment() != NULL);
- ASSERT(!last_environment()->ast_id().IsNone());
+ DCHECK(last_environment() != NULL);
+ DCHECK(!last_environment()->ast_id().IsNone());
HBlockEntry* entry = new(zone()) HBlockEntry();
entry->InitializeAsFirst(this);
if (!position.IsUnknown()) {
entry->set_position(position);
} else {
- ASSERT(!FLAG_hydrogen_track_positions ||
+ DCHECK(!FLAG_hydrogen_track_positions ||
!graph()->info()->IsOptimizing());
}
first_ = last_ = entry;
@@ -164,9 +164,9 @@ HPhi* HBasicBlock::AddNewPhi(int merged_index) {
HSimulate* HBasicBlock::CreateSimulate(BailoutId ast_id,
RemovableSimulate removable) {
- ASSERT(HasEnvironment());
+ DCHECK(HasEnvironment());
HEnvironment* environment = last_environment();
- ASSERT(ast_id.IsNone() ||
+ DCHECK(ast_id.IsNone() ||
ast_id == BailoutId::StubEntry() ||
environment->closure()->shared()->VerifyBailoutId(ast_id));
@@ -197,7 +197,7 @@ HSimulate* HBasicBlock::CreateSimulate(BailoutId ast_id,
void HBasicBlock::Finish(HControlInstruction* end, HSourcePosition position) {
- ASSERT(!IsFinished());
+ DCHECK(!IsFinished());
AddInstruction(end, position);
end_ = end;
for (HSuccessorIterator it(end); !it.Done(); it.Advance()) {
@@ -234,8 +234,8 @@ void HBasicBlock::AddLeaveInlined(HValue* return_value,
HBasicBlock* target = state->function_return();
bool drop_extra = state->inlining_kind() == NORMAL_RETURN;
- ASSERT(target->IsInlineReturnTarget());
- ASSERT(return_value != NULL);
+ DCHECK(target->IsInlineReturnTarget());
+ DCHECK(return_value != NULL);
HEnvironment* env = last_environment();
int argument_count = env->arguments_environment()->parameter_count();
AddInstruction(new(zone()) HLeaveInlined(state->entry(), argument_count),
@@ -249,8 +249,8 @@ void HBasicBlock::AddLeaveInlined(HValue* return_value,
void HBasicBlock::SetInitialEnvironment(HEnvironment* env) {
- ASSERT(!HasEnvironment());
- ASSERT(first() == NULL);
+ DCHECK(!HasEnvironment());
+ DCHECK(first() == NULL);
UpdateEnvironment(env);
}
@@ -263,12 +263,12 @@ void HBasicBlock::UpdateEnvironment(HEnvironment* env) {
void HBasicBlock::SetJoinId(BailoutId ast_id) {
int length = predecessors_.length();
- ASSERT(length > 0);
+ DCHECK(length > 0);
for (int i = 0; i < length; i++) {
HBasicBlock* predecessor = predecessors_[i];
- ASSERT(predecessor->end()->IsGoto());
+ DCHECK(predecessor->end()->IsGoto());
HSimulate* simulate = HSimulate::cast(predecessor->end()->previous());
- ASSERT(i != 0 ||
+ DCHECK(i != 0 ||
(predecessor->last_environment()->closure().is_null() ||
predecessor->last_environment()->closure()->shared()
->VerifyBailoutId(ast_id)));
@@ -306,7 +306,7 @@ int HBasicBlock::LoopNestingDepth() const {
void HBasicBlock::PostProcessLoopHeader(IterationStatement* stmt) {
- ASSERT(IsLoopHeader());
+ DCHECK(IsLoopHeader());
SetJoinId(stmt->EntryId());
if (predecessors()->length() == 1) {
@@ -324,10 +324,10 @@ void HBasicBlock::PostProcessLoopHeader(IterationStatement* stmt) {
void HBasicBlock::MarkSuccEdgeUnreachable(int succ) {
- ASSERT(IsFinished());
+ DCHECK(IsFinished());
HBasicBlock* succ_block = end()->SuccessorAt(succ);
- ASSERT(succ_block->predecessors()->length() == 1);
+ DCHECK(succ_block->predecessors()->length() == 1);
succ_block->MarkUnreachable();
}
@@ -337,10 +337,10 @@ void HBasicBlock::RegisterPredecessor(HBasicBlock* pred) {
// Only loop header blocks can have a predecessor added after
// instructions have been added to the block (they have phis for all
// values in the environment, these phis may be eliminated later).
- ASSERT(IsLoopHeader() || first_ == NULL);
+ DCHECK(IsLoopHeader() || first_ == NULL);
HEnvironment* incoming_env = pred->last_environment();
if (IsLoopHeader()) {
- ASSERT(phis()->length() == incoming_env->length());
+ DCHECK(phis()->length() == incoming_env->length());
for (int i = 0; i < phis_.length(); ++i) {
phis_[i]->AddInput(incoming_env->values()->at(i));
}
@@ -348,7 +348,7 @@ void HBasicBlock::RegisterPredecessor(HBasicBlock* pred) {
last_environment()->AddIncomingEdge(this, pred->last_environment());
}
} else if (!HasEnvironment() && !IsFinished()) {
- ASSERT(!IsLoopHeader());
+ DCHECK(!IsLoopHeader());
SetInitialEnvironment(pred->last_environment()->Copy());
}
@@ -357,7 +357,7 @@ void HBasicBlock::RegisterPredecessor(HBasicBlock* pred) {
void HBasicBlock::AddDominatedBlock(HBasicBlock* block) {
- ASSERT(!dominated_blocks_.Contains(block));
+ DCHECK(!dominated_blocks_.Contains(block));
// Keep the list of dominated blocks sorted such that if there is two
// succeeding block in this list, the predecessor is before the successor.
int index = 0;
@@ -383,11 +383,11 @@ void HBasicBlock::AssignCommonDominator(HBasicBlock* other) {
} else {
second = second->dominator();
}
- ASSERT(first != NULL && second != NULL);
+ DCHECK(first != NULL && second != NULL);
}
if (dominator_ != first) {
- ASSERT(dominator_->dominated_blocks_.Contains(this));
+ DCHECK(dominator_->dominated_blocks_.Contains(this));
dominator_->dominated_blocks_.RemoveElement(this);
dominator_ = first;
first->AddDominatedBlock(this);
@@ -429,7 +429,7 @@ void HBasicBlock::AssignLoopSuccessorDominators() {
// dominator information about the current loop that's being processed,
// and not nested loops, which will be processed when
// AssignLoopSuccessorDominators gets called on their header.
- ASSERT(outstanding_successors >= 0);
+ DCHECK(outstanding_successors >= 0);
HBasicBlock* parent_loop_header = dominator_candidate->parent_loop_header();
if (outstanding_successors == 0 &&
(parent_loop_header == this && !dominator_candidate->IsLoopHeader())) {
@@ -443,7 +443,7 @@ void HBasicBlock::AssignLoopSuccessorDominators() {
if (successor->block_id() > dominator_candidate->block_id() &&
successor->block_id() <= last->block_id()) {
// Backwards edges must land on loop headers.
- ASSERT(successor->block_id() > dominator_candidate->block_id() ||
+ DCHECK(successor->block_id() > dominator_candidate->block_id() ||
successor->IsLoopHeader());
outstanding_successors++;
}
@@ -464,13 +464,13 @@ int HBasicBlock::PredecessorIndexOf(HBasicBlock* predecessor) const {
#ifdef DEBUG
void HBasicBlock::Verify() {
// Check that every block is finished.
- ASSERT(IsFinished());
- ASSERT(block_id() >= 0);
+ DCHECK(IsFinished());
+ DCHECK(block_id() >= 0);
// Check that the incoming edges are in edge split form.
if (predecessors_.length() > 1) {
for (int i = 0; i < predecessors_.length(); ++i) {
- ASSERT(predecessors_[i]->end()->SecondSuccessor() == NULL);
+ DCHECK(predecessors_[i]->end()->SecondSuccessor() == NULL);
}
}
}
@@ -573,10 +573,10 @@ void HGraph::Verify(bool do_full_verify) const {
// Check that every block contains at least one node and that only the last
// node is a control instruction.
HInstruction* current = block->first();
- ASSERT(current != NULL && current->IsBlockEntry());
+ DCHECK(current != NULL && current->IsBlockEntry());
while (current != NULL) {
- ASSERT((current->next() == NULL) == current->IsControlInstruction());
- ASSERT(current->block() == block);
+ DCHECK((current->next() == NULL) == current->IsControlInstruction());
+ DCHECK(current->block() == block);
current->Verify();
current = current->next();
}
@@ -584,13 +584,13 @@ void HGraph::Verify(bool do_full_verify) const {
// Check that successors are correctly set.
HBasicBlock* first = block->end()->FirstSuccessor();
HBasicBlock* second = block->end()->SecondSuccessor();
- ASSERT(second == NULL || first != NULL);
+ DCHECK(second == NULL || first != NULL);
// Check that the predecessor array is correct.
if (first != NULL) {
- ASSERT(first->predecessors()->Contains(block));
+ DCHECK(first->predecessors()->Contains(block));
if (second != NULL) {
- ASSERT(second->predecessors()->Contains(block));
+ DCHECK(second->predecessors()->Contains(block));
}
}
@@ -607,36 +607,36 @@ void HGraph::Verify(bool do_full_verify) const {
block->predecessors()->first()->last_environment()->ast_id();
for (int k = 0; k < block->predecessors()->length(); k++) {
HBasicBlock* predecessor = block->predecessors()->at(k);
- ASSERT(predecessor->end()->IsGoto() ||
+ DCHECK(predecessor->end()->IsGoto() ||
predecessor->end()->IsDeoptimize());
- ASSERT(predecessor->last_environment()->ast_id() == id);
+ DCHECK(predecessor->last_environment()->ast_id() == id);
}
}
}
// Check special property of first block to have no predecessors.
- ASSERT(blocks_.at(0)->predecessors()->is_empty());
+ DCHECK(blocks_.at(0)->predecessors()->is_empty());
if (do_full_verify) {
// Check that the graph is fully connected.
ReachabilityAnalyzer analyzer(entry_block_, blocks_.length(), NULL);
- ASSERT(analyzer.visited_count() == blocks_.length());
+ DCHECK(analyzer.visited_count() == blocks_.length());
// Check that entry block dominator is NULL.
- ASSERT(entry_block_->dominator() == NULL);
+ DCHECK(entry_block_->dominator() == NULL);
// Check dominators.
for (int i = 0; i < blocks_.length(); ++i) {
HBasicBlock* block = blocks_.at(i);
if (block->dominator() == NULL) {
// Only start block may have no dominator assigned to.
- ASSERT(i == 0);
+ DCHECK(i == 0);
} else {
// Assert that block is unreachable if dominator must not be visited.
ReachabilityAnalyzer dominator_analyzer(entry_block_,
blocks_.length(),
block->dominator());
- ASSERT(!dominator_analyzer.reachable()->Contains(block->block_id()));
+ DCHECK(!dominator_analyzer.reachable()->Contains(block->block_id()));
}
}
}
@@ -792,7 +792,7 @@ void HGraphBuilder::IfBuilder::Initialize(HGraphBuilder* builder) {
HControlInstruction* HGraphBuilder::IfBuilder::AddCompare(
HControlInstruction* compare) {
- ASSERT(did_then_ == did_else_);
+ DCHECK(did_then_ == did_else_);
if (did_else_) {
// Handle if-then-elseif
did_else_if_ = true;
@@ -828,8 +828,8 @@ HControlInstruction* HGraphBuilder::IfBuilder::AddCompare(
void HGraphBuilder::IfBuilder::Or() {
- ASSERT(!needs_compare_);
- ASSERT(!did_and_);
+ DCHECK(!needs_compare_);
+ DCHECK(!did_and_);
did_or_ = true;
HEnvironment* env = first_false_block_->last_environment();
if (split_edge_merge_block_ == NULL) {
@@ -843,8 +843,8 @@ void HGraphBuilder::IfBuilder::Or() {
void HGraphBuilder::IfBuilder::And() {
- ASSERT(!needs_compare_);
- ASSERT(!did_or_);
+ DCHECK(!needs_compare_);
+ DCHECK(!did_or_);
did_and_ = true;
HEnvironment* env = first_false_block_->last_environment();
if (split_edge_merge_block_ == NULL) {
@@ -859,15 +859,15 @@ void HGraphBuilder::IfBuilder::And() {
void HGraphBuilder::IfBuilder::CaptureContinuation(
HIfContinuation* continuation) {
- ASSERT(!did_else_if_);
- ASSERT(!finished_);
- ASSERT(!captured_);
+ DCHECK(!did_else_if_);
+ DCHECK(!finished_);
+ DCHECK(!captured_);
HBasicBlock* true_block = NULL;
HBasicBlock* false_block = NULL;
Finish(&true_block, &false_block);
- ASSERT(true_block != NULL);
- ASSERT(false_block != NULL);
+ DCHECK(true_block != NULL);
+ DCHECK(false_block != NULL);
continuation->Capture(true_block, false_block);
captured_ = true;
builder()->set_current_block(NULL);
@@ -876,19 +876,19 @@ void HGraphBuilder::IfBuilder::CaptureContinuation(
void HGraphBuilder::IfBuilder::JoinContinuation(HIfContinuation* continuation) {
- ASSERT(!did_else_if_);
- ASSERT(!finished_);
- ASSERT(!captured_);
+ DCHECK(!did_else_if_);
+ DCHECK(!finished_);
+ DCHECK(!captured_);
HBasicBlock* true_block = NULL;
HBasicBlock* false_block = NULL;
Finish(&true_block, &false_block);
merge_at_join_blocks_ = NULL;
if (true_block != NULL && !true_block->IsFinished()) {
- ASSERT(continuation->IsTrueReachable());
+ DCHECK(continuation->IsTrueReachable());
builder()->GotoNoSimulate(true_block, continuation->true_branch());
}
if (false_block != NULL && !false_block->IsFinished()) {
- ASSERT(continuation->IsFalseReachable());
+ DCHECK(continuation->IsFalseReachable());
builder()->GotoNoSimulate(false_block, continuation->false_branch());
}
captured_ = true;
@@ -897,8 +897,8 @@ void HGraphBuilder::IfBuilder::JoinContinuation(HIfContinuation* continuation) {
void HGraphBuilder::IfBuilder::Then() {
- ASSERT(!captured_);
- ASSERT(!finished_);
+ DCHECK(!captured_);
+ DCHECK(!finished_);
did_then_ = true;
if (needs_compare_) {
// Handle if's without any expressions, they jump directly to the "else"
@@ -918,9 +918,9 @@ void HGraphBuilder::IfBuilder::Then() {
void HGraphBuilder::IfBuilder::Else() {
- ASSERT(did_then_);
- ASSERT(!captured_);
- ASSERT(!finished_);
+ DCHECK(did_then_);
+ DCHECK(!captured_);
+ DCHECK(!finished_);
AddMergeAtJoinBlock(false);
builder()->set_current_block(first_false_block_);
pending_merge_block_ = true;
@@ -929,7 +929,7 @@ void HGraphBuilder::IfBuilder::Else() {
void HGraphBuilder::IfBuilder::Deopt(const char* reason) {
- ASSERT(did_then_);
+ DCHECK(did_then_);
builder()->Add<HDeoptimize>(reason, Deoptimizer::EAGER);
AddMergeAtJoinBlock(true);
}
@@ -946,12 +946,12 @@ void HGraphBuilder::IfBuilder::Return(HValue* value) {
void HGraphBuilder::IfBuilder::AddMergeAtJoinBlock(bool deopt) {
if (!pending_merge_block_) return;
HBasicBlock* block = builder()->current_block();
- ASSERT(block == NULL || !block->IsFinished());
+ DCHECK(block == NULL || !block->IsFinished());
MergeAtJoinBlock* record = new (builder()->zone())
MergeAtJoinBlock(block, deopt, merge_at_join_blocks_);
merge_at_join_blocks_ = record;
if (block != NULL) {
- ASSERT(block->end() == NULL);
+ DCHECK(block->end() == NULL);
if (deopt) {
normal_merge_at_join_block_count_++;
} else {
@@ -964,7 +964,7 @@ void HGraphBuilder::IfBuilder::AddMergeAtJoinBlock(bool deopt) {
void HGraphBuilder::IfBuilder::Finish() {
- ASSERT(!finished_);
+ DCHECK(!finished_);
if (!did_then_) {
Then();
}
@@ -989,7 +989,7 @@ void HGraphBuilder::IfBuilder::Finish(HBasicBlock** then_continuation,
if (then_continuation != NULL) {
*then_continuation = then_record->block_;
}
- ASSERT(then_record->next_ == NULL);
+ DCHECK(then_record->next_ == NULL);
}
@@ -999,7 +999,7 @@ void HGraphBuilder::IfBuilder::End() {
int total_merged_blocks = normal_merge_at_join_block_count_ +
deopt_merge_at_join_block_count_;
- ASSERT(total_merged_blocks >= 1);
+ DCHECK(total_merged_blocks >= 1);
HBasicBlock* merge_block =
total_merged_blocks == 1 ? NULL : builder()->graph()->CreateBasicBlock();
@@ -1073,7 +1073,7 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
HValue* initial,
HValue* terminating,
Token::Value token) {
- ASSERT(direction_ != kWhileTrue);
+ DCHECK(direction_ != kWhileTrue);
HEnvironment* env = builder_->environment();
phi_ = header_block_->AddNewPhi(env->values()->length());
phi_->AddInput(initial);
@@ -1111,7 +1111,7 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
void HGraphBuilder::LoopBuilder::BeginBody(int drop_count) {
- ASSERT(direction_ == kWhileTrue);
+ DCHECK(direction_ == kWhileTrue);
HEnvironment* env = builder_->environment();
builder_->GotoNoSimulate(header_block_);
builder_->set_current_block(header_block_);
@@ -1138,7 +1138,7 @@ void HGraphBuilder::LoopBuilder::Break() {
void HGraphBuilder::LoopBuilder::EndBody() {
- ASSERT(!finished_);
+ DCHECK(!finished_);
if (direction_ == kPostIncrement || direction_ == kPostDecrement) {
if (direction_ == kPostIncrement) {
@@ -1180,8 +1180,8 @@ HGraph* HGraphBuilder::CreateGraph() {
HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) {
- ASSERT(current_block() != NULL);
- ASSERT(!FLAG_hydrogen_track_positions ||
+ DCHECK(current_block() != NULL);
+ DCHECK(!FLAG_hydrogen_track_positions ||
!position_.IsUnknown() ||
!info_->IsOptimizing());
current_block()->AddInstruction(instr, source_position());
@@ -1193,7 +1193,7 @@ HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) {
void HGraphBuilder::FinishCurrentBlock(HControlInstruction* last) {
- ASSERT(!FLAG_hydrogen_track_positions ||
+ DCHECK(!FLAG_hydrogen_track_positions ||
!info_->IsOptimizing() ||
!position_.IsUnknown());
current_block()->Finish(last, source_position());
@@ -1204,7 +1204,7 @@ void HGraphBuilder::FinishCurrentBlock(HControlInstruction* last) {
void HGraphBuilder::FinishExitCurrentBlock(HControlInstruction* instruction) {
- ASSERT(!FLAG_hydrogen_track_positions || !info_->IsOptimizing() ||
+ DCHECK(!FLAG_hydrogen_track_positions || !info_->IsOptimizing() ||
!position_.IsUnknown());
current_block()->FinishExit(instruction, source_position());
if (instruction->IsReturn() || instruction->IsAbnormalExit()) {
@@ -1228,8 +1228,8 @@ void HGraphBuilder::AddIncrementCounter(StatsCounter* counter) {
void HGraphBuilder::AddSimulate(BailoutId id,
RemovableSimulate removable) {
- ASSERT(current_block() != NULL);
- ASSERT(!graph()->IsInsideNoSideEffectsScope());
+ DCHECK(current_block() != NULL);
+ DCHECK(!graph()->IsInsideNoSideEffectsScope());
current_block()->AddNewSimulate(id, source_position(), removable);
}
@@ -1274,7 +1274,7 @@ void HGraphBuilder::FinishExitWithHardDeoptimization(const char* reason) {
HValue* HGraphBuilder::BuildCheckString(HValue* string) {
if (!string->type().IsString()) {
- ASSERT(!string->IsConstant() ||
+ DCHECK(!string->IsConstant() ||
!HConstant::cast(string)->HasStringValue());
BuildCheckHeapObject(string);
return Add<HCheckInstanceType>(string, HCheckInstanceType::IS_STRING);
@@ -1393,7 +1393,7 @@ void HGraphBuilder::BuildTransitionElementsKind(HValue* object,
ElementsKind from_kind,
ElementsKind to_kind,
bool is_jsarray) {
- ASSERT(!IsFastHoleyElementsKind(from_kind) ||
+ DCHECK(!IsFastHoleyElementsKind(from_kind) ||
IsFastHoleyElementsKind(to_kind));
if (AllocationSite::GetMode(from_kind, to_kind) == TRACK_ALLOCATION_SITE) {
@@ -2066,7 +2066,7 @@ HValue* HGraphBuilder::BuildCreateConsString(
// pass CONS_STRING_TYPE or CONS_ASCII_STRING_TYPE here, so we just use
// CONS_STRING_TYPE here. Below we decide whether the cons string is
// one-byte or two-byte and set the appropriate map.
- ASSERT(HAllocate::CompatibleInstanceTypes(CONS_STRING_TYPE,
+ DCHECK(HAllocate::CompatibleInstanceTypes(CONS_STRING_TYPE,
CONS_ASCII_STRING_TYPE));
HAllocate* result = BuildAllocate(Add<HConstant>(ConsString::kSize),
HType::String(), CONS_STRING_TYPE,
@@ -2144,7 +2144,7 @@ void HGraphBuilder::BuildCopySeqStringChars(HValue* src,
HValue* dst_offset,
String::Encoding dst_encoding,
HValue* length) {
- ASSERT(dst_encoding != String::ONE_BYTE_ENCODING ||
+ DCHECK(dst_encoding != String::ONE_BYTE_ENCODING ||
src_encoding == String::ONE_BYTE_ENCODING);
LoopBuilder loop(this, context(), LoopBuilder::kPostIncrement);
HValue* index = loop.BeginBody(graph()->GetConstant0(), length, Token::LT);
@@ -2161,7 +2161,7 @@ void HGraphBuilder::BuildCopySeqStringChars(HValue* src,
HValue* HGraphBuilder::BuildObjectSizeAlignment(
HValue* unaligned_size, int header_size) {
- ASSERT((header_size & kObjectAlignmentMask) == 0);
+ DCHECK((header_size & kObjectAlignmentMask) == 0);
HValue* size = AddUncasted<HAdd>(
unaligned_size, Add<HConstant>(static_cast<int32_t>(
header_size + kObjectAlignmentMask)));
@@ -2186,14 +2186,14 @@ HValue* HGraphBuilder::BuildUncheckedStringAdd(
// Do some manual constant folding here.
if (left_length->IsConstant()) {
HConstant* c_left_length = HConstant::cast(left_length);
- ASSERT_NE(0, c_left_length->Integer32Value());
+ DCHECK_NE(0, c_left_length->Integer32Value());
if (c_left_length->Integer32Value() + 1 >= ConsString::kMinLength) {
// The right string contains at least one character.
return BuildCreateConsString(length, left, right, allocation_mode);
}
} else if (right_length->IsConstant()) {
HConstant* c_right_length = HConstant::cast(right_length);
- ASSERT_NE(0, c_right_length->Integer32Value());
+ DCHECK_NE(0, c_right_length->Integer32Value());
if (c_right_length->Integer32Value() + 1 >= ConsString::kMinLength) {
// The left string contains at least one character.
return BuildCreateConsString(length, left, right, allocation_mode);
@@ -2399,7 +2399,7 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
PropertyAccessType access_type,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode) {
- ASSERT((!IsExternalArrayElementsKind(elements_kind) &&
+ DCHECK((!IsExternalArrayElementsKind(elements_kind) &&
!IsFixedTypedArrayElementsKind(elements_kind)) ||
!is_js_array);
// No GVNFlag is necessary for ElementsKind if there is an explicit dependency
@@ -2458,14 +2458,14 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
length_checker.End();
return result;
} else {
- ASSERT(store_mode == STANDARD_STORE);
+ DCHECK(store_mode == STANDARD_STORE);
checked_key = Add<HBoundsCheck>(key, length);
return AddElementAccess(
backing_store, checked_key, val,
checked_object, elements_kind, access_type);
}
}
- ASSERT(fast_smi_only_elements ||
+ DCHECK(fast_smi_only_elements ||
fast_elements ||
IsFastDoubleElementsKind(elements_kind));
@@ -2672,7 +2672,7 @@ HInstruction* HGraphBuilder::AddElementAccess(
PropertyAccessType access_type,
LoadKeyedHoleMode load_mode) {
if (access_type == STORE) {
- ASSERT(val != NULL);
+ DCHECK(val != NULL);
if (elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS ||
elements_kind == UINT8_CLAMPED_ELEMENTS) {
val = Add<HClampToUint8>(val);
@@ -2681,8 +2681,8 @@ HInstruction* HGraphBuilder::AddElementAccess(
STORE_TO_INITIALIZED_ENTRY);
}
- ASSERT(access_type == LOAD);
- ASSERT(val == NULL);
+ DCHECK(access_type == LOAD);
+ DCHECK(val == NULL);
HLoadKeyed* load = Add<HLoadKeyed>(
elements, checked_key, dependency, elements_kind, load_mode);
if (FLAG_opt_safe_uint32_operations &&
@@ -3071,7 +3071,7 @@ void HGraphBuilder::BuildCreateAllocationMemento(
HValue* previous_object,
HValue* previous_object_size,
HValue* allocation_site) {
- ASSERT(allocation_site != NULL);
+ DCHECK(allocation_site != NULL);
HInnerAllocatedObject* allocation_memento = Add<HInnerAllocatedObject>(
previous_object, previous_object_size, HType::HeapObject());
AddStoreMapConstant(
@@ -3142,7 +3142,7 @@ HGraphBuilder::JSArrayBuilder::JSArrayBuilder(HGraphBuilder* builder,
kind_(kind),
allocation_site_payload_(allocation_site_payload),
constructor_function_(constructor_function) {
- ASSERT(!allocation_site_payload->IsConstant() ||
+ DCHECK(!allocation_site_payload->IsConstant() ||
HConstant::cast(allocation_site_payload)->handle(
builder_->isolate())->IsAllocationSite());
mode_ = override_mode == DISABLE_ALLOCATION_SITES
@@ -3454,7 +3454,7 @@ HBasicBlock* HGraph::CreateBasicBlock() {
void HGraph::FinalizeUniqueness() {
DisallowHeapAllocation no_gc;
- ASSERT(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
+ DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
for (int i = 0; i < blocks()->length(); ++i) {
for (HInstructionIterator it(blocks()->at(i)); !it.Done(); it.Advance()) {
it.Current()->FinalizeUniqueness();
@@ -3641,7 +3641,7 @@ class PostorderProcessor : public ZoneObject {
return result->SetupLoopMembers(zone, block, block->loop_information(),
loop_header);
} else {
- ASSERT(block->IsFinished());
+ DCHECK(block->IsFinished());
kind_ = SUCCESSORS;
loop_header_ = loop_header;
InitializeSuccessors();
@@ -3683,10 +3683,10 @@ class PostorderProcessor : public ZoneObject {
}
void ClosePostorder(ZoneList<HBasicBlock*>* order, Zone* zone) {
- ASSERT(block_->end()->FirstSuccessor() == NULL ||
+ DCHECK(block_->end()->FirstSuccessor() == NULL ||
order->Contains(block_->end()->FirstSuccessor()) ||
block_->end()->FirstSuccessor()->IsLoopHeader());
- ASSERT(block_->end()->SecondSuccessor() == NULL ||
+ DCHECK(block_->end()->SecondSuccessor() == NULL ||
order->Contains(block_->end()->SecondSuccessor()) ||
block_->end()->SecondSuccessor()->IsLoopHeader());
order->Add(block_, zone);
@@ -3824,7 +3824,7 @@ void HGraph::OrderBlocks() {
#ifdef DEBUG
// Initially the blocks must not be ordered.
for (int i = 0; i < blocks_.length(); ++i) {
- ASSERT(!blocks_[i]->IsOrdered());
+ DCHECK(!blocks_[i]->IsOrdered());
}
#endif
@@ -3838,7 +3838,7 @@ void HGraph::OrderBlocks() {
#ifdef DEBUG
// Now all blocks must be marked as ordered.
for (int i = 0; i < blocks_.length(); ++i) {
- ASSERT(blocks_[i]->IsOrdered());
+ DCHECK(blocks_[i]->IsOrdered());
}
#endif
@@ -3985,7 +3985,7 @@ AstContext::AstContext(HOptimizedGraphBuilder* owner, Expression::Context kind)
for_typeof_(false) {
owner->set_ast_context(this); // Push.
#ifdef DEBUG
- ASSERT(owner->environment()->frame_type() == JS_FUNCTION);
+ DCHECK(owner->environment()->frame_type() == JS_FUNCTION);
original_length_ = owner->environment()->length();
#endif
}
@@ -3997,7 +3997,7 @@ AstContext::~AstContext() {
EffectContext::~EffectContext() {
- ASSERT(owner()->HasStackOverflow() ||
+ DCHECK(owner()->HasStackOverflow() ||
owner()->current_block() == NULL ||
(owner()->environment()->length() == original_length_ &&
owner()->environment()->frame_type() == JS_FUNCTION));
@@ -4005,7 +4005,7 @@ EffectContext::~EffectContext() {
ValueContext::~ValueContext() {
- ASSERT(owner()->HasStackOverflow() ||
+ DCHECK(owner()->HasStackOverflow() ||
owner()->current_block() == NULL ||
(owner()->environment()->length() == original_length_ + 1 &&
owner()->environment()->frame_type() == JS_FUNCTION));
@@ -4033,7 +4033,7 @@ void TestContext::ReturnValue(HValue* value) {
void EffectContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->IsControlInstruction());
+ DCHECK(!instr->IsControlInstruction());
owner()->AddInstruction(instr);
if (instr->HasObservableSideEffects()) {
owner()->Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
@@ -4043,7 +4043,7 @@ void EffectContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void EffectContext::ReturnControl(HControlInstruction* instr,
BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ DCHECK(!instr->HasObservableSideEffects());
HBasicBlock* empty_true = owner()->graph()->CreateBasicBlock();
HBasicBlock* empty_false = owner()->graph()->CreateBasicBlock();
instr->SetSuccessorAt(0, empty_true);
@@ -4071,7 +4071,7 @@ void EffectContext::ReturnContinuation(HIfContinuation* continuation,
void ValueContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->IsControlInstruction());
+ DCHECK(!instr->IsControlInstruction());
if (!arguments_allowed() && instr->CheckFlag(HValue::kIsArguments)) {
return owner()->Bailout(kBadValueContextForArgumentsObjectValue);
}
@@ -4084,7 +4084,7 @@ void ValueContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void ValueContext::ReturnControl(HControlInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ DCHECK(!instr->HasObservableSideEffects());
if (!arguments_allowed() && instr->CheckFlag(HValue::kIsArguments)) {
return owner()->Bailout(kBadValueContextForArgumentsObjectValue);
}
@@ -4127,7 +4127,7 @@ void ValueContext::ReturnContinuation(HIfContinuation* continuation,
void TestContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->IsControlInstruction());
+ DCHECK(!instr->IsControlInstruction());
HOptimizedGraphBuilder* builder = owner();
builder->AddInstruction(instr);
// We expect a simulate after every expression with side effects, though
@@ -4142,7 +4142,7 @@ void TestContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void TestContext::ReturnControl(HControlInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ DCHECK(!instr->HasObservableSideEffects());
HBasicBlock* empty_true = owner()->graph()->CreateBasicBlock();
HBasicBlock* empty_false = owner()->graph()->CreateBasicBlock();
instr->SetSuccessorAt(0, empty_true);
@@ -4307,7 +4307,7 @@ bool HOptimizedGraphBuilder::BuildGraph() {
// due to missing/inadequate type feedback, but rather too aggressive
// optimization. Disable optimistic LICM in that case.
Handle<Code> unoptimized_code(current_info()->shared_info()->code());
- ASSERT(unoptimized_code->kind() == Code::FUNCTION);
+ DCHECK(unoptimized_code->kind() == Code::FUNCTION);
Handle<TypeFeedbackInfo> type_info(
TypeFeedbackInfo::cast(unoptimized_code->type_feedback_info()));
int checksum = type_info->own_type_change_checksum();
@@ -4421,7 +4421,7 @@ void HGraph::RestoreActualValues() {
#ifdef DEBUG
for (int i = 0; i < block->phis()->length(); i++) {
HPhi* phi = block->phis()->at(i);
- ASSERT(phi->ActualValue() == phi);
+ DCHECK(phi->ActualValue() == phi);
}
#endif
@@ -4434,7 +4434,7 @@ void HGraph::RestoreActualValues() {
// instructions.
instruction->DeleteAndReplaceWith(instruction->ActualValue());
} else {
- ASSERT(instruction->IsInformativeDefinition());
+ DCHECK(instruction->IsInformativeDefinition());
if (instruction->IsPurelyInformativeDefinition()) {
instruction->DeleteAndReplaceWith(instruction->RedefinedOperand());
} else {
@@ -4474,7 +4474,7 @@ void HOptimizedGraphBuilder::SetUpScope(Scope* scope) {
// Create an arguments object containing the initial parameters. Set the
// initial values of parameters including "this" having parameter index 0.
- ASSERT_EQ(scope->num_parameters() + 1, environment()->parameter_count());
+ DCHECK_EQ(scope->num_parameters() + 1, environment()->parameter_count());
HArgumentsObject* arguments_object =
New<HArgumentsObject>(environment()->parameter_count());
for (int i = 0; i < environment()->parameter_count(); ++i) {
@@ -4516,9 +4516,9 @@ void HOptimizedGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) {
void HOptimizedGraphBuilder::VisitBlock(Block* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Scope* outer_scope = scope();
Scope* scope = stmt->scope();
@@ -4576,24 +4576,24 @@ void HOptimizedGraphBuilder::VisitBlock(Block* stmt) {
void HOptimizedGraphBuilder::VisitExpressionStatement(
ExpressionStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
VisitForEffect(stmt->expression());
}
void HOptimizedGraphBuilder::VisitEmptyStatement(EmptyStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
}
void HOptimizedGraphBuilder::VisitIfStatement(IfStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (stmt->condition()->ToBooleanIsTrue()) {
Add<HSimulate>(stmt->ThenId());
Visit(stmt->then_statement());
@@ -4640,7 +4640,7 @@ HBasicBlock* HOptimizedGraphBuilder::BreakAndContinueScope::Get(
*drop_extra += current->info()->drop_extra();
current = current->next();
}
- ASSERT(current != NULL); // Always found (unless stack is malformed).
+ DCHECK(current != NULL); // Always found (unless stack is malformed).
*scope = current->info()->scope();
if (type == BREAK) {
@@ -4672,9 +4672,9 @@ HBasicBlock* HOptimizedGraphBuilder::BreakAndContinueScope::Get(
void HOptimizedGraphBuilder::VisitContinueStatement(
ContinueStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Scope* outer_scope = NULL;
Scope* inner_scope = scope();
int drop_extra = 0;
@@ -4704,9 +4704,9 @@ void HOptimizedGraphBuilder::VisitContinueStatement(
void HOptimizedGraphBuilder::VisitBreakStatement(BreakStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Scope* outer_scope = NULL;
Scope* inner_scope = scope();
int drop_extra = 0;
@@ -4735,9 +4735,9 @@ void HOptimizedGraphBuilder::VisitBreakStatement(BreakStatement* stmt) {
void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
FunctionState* state = function_state();
AstContext* context = call_context();
if (context == NULL) {
@@ -4757,7 +4757,7 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
CHECK_ALIVE(VisitForEffect(stmt->expression()));
Goto(function_return(), state);
} else {
- ASSERT(context->IsValue());
+ DCHECK(context->IsValue());
CHECK_ALIVE(VisitForValue(stmt->expression()));
HValue* return_value = Pop();
HValue* receiver = environment()->arguments_environment()->Lookup(0);
@@ -4783,7 +4783,7 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
} else if (context->IsEffect()) {
Goto(function_return(), state);
} else {
- ASSERT(context->IsValue());
+ DCHECK(context->IsValue());
HValue* rhs = environment()->arguments_environment()->Lookup(1);
AddLeaveInlined(rhs, state);
}
@@ -4802,7 +4802,7 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
Pop();
Goto(function_return(), state);
} else {
- ASSERT(context->IsValue());
+ DCHECK(context->IsValue());
CHECK_ALIVE(VisitForValue(stmt->expression()));
AddLeaveInlined(Pop(), state);
}
@@ -4812,17 +4812,17 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
void HOptimizedGraphBuilder::VisitWithStatement(WithStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kWithStatement);
}
void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
// We only optimize switch statements with a bounded number of clauses.
const int kCaseClauseLimit = 128;
@@ -4934,17 +4934,17 @@ void HOptimizedGraphBuilder::VisitLoopBody(IterationStatement* stmt,
Add<HSimulate>(stmt->StackCheckId());
HStackCheck* stack_check =
HStackCheck::cast(Add<HStackCheck>(HStackCheck::kBackwardsBranch));
- ASSERT(loop_entry->IsLoopHeader());
+ DCHECK(loop_entry->IsLoopHeader());
loop_entry->loop_information()->set_stack_check(stack_check);
CHECK_BAILOUT(Visit(stmt->body()));
}
void HOptimizedGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
- ASSERT(current_block() != NULL);
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
+ DCHECK(current_block() != NULL);
HBasicBlock* loop_entry = BuildLoopEntry(stmt);
BreakAndContinueInfo break_info(stmt, scope());
@@ -4989,10 +4989,10 @@ void HOptimizedGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) {
void HOptimizedGraphBuilder::VisitWhileStatement(WhileStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
- ASSERT(current_block() != NULL);
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
+ DCHECK(current_block() != NULL);
HBasicBlock* loop_entry = BuildLoopEntry(stmt);
// If the condition is constant true, do not generate a branch.
@@ -5029,13 +5029,13 @@ void HOptimizedGraphBuilder::VisitWhileStatement(WhileStatement* stmt) {
void HOptimizedGraphBuilder::VisitForStatement(ForStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (stmt->init() != NULL) {
CHECK_ALIVE(Visit(stmt->init()));
}
- ASSERT(current_block() != NULL);
+ DCHECK(current_block() != NULL);
HBasicBlock* loop_entry = BuildLoopEntry(stmt);
HBasicBlock* loop_successor = NULL;
@@ -5078,9 +5078,9 @@ void HOptimizedGraphBuilder::VisitForStatement(ForStatement* stmt) {
void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (!FLAG_optimize_for_in) {
return Bailout(kForInStatementOptimizationIsDisabled);
@@ -5184,34 +5184,34 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
void HOptimizedGraphBuilder::VisitForOfStatement(ForOfStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kForOfStatement);
}
void HOptimizedGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kTryCatchStatement);
}
void HOptimizedGraphBuilder::VisitTryFinallyStatement(
TryFinallyStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kTryFinallyStatement);
}
void HOptimizedGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kDebuggerStatement);
}
@@ -5222,9 +5222,9 @@ void HOptimizedGraphBuilder::VisitCaseClause(CaseClause* clause) {
void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Handle<SharedFunctionInfo> shared_info = expr->shared_info();
if (shared_info.is_null()) {
shared_info =
@@ -5240,17 +5240,17 @@ void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
void HOptimizedGraphBuilder::VisitNativeFunctionLiteral(
NativeFunctionLiteral* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
return Bailout(kNativeFunctionLiteral);
}
void HOptimizedGraphBuilder::VisitConditional(Conditional* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
HBasicBlock* cond_true = graph()->CreateBasicBlock();
HBasicBlock* cond_false = graph()->CreateBasicBlock();
CHECK_BAILOUT(VisitForControl(expr->condition(), cond_true, cond_false));
@@ -5304,7 +5304,7 @@ HOptimizedGraphBuilder::GlobalPropertyAccess
HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) {
- ASSERT(var->IsContextSlot());
+ DCHECK(var->IsContextSlot());
HValue* context = environment()->context();
int length = scope()->ContextChainLength(var->scope());
while (length-- > 0) {
@@ -5321,14 +5321,14 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
current_info()->set_this_has_uses(true);
}
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Variable* variable = expr->var();
switch (variable->location()) {
case Variable::UNALLOCATED: {
if (IsLexicalVariableMode(variable->mode())) {
- // TODO(rossberg): should this be an ASSERT?
+ // TODO(rossberg): should this be an DCHECK?
return Bailout(kReferenceToGlobalLexicalVariable);
}
// Handle known global constants like 'undefined' specially to avoid a
@@ -5388,7 +5388,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
case Variable::LOCAL: {
HValue* value = LookupAndMakeLive(variable);
if (value == graph()->GetConstantHole()) {
- ASSERT(IsDeclaredVariableMode(variable->mode()) &&
+ DCHECK(IsDeclaredVariableMode(variable->mode()) &&
variable->mode() != VAR);
return Bailout(kReferenceToUninitializedVariable);
}
@@ -5422,18 +5422,18 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
void HOptimizedGraphBuilder::VisitLiteral(Literal* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
HConstant* instr = New<HConstant>(expr->value());
return ast_context()->ReturnInstruction(instr, expr->id());
}
void HOptimizedGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Handle<JSFunction> closure = function_state()->compilation_info()->closure();
Handle<FixedArray> literals(closure->literals());
HRegExpLiteral* instr = New<HRegExpLiteral>(literals,
@@ -5465,7 +5465,7 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate,
return false;
}
- ASSERT(max_depth >= 0 && *max_properties >= 0);
+ DCHECK(max_depth >= 0 && *max_properties >= 0);
if (max_depth == 0) return false;
Isolate* isolate = boilerplate->GetIsolate();
@@ -5520,9 +5520,9 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate,
void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
expr->BuildConstantProperties(isolate());
Handle<JSFunction> closure = function_state()->compilation_info()->closure();
HInstruction* literal;
@@ -5585,7 +5585,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
switch (property->kind()) {
case ObjectLiteral::Property::MATERIALIZED_LITERAL:
- ASSERT(!CompileTimeValue::IsCompileTimeValue(value));
+ DCHECK(!CompileTimeValue::IsCompileTimeValue(value));
// Fall through.
case ObjectLiteral::Property::COMPUTED:
if (key->value()->IsInternalizedString()) {
@@ -5603,7 +5603,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
PropertyAccessInfo info(this, STORE, ToType(map), name);
if (info.CanAccessMonomorphic()) {
HValue* checked_literal = Add<HCheckMaps>(literal, map);
- ASSERT(!info.lookup()->IsPropertyCallbacks());
+ DCHECK(!info.lookup()->IsPropertyCallbacks());
store = BuildMonomorphicAccess(
&info, literal, checked_literal, value,
BailoutId::None(), BailoutId::None());
@@ -5645,9 +5645,9 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
expr->BuildConstantElements(isolate());
ZoneList<Expression*>* subexprs = expr->values();
int length = subexprs->length();
@@ -5682,14 +5682,14 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
isolate()->counters()->cow_arrays_created_runtime()->Increment();
}
} else {
- ASSERT(literals_cell->IsAllocationSite());
+ DCHECK(literals_cell->IsAllocationSite());
site = Handle<AllocationSite>::cast(literals_cell);
boilerplate_object = Handle<JSObject>(
JSObject::cast(site->transition_info()), isolate());
}
- ASSERT(!boilerplate_object.is_null());
- ASSERT(site->SitePointsToLiteral());
+ DCHECK(!boilerplate_object.is_null());
+ DCHECK(site->SitePointsToLiteral());
ElementsKind boilerplate_elements_kind =
boilerplate_object->GetElementsKind();
@@ -5801,7 +5801,7 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedField(
Handle<JSObject>::cast(object)->Lookup(info->name(), &lookup);
Handle<Object> value(lookup.GetLazyValue(), isolate());
- ASSERT(!value->IsTheHole());
+ DCHECK(!value->IsTheHole());
return New<HConstant>(value);
}
}
@@ -5873,7 +5873,7 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
}
if (!info->field_maps()->is_empty()) {
- ASSERT(field_access.representation().IsHeapObject());
+ DCHECK(field_access.representation().IsHeapObject());
value = Add<HCheckMaps>(value, info->field_maps());
}
@@ -5885,7 +5885,7 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
if (transition_to_field) {
Handle<Map> transition(info->transition());
- ASSERT(!transition->is_deprecated());
+ DCHECK(!transition->is_deprecated());
instr->SetTransition(Add<HConstant>(transition));
}
return instr;
@@ -5929,7 +5929,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible(
return constant_.is_identical_to(info->constant_);
}
- ASSERT(lookup_.IsField());
+ DCHECK(lookup_.IsField());
if (!info->lookup_.IsField()) return false;
Representation r = access_.representation();
@@ -6022,7 +6022,7 @@ void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(
// Collect the (stable) maps from the field type.
int num_field_maps = field_type->NumClasses();
if (num_field_maps == 0) return;
- ASSERT(access_.representation().IsHeapObject());
+ DCHECK(access_.representation().IsHeapObject());
field_maps_.Reserve(num_field_maps, zone());
HeapType::Iterator<Map> it = field_type->Classes();
while (!it.Done()) {
@@ -6035,11 +6035,11 @@ void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(
it.Advance();
}
field_maps_.Sort();
- ASSERT_EQ(num_field_maps, field_maps_.length());
+ DCHECK_EQ(num_field_maps, field_maps_.length());
// Determine field HType from field HeapType.
field_type_ = HType::FromType<HeapType>(field_type);
- ASSERT(field_type_.IsHeapObject());
+ DCHECK(field_type_.IsHeapObject());
// Add dependency on the map that introduced the field.
Map::AddDependentCompilationInfo(
@@ -6102,7 +6102,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() {
bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic(
SmallMapList* types) {
- ASSERT(type_->Is(ToType(types->first())));
+ DCHECK(type_->Is(ToType(types->first())));
if (!CanAccessMonomorphic()) return false;
STATIC_ASSERT(kMaxLoadPolymorphism == kMaxStorePolymorphism);
if (types->length() > kMaxLoadPolymorphism) return false;
@@ -6125,7 +6125,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic(
if (type_->Is(Type::Number())) return false;
// Multiple maps cannot transition to the same target map.
- ASSERT(!IsLoad() || !lookup_.IsTransition());
+ DCHECK(!IsLoad() || !lookup_.IsTransition());
if (lookup_.IsTransition() && types->length() > 1) return false;
for (int i = 1; i < types->length(); ++i) {
@@ -6164,13 +6164,13 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess(
HObjectAccess access = HObjectAccess::ForMap(); // bogus default
if (info->GetJSObjectFieldAccess(&access)) {
- ASSERT(info->IsLoad());
+ DCHECK(info->IsLoad());
return New<HLoadNamedField>(object, checked_object, access);
}
if (info->name().is_identical_to(isolate()->factory()->prototype_string()) &&
info->map()->function_with_prototype()) {
- ASSERT(!info->map()->has_non_instance_prototype());
+ DCHECK(!info->map()->has_non_instance_prototype());
return New<HLoadFunctionPrototype>(checked_object);
}
@@ -6181,7 +6181,7 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess(
}
if (!info->lookup()->IsFound()) {
- ASSERT(info->IsLoad());
+ DCHECK(info->IsLoad());
return graph()->GetConstantUndefined();
}
@@ -6194,7 +6194,7 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess(
}
if (info->lookup()->IsTransition()) {
- ASSERT(!info->IsLoad());
+ DCHECK(!info->IsLoad());
return BuildStoreNamedField(info, checked_object, value);
}
@@ -6222,7 +6222,7 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess(
return BuildCallConstantFunction(info->accessor(), argument_count);
}
- ASSERT(info->lookup()->IsConstant());
+ DCHECK(info->lookup()->IsConstant());
if (info->IsLoad()) {
return New<HConstant>(info->constant());
} else {
@@ -6361,7 +6361,7 @@ void HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(
}
}
- ASSERT(join != NULL);
+ DCHECK(join != NULL);
if (join->HasPredecessor()) {
join->SetJoinId(ast_id);
set_current_block(join);
@@ -6422,7 +6422,7 @@ void HOptimizedGraphBuilder::BuildStore(Expression* expr,
Literal* key = prop->key()->AsLiteral();
Handle<String> name = Handle<String>::cast(key->value());
- ASSERT(!name.is_null());
+ DCHECK(!name.is_null());
HInstruction* instr = BuildNamedAccess(STORE, ast_id, return_id, expr,
object, name, value, is_uninitialized);
@@ -6440,7 +6440,7 @@ void HOptimizedGraphBuilder::BuildStore(Expression* expr,
void HOptimizedGraphBuilder::HandlePropertyAssignment(Assignment* expr) {
Property* prop = expr->target()->AsProperty();
- ASSERT(prop != NULL);
+ DCHECK(prop != NULL);
CHECK_ALIVE(VisitForValue(prop->obj()));
if (!prop->key()->IsPropertyName()) {
CHECK_ALIVE(VisitForValue(prop->key()));
@@ -6499,7 +6499,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
Add<HStoreNamedGeneric>(global_object, var->name(),
value, function_strict_mode());
USE(instr);
- ASSERT(instr->HasObservableSideEffects());
+ DCHECK(instr->HasObservableSideEffects());
Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
}
}
@@ -6509,7 +6509,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
Expression* target = expr->target();
VariableProxy* proxy = target->AsVariableProxy();
Property* prop = target->AsProperty();
- ASSERT(proxy == NULL || prop == NULL);
+ DCHECK(proxy == NULL || prop == NULL);
// We have a second position recorded in the FullCodeGenerator to have
// type feedback for the binary operation.
@@ -6610,12 +6610,12 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
VariableProxy* proxy = expr->target()->AsVariableProxy();
Property* prop = expr->target()->AsProperty();
- ASSERT(proxy == NULL || prop == NULL);
+ DCHECK(proxy == NULL || prop == NULL);
if (expr->is_compound()) {
HandleCompoundAssignment(expr);
@@ -6711,7 +6711,7 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
expr->op() == Token::INIT_CONST) {
mode = HStoreContextSlot::kNoCheck;
} else {
- ASSERT(expr->op() == Token::INIT_CONST_LEGACY);
+ DCHECK(expr->op() == Token::INIT_CONST_LEGACY);
mode = HStoreContextSlot::kCheckIgnoreAssignment;
}
@@ -6741,13 +6741,13 @@ void HOptimizedGraphBuilder::VisitYield(Yield* expr) {
void HOptimizedGraphBuilder::VisitThrow(Throw* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
// We don't optimize functions with invalid left-hand sides in
// assignments, count operations, or for-in. Consequently throw can
// currently only occur in an effect context.
- ASSERT(ast_context()->IsEffect());
+ DCHECK(ast_context()->IsEffect());
CHECK_ALIVE(VisitForValue(expr->exception()));
HValue* value = environment()->Pop();
@@ -6881,7 +6881,7 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess(
holder = JSObject::cast(*PrototypeIterator::GetCurrent(iter));
iter.Advance();
}
- ASSERT(holder && holder->IsJSObject());
+ DCHECK(holder && holder->IsJSObject());
BuildCheckPrototypeMaps(handle(JSObject::cast(map->prototype())),
Handle<JSObject>(holder));
@@ -7013,9 +7013,9 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
HTransitionElementsKind* transition = NULL;
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
- ASSERT(map->IsMap());
+ DCHECK(map->IsMap());
if (!transition_target.at(i).is_null()) {
- ASSERT(Map::IsValidElementsTransition(
+ DCHECK(Map::IsValidElementsTransition(
map->elements_kind(),
transition_target.at(i)->elements_kind()));
transition = Add<HTransitionElementsKind>(object, map,
@@ -7027,7 +7027,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
// If only one map is left after transitioning, handle this case
// monomorphically.
- ASSERT(untransitionable_maps.length() >= 1);
+ DCHECK(untransitionable_maps.length() >= 1);
if (untransitionable_maps.length() == 1) {
Handle<Map> untransitionable_map = untransitionable_maps[0];
HInstruction* instr = NULL;
@@ -7062,7 +7062,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
access = AddInstruction(BuildKeyedGeneric(access_type, expr, object, key,
val));
} else {
- ASSERT(IsFastElementsKind(elements_kind) ||
+ DCHECK(IsFastElementsKind(elements_kind) ||
IsExternalArrayElementsKind(elements_kind) ||
IsFixedTypedArrayElementsKind(elements_kind));
LoadKeyedHoleMode load_mode = BuildKeyedHoleMode(map);
@@ -7089,7 +7089,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
// necessary because FinishExitWithHardDeoptimization does an AbnormalExit
// rather than joining the join block. If this becomes an issue, insert a
// generic access in the case length() == 0.
- ASSERT(join->predecessors()->length() > 0);
+ DCHECK(join->predecessors()->length() > 0);
// Deopt if none of the cases matched.
NoObservableSideEffectsScope scope(this);
FinishExitWithHardDeoptimization("Unknown map in polymorphic element access");
@@ -7105,7 +7105,7 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
Expression* expr,
PropertyAccessType access_type,
bool* has_side_effects) {
- ASSERT(!expr->IsPropertyName());
+ DCHECK(!expr->IsPropertyName());
HInstruction* instr = NULL;
SmallMapList* types;
@@ -7250,7 +7250,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedAccess(
bool is_uninitialized) {
SmallMapList* types;
ComputeReceiverTypes(expr, object, &types, zone());
- ASSERT(types != NULL);
+ DCHECK(types != NULL);
if (types->length() > 0) {
PropertyAccessInfo info(this, access, ToType(types->first()), name);
@@ -7262,7 +7262,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedAccess(
HValue* checked_object;
// Type::Number() is only supported by polymorphic load/call handling.
- ASSERT(!info.type()->Is(Type::Number()));
+ DCHECK(!info.type()->Is(Type::Number()));
BuildCheckHeapObject(object);
if (AreStringTypes(types)) {
checked_object =
@@ -7330,9 +7330,9 @@ void HOptimizedGraphBuilder::BuildLoad(Property* expr,
void HOptimizedGraphBuilder::VisitProperty(Property* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (TryArgumentsAccess(expr)) return;
@@ -7627,7 +7627,7 @@ void HOptimizedGraphBuilder::HandlePolymorphicCallNamed(
// We assume that control flow is always live after an expression. So
// even without predecessors to the join block, we set it as the exit
// block and continue by adding instructions there.
- ASSERT(join != NULL);
+ DCHECK(join != NULL);
if (join->HasPredecessor()) {
set_current_block(join);
join->SetJoinId(expr->id());
@@ -7839,7 +7839,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
// TryInline should always return true).
// Type-check the inlined function.
- ASSERT(target_shared->has_deoptimization_support());
+ DCHECK(target_shared->has_deoptimization_support());
AstTyper::Run(&target_info);
int function_id = graph()->TraceInlinedFunction(target_shared, position);
@@ -7873,7 +7873,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
// If the function uses arguments object then bind bind one.
if (function->scope()->arguments() != NULL) {
- ASSERT(function->scope()->arguments()->IsStackAllocated());
+ DCHECK(function->scope()->arguments()->IsStackAllocated());
inner_env->Bind(function->scope()->arguments(), arguments_object);
}
@@ -7911,7 +7911,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
inlined_count_ += nodes_added;
Handle<Code> unoptimized_code(target_shared->code());
- ASSERT(unoptimized_code->kind() == Code::FUNCTION);
+ DCHECK(unoptimized_code->kind() == Code::FUNCTION);
Handle<TypeFeedbackInfo> type_info(
TypeFeedbackInfo::cast(unoptimized_code->type_feedback_info()));
graph()->update_type_change_checksum(type_info->own_type_change_checksum());
@@ -7929,7 +7929,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
} else if (call_context()->IsEffect()) {
Goto(function_return(), state);
} else {
- ASSERT(call_context()->IsValue());
+ DCHECK(call_context()->IsValue());
AddLeaveInlined(implicit_return_value, state);
}
} else if (state->inlining_kind() == SETTER_CALL_RETURN) {
@@ -7941,7 +7941,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
} else if (call_context()->IsEffect()) {
Goto(function_return(), state);
} else {
- ASSERT(call_context()->IsValue());
+ DCHECK(call_context()->IsValue());
AddLeaveInlined(implicit_return_value, state);
}
} else {
@@ -7952,7 +7952,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
} else if (call_context()->IsEffect()) {
Goto(function_return(), state);
} else {
- ASSERT(call_context()->IsValue());
+ DCHECK(call_context()->IsValue());
AddLeaveInlined(undefined, state);
}
}
@@ -7966,7 +7966,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
HEnterInlined* entry = function_state()->entry();
// Pop the return test context from the expression context stack.
- ASSERT(ast_context() == inlined_test_context());
+ DCHECK(ast_context() == inlined_test_context());
ClearInlinedTestContext();
delete target_state;
@@ -8175,7 +8175,7 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
left, kMathPowHalf);
// MathPowHalf doesn't have side effects so there's no need for
// an environment simulation here.
- ASSERT(!sqrt->HasObservableSideEffects());
+ DCHECK(!sqrt->HasObservableSideEffects());
result = NewUncasted<HDiv>(one, sqrt);
} else if (exponent == 2.0) {
result = NewUncasted<HMul>(left, left);
@@ -8218,7 +8218,7 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
ElementsKind elements_kind = receiver_map->elements_kind();
if (!IsFastElementsKind(elements_kind)) return false;
if (receiver_map->is_observed()) return false;
- ASSERT(receiver_map->is_extensible());
+ DCHECK(receiver_map->is_extensible());
Drop(expr->arguments()->length());
HValue* result;
@@ -8283,7 +8283,7 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
if (!IsFastElementsKind(elements_kind)) return false;
if (receiver_map->is_observed()) return false;
if (JSArray::IsReadOnlyLengthDescriptor(receiver_map)) return false;
- ASSERT(receiver_map->is_extensible());
+ DCHECK(receiver_map->is_extensible());
// If there may be elements accessors in the prototype chain, the fast
// inlined version can't be used.
@@ -8335,7 +8335,7 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
ElementsKind kind = receiver_map->elements_kind();
if (!IsFastElementsKind(kind)) return false;
if (receiver_map->is_observed()) return false;
- ASSERT(receiver_map->is_extensible());
+ DCHECK(receiver_map->is_extensible());
// If there may be elements accessors in the prototype chain, the fast
// inlined version can't be used.
@@ -8450,7 +8450,7 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
if (!IsFastElementsKind(kind)) return false;
if (receiver_map->is_observed()) return false;
if (argument_count != 2) return false;
- ASSERT(receiver_map->is_extensible());
+ DCHECK(receiver_map->is_extensible());
// If there may be elements accessors in the prototype chain, the fast
// inlined version can't be used.
@@ -8557,7 +8557,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
// Cannot embed a direct reference to the global proxy map
// as it maybe dropped on deserialization.
CHECK(!isolate()->serializer_enabled());
- ASSERT_EQ(0, receiver_maps->length());
+ DCHECK_EQ(0, receiver_maps->length());
receiver_maps->Add(handle(function->global_proxy()->map()), zone());
}
CallOptimization::HolderLookup holder_lookup =
@@ -8583,7 +8583,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
if (holder_lookup == CallOptimization::kHolderFound) {
AddCheckPrototypeMaps(api_holder, receiver_maps->first());
} else {
- ASSERT_EQ(holder_lookup, CallOptimization::kHolderIsReceiver);
+ DCHECK_EQ(holder_lookup, CallOptimization::kHolderIsReceiver);
}
// Includes receiver.
PushArgumentsFromEnvironment(argc + 1);
@@ -8592,8 +8592,8 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
break;
case kCallApiGetter:
// Receiver and prototype chain cannot have changed.
- ASSERT_EQ(0, argc);
- ASSERT_EQ(NULL, receiver);
+ DCHECK_EQ(0, argc);
+ DCHECK_EQ(NULL, receiver);
// Receiver is on expression stack.
receiver = Pop();
Add<HPushArguments>(receiver);
@@ -8602,8 +8602,8 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
{
is_store = true;
// Receiver and prototype chain cannot have changed.
- ASSERT_EQ(1, argc);
- ASSERT_EQ(NULL, receiver);
+ DCHECK_EQ(1, argc);
+ DCHECK_EQ(NULL, receiver);
// Receiver and value are on expression stack.
HValue* value = Pop();
receiver = Pop();
@@ -8649,7 +8649,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
Handle<Code> code = stub.GetCode();
HConstant* code_value = Add<HConstant>(code);
- ASSERT((sizeof(op_vals) / kPointerSize) ==
+ DCHECK((sizeof(op_vals) / kPointerSize) ==
descriptor->GetEnvironmentLength());
HInstruction* call = New<HCallWithDescriptor>(
@@ -8663,7 +8663,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
- ASSERT(expr->expression()->IsProperty());
+ DCHECK(expr->expression()->IsProperty());
if (!expr->IsMonomorphic()) {
return false;
@@ -8706,7 +8706,7 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
} else {
// We are inside inlined function and we know exactly what is inside
// arguments object. But we need to be able to materialize at deopt.
- ASSERT_EQ(environment()->arguments_environment()->parameter_count(),
+ DCHECK_EQ(environment()->arguments_environment()->parameter_count(),
function_state()->entry()->arguments_object()->arguments_count());
HArgumentsObject* args = function_state()->entry()->arguments_object();
const ZoneList<HValue*>* arguments_values = args->arguments_values();
@@ -8774,7 +8774,7 @@ HValue* HOptimizedGraphBuilder::BuildArrayIndexOf(HValue* receiver,
HValue* search_element,
ElementsKind kind,
ArrayIndexOfMode mode) {
- ASSERT(IsFastElementsKind(kind));
+ DCHECK(IsFastElementsKind(kind));
NoObservableSideEffectsScope no_effects(this);
@@ -8791,7 +8791,7 @@ HValue* HOptimizedGraphBuilder::BuildArrayIndexOf(HValue* receiver,
token = Token::LT;
direction = LoopBuilder::kPostIncrement;
} else {
- ASSERT_EQ(kLastIndexOf, mode);
+ DCHECK_EQ(kLastIndexOf, mode);
initial = length;
terminating = graph()->GetConstant0();
token = Token::GT;
@@ -8950,9 +8950,9 @@ bool HOptimizedGraphBuilder::TryHandleArrayCallNew(CallNew* expr,
void HOptimizedGraphBuilder::VisitCall(Call* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
Expression* callee = expr->expression();
int argument_count = expr->arguments()->length() + 1; // Plus receiver.
HInstruction* call = NULL;
@@ -9131,8 +9131,8 @@ void HOptimizedGraphBuilder::BuildInlinedCallArray(
Expression* expression,
int argument_count,
Handle<AllocationSite> site) {
- ASSERT(!site.is_null());
- ASSERT(argument_count >= 0 && argument_count <= 1);
+ DCHECK(!site.is_null());
+ DCHECK(argument_count >= 0 && argument_count <= 1);
NoObservableSideEffectsScope no_effects(this);
// We should at least have the constructor on the expression stack.
@@ -9150,7 +9150,7 @@ void HOptimizedGraphBuilder::BuildInlinedCallArray(
HValue* argument = environment()->Top();
if (argument->IsConstant()) {
HConstant* constant_argument = HConstant::cast(argument);
- ASSERT(constant_argument->HasSmiValue());
+ DCHECK(constant_argument->HasSmiValue());
int constant_array_size = constant_argument->Integer32Value();
if (constant_array_size != 0) {
kind = GetHoleyElementsKind(kind);
@@ -9189,8 +9189,8 @@ bool HOptimizedGraphBuilder::IsCallArrayInlineable(
Handle<JSFunction> caller = current_info()->closure();
Handle<JSFunction> target = array_function();
// We should have the function plus array arguments on the environment stack.
- ASSERT(environment()->length() >= (argument_count + 1));
- ASSERT(!site.is_null());
+ DCHECK(environment()->length() >= (argument_count + 1));
+ DCHECK(!site.is_null());
bool inline_ok = false;
if (site->CanInlineCall()) {
@@ -9230,9 +9230,9 @@ bool HOptimizedGraphBuilder::IsCallArrayInlineable(
void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position());
int argument_count = expr->arguments()->length() + 1; // Plus constructor.
Factory* factory = isolate()->factory();
@@ -9256,10 +9256,10 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
}
// Calculate instance size from initial map of constructor.
- ASSERT(constructor->has_initial_map());
+ DCHECK(constructor->has_initial_map());
Handle<Map> initial_map(constructor->initial_map());
int instance_size = initial_map->instance_size();
- ASSERT(initial_map->InitialPropertiesLength() == 0);
+ DCHECK(initial_map->InitialPropertiesLength() == 0);
// Allocate an instance of the implicit receiver object.
HValue* size_in_bytes = Add<HConstant>(instance_size);
@@ -9282,7 +9282,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
// Initialize map and fields of the newly allocated object.
{ NoObservableSideEffectsScope no_effects(this);
- ASSERT(initial_map->instance_type() == JS_OBJECT_TYPE);
+ DCHECK(initial_map->instance_type() == JS_OBJECT_TYPE);
Add<HStoreNamedField>(receiver,
HObjectAccess::ForMapAndOffset(initial_map, JSObject::kMapOffset),
Add<HConstant>(initial_map));
@@ -9309,7 +9309,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
// Replace the constructor function with a newly allocated receiver using
// the index of the receiver from the top of the expression stack.
const int receiver_index = argument_count - 1;
- ASSERT(environment()->ExpressionStackAt(receiver_index) == function);
+ DCHECK(environment()->ExpressionStackAt(receiver_index) == function);
environment()->SetExpressionStackAt(receiver_index, receiver);
if (TryInlineConstruct(expr, receiver)) {
@@ -9415,7 +9415,7 @@ void HOptimizedGraphBuilder::GenerateDataViewInitialize(
CallRuntime* expr) {
ZoneList<Expression*>* arguments = expr->arguments();
- ASSERT(arguments->length()== 4);
+ DCHECK(arguments->length()== 4);
CHECK_ALIVE(VisitForValue(arguments->at(0)));
HValue* obj = Pop();
@@ -9559,7 +9559,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
static const int kByteOffsetArg = 3;
static const int kByteLengthArg = 4;
static const int kArgsLength = 5;
- ASSERT(arguments->length() == kArgsLength);
+ DCHECK(arguments->length() == kArgsLength);
CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg)));
@@ -9601,7 +9601,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
CHECK_ALIVE(VisitForValue(arguments->at(kByteOffsetArg)));
byte_offset = Pop();
is_zero_byte_offset = false;
- ASSERT(buffer != NULL);
+ DCHECK(buffer != NULL);
}
CHECK_ALIVE(VisitForValue(arguments->at(kByteLengthArg)));
@@ -9649,7 +9649,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
isolate(), array_type, external_elements_kind);
AddStoreMapConstant(obj, obj_map);
} else {
- ASSERT(is_zero_byte_offset);
+ DCHECK(is_zero_byte_offset);
elements = BuildAllocateFixedTypedArray(
array_type, element_size, fixed_elements_kind,
byte_length, length);
@@ -9675,7 +9675,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
void HOptimizedGraphBuilder::GenerateMaxSmi(CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 0);
+ DCHECK(expr->arguments()->length() == 0);
HConstant* max_smi = New<HConstant>(static_cast<int32_t>(Smi::kMaxValue));
return ast_context()->ReturnInstruction(max_smi, expr->id());
}
@@ -9683,7 +9683,7 @@ void HOptimizedGraphBuilder::GenerateMaxSmi(CallRuntime* expr) {
void HOptimizedGraphBuilder::GenerateTypedArrayMaxSizeInHeap(
CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 0);
+ DCHECK(expr->arguments()->length() == 0);
HConstant* result = New<HConstant>(static_cast<int32_t>(
FLAG_typed_array_max_size_in_heap));
return ast_context()->ReturnInstruction(result, expr->id());
@@ -9692,7 +9692,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayMaxSizeInHeap(
void HOptimizedGraphBuilder::GenerateArrayBufferGetByteLength(
CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 1);
+ DCHECK(expr->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
HValue* buffer = Pop();
HInstruction* result = New<HLoadNamedField>(
@@ -9705,7 +9705,7 @@ void HOptimizedGraphBuilder::GenerateArrayBufferGetByteLength(
void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteLength(
CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 1);
+ DCHECK(expr->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
HValue* buffer = Pop();
HInstruction* result = New<HLoadNamedField>(
@@ -9718,7 +9718,7 @@ void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteLength(
void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteOffset(
CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 1);
+ DCHECK(expr->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
HValue* buffer = Pop();
HInstruction* result = New<HLoadNamedField>(
@@ -9731,7 +9731,7 @@ void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteOffset(
void HOptimizedGraphBuilder::GenerateTypedArrayGetLength(
CallRuntime* expr) {
- ASSERT(expr->arguments()->length() == 1);
+ DCHECK(expr->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
HValue* buffer = Pop();
HInstruction* result = New<HLoadNamedField>(
@@ -9743,32 +9743,32 @@ void HOptimizedGraphBuilder::GenerateTypedArrayGetLength(
void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (expr->is_jsruntime()) {
return Bailout(kCallToAJavaScriptRuntimeFunction);
}
const Runtime::Function* function = expr->function();
- ASSERT(function != NULL);
+ DCHECK(function != NULL);
if (function->intrinsic_type == Runtime::INLINE ||
function->intrinsic_type == Runtime::INLINE_OPTIMIZED) {
- ASSERT(expr->name()->length() > 0);
- ASSERT(expr->name()->Get(0) == '_');
+ DCHECK(expr->name()->length() > 0);
+ DCHECK(expr->name()->Get(0) == '_');
// Call to an inline function.
int lookup_index = static_cast<int>(function->function_id) -
static_cast<int>(Runtime::kFirstInlineFunction);
- ASSERT(lookup_index >= 0);
- ASSERT(static_cast<size_t>(lookup_index) <
+ DCHECK(lookup_index >= 0);
+ DCHECK(static_cast<size_t>(lookup_index) <
ARRAY_SIZE(kInlineFunctionGenerators));
InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index];
// Call the inline code generator using the pointer-to-member.
(this->*generator)(expr);
} else {
- ASSERT(function->intrinsic_type == Runtime::RUNTIME);
+ DCHECK(function->intrinsic_type == Runtime::RUNTIME);
Handle<String> name = expr->name();
int argument_count = expr->arguments()->length();
CHECK_ALIVE(VisitExpressions(expr->arguments()));
@@ -9781,9 +9781,9 @@ void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
void HOptimizedGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
switch (expr->op()) {
case Token::DELETE: return VisitDelete(expr);
case Token::VOID: return VisitVoid(expr);
@@ -9860,7 +9860,7 @@ void HOptimizedGraphBuilder::VisitNot(UnaryOperation* expr) {
return;
}
- ASSERT(ast_context()->IsValue());
+ DCHECK(ast_context()->IsValue());
HBasicBlock* materialize_false = graph()->CreateBasicBlock();
HBasicBlock* materialize_true = graph()->CreateBasicBlock();
CHECK_BAILOUT(VisitForControl(expr->expression(),
@@ -9946,9 +9946,9 @@ void HOptimizedGraphBuilder::BuildStoreForEffect(Expression* expr,
void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position());
Expression* target = expr->expression();
VariableProxy* proxy = target->AsVariableProxy();
@@ -9971,7 +9971,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
return Bailout(kUnsupportedCountOperationWithConst);
}
// Argument of the count operation is a variable, not a property.
- ASSERT(prop == NULL);
+ DCHECK(prop == NULL);
CHECK_ALIVE(VisitForValue(target));
after = BuildIncrement(returns_original_input, expr);
@@ -10026,7 +10026,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
}
// Argument of the count operation is a property.
- ASSERT(prop != NULL);
+ DCHECK(prop != NULL);
if (returns_original_input) Push(graph()->GetConstantUndefined());
CHECK_ALIVE(VisitForValue(prop->obj()));
@@ -10176,7 +10176,7 @@ HValue* HGraphBuilder::TruncateToNumber(HValue* value, Type** expected) {
// We expect to get a number.
// (We need to check first, since Type::None->Is(Type::Any()) == true.
if (expected_obj->Is(Type::None())) {
- ASSERT(!expected_number->Is(Type::None(zone())));
+ DCHECK(!expected_number->Is(Type::None(zone())));
return value;
}
@@ -10279,10 +10279,10 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Convert left argument as necessary.
if (left_type->Is(Type::Number())) {
- ASSERT(right_type->Is(Type::String()));
+ DCHECK(right_type->Is(Type::String()));
left = BuildNumberToString(left, left_type);
} else if (!left_type->Is(Type::String())) {
- ASSERT(right_type->Is(Type::String()));
+ DCHECK(right_type->Is(Type::String()));
HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_RIGHT);
Add<HPushArguments>(left, right);
return AddUncasted<HInvokeFunction>(function, 2);
@@ -10290,10 +10290,10 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Convert right argument as necessary.
if (right_type->Is(Type::Number())) {
- ASSERT(left_type->Is(Type::String()));
+ DCHECK(left_type->Is(Type::String()));
right = BuildNumberToString(right, right_type);
} else if (!right_type->Is(Type::String())) {
- ASSERT(left_type->Is(Type::String()));
+ DCHECK(left_type->Is(Type::String()));
HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_LEFT);
Add<HPushArguments>(left, right);
return AddUncasted<HInvokeFunction>(function, 2);
@@ -10313,7 +10313,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Register the dependent code with the allocation site.
if (!allocation_mode.feedback_site().is_null()) {
- ASSERT(!graph()->info()->IsStub());
+ DCHECK(!graph()->info()->IsStub());
Handle<AllocationSite> site(allocation_mode.feedback_site());
AllocationSite::AddDependentCompilationInfo(
site, AllocationSite::TENURING, top_info());
@@ -10454,15 +10454,15 @@ static bool IsClassOfTest(CompareOperation* expr) {
if (!call->name()->IsOneByteEqualTo(STATIC_ASCII_VECTOR("_ClassOf"))) {
return false;
}
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
return true;
}
void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
switch (expr->op()) {
case Token::COMMA:
return VisitComma(expr);
@@ -10509,7 +10509,7 @@ void HOptimizedGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) {
} else if (ast_context()->IsValue()) {
CHECK_ALIVE(VisitForValue(expr->left()));
- ASSERT(current_block() != NULL);
+ DCHECK(current_block() != NULL);
HValue* left_value = Top();
// Short-circuit left values that always evaluate to the same boolean value.
@@ -10544,7 +10544,7 @@ void HOptimizedGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) {
return ast_context()->ReturnValue(Pop());
} else {
- ASSERT(ast_context()->IsEffect());
+ DCHECK(ast_context()->IsEffect());
// In an effect context, we don't need the value of the left subexpression,
// only its control flow and side effects. We need an extra block to
// maintain edge-split form.
@@ -10630,9 +10630,9 @@ static bool IsLiteralCompareBool(Isolate* isolate,
void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position());
@@ -10653,7 +10653,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
if (IsClassOfTest(expr)) {
CallRuntime* call = expr->left()->AsCallRuntime();
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
Literal* literal = expr->right()->AsLiteral();
@@ -10864,10 +10864,10 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
Expression* sub_expr,
NilValue nil) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
- ASSERT(expr->op() == Token::EQ || expr->op() == Token::EQ_STRICT);
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
+ DCHECK(expr->op() == Token::EQ || expr->op() == Token::EQ_STRICT);
if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position());
CHECK_ALIVE(VisitForValue(sub_expr));
HValue* value = Pop();
@@ -10879,7 +10879,7 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
New<HCompareObjectEqAndBranch>(value, nil_constant);
return ast_context()->ReturnControl(instr, expr->id());
} else {
- ASSERT_EQ(Token::EQ, expr->op());
+ DCHECK_EQ(Token::EQ, expr->op());
Type* type = expr->combined_type()->Is(Type::None())
? Type::Any(zone()) : expr->combined_type();
HIfContinuation continuation;
@@ -10906,7 +10906,7 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
AllocationSiteUsageContext* site_context) {
NoObservableSideEffectsScope no_effects(this);
InstanceType instance_type = boilerplate_object->map()->instance_type();
- ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE);
+ DCHECK(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE);
HType type = instance_type == JS_ARRAY_TYPE
? HType::JSArray() : HType::JSObject();
@@ -10981,14 +10981,14 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
void HOptimizedGraphBuilder::BuildEmitObjectHeader(
Handle<JSObject> boilerplate_object,
HInstruction* object) {
- ASSERT(boilerplate_object->properties()->length() == 0);
+ DCHECK(boilerplate_object->properties()->length() == 0);
Handle<Map> boilerplate_object_map(boilerplate_object->map());
AddStoreMapConstant(object, boilerplate_object_map);
Handle<Object> properties_field =
Handle<Object>(boilerplate_object->properties(), isolate());
- ASSERT(*properties_field == isolate()->heap()->empty_fixed_array());
+ DCHECK(*properties_field == isolate()->heap()->empty_fixed_array());
HInstruction* properties = Add<HConstant>(properties_field);
HObjectAccess access = HObjectAccess::ForPropertiesPointer();
Add<HStoreNamedField>(object, access, properties);
@@ -11000,7 +11000,7 @@ void HOptimizedGraphBuilder::BuildEmitObjectHeader(
Handle<Object>(boilerplate_array->length(), isolate());
HInstruction* length = Add<HConstant>(length_field);
- ASSERT(boilerplate_array->length()->IsSmi());
+ DCHECK(boilerplate_array->length()->IsSmi());
Add<HStoreNamedField>(object, HObjectAccess::ForArrayLength(
boilerplate_array->GetElementsKind()), length);
}
@@ -11011,7 +11011,7 @@ void HOptimizedGraphBuilder::BuildInitElementsInObjectHeader(
Handle<JSObject> boilerplate_object,
HInstruction* object,
HInstruction* object_elements) {
- ASSERT(boilerplate_object->properties()->length() == 0);
+ DCHECK(boilerplate_object->properties()->length() == 0);
if (object_elements == NULL) {
Handle<Object> elements_field =
Handle<Object>(boilerplate_object->elements(), isolate());
@@ -11095,7 +11095,7 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties(
HInstruction* value_instruction =
Add<HConstant>(isolate()->factory()->one_pointer_filler_map());
for (int i = copied_fields; i < inobject_properties; i++) {
- ASSERT(boilerplate_object->IsJSObject());
+ DCHECK(boilerplate_object->IsJSObject());
int property_offset = boilerplate_object->GetInObjectPropertyOffset(i);
HObjectAccess access =
HObjectAccess::ForMapAndOffset(boilerplate_map, property_offset);
@@ -11175,9 +11175,9 @@ void HOptimizedGraphBuilder::BuildEmitFixedArray(
void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) {
- ASSERT(!HasStackOverflow());
- ASSERT(current_block() != NULL);
- ASSERT(current_block()->HasPredecessor());
+ DCHECK(!HasStackOverflow());
+ DCHECK(current_block() != NULL);
+ DCHECK(current_block()->HasPredecessor());
HInstruction* instr = BuildThisFunction();
return ast_context()->ReturnInstruction(instr, expr->id());
}
@@ -11185,7 +11185,7 @@ void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) {
void HOptimizedGraphBuilder::VisitDeclarations(
ZoneList<Declaration*>* declarations) {
- ASSERT(globals_.is_empty());
+ DCHECK(globals_.is_empty());
AstVisitor::VisitDeclarations(declarations);
if (!globals_.is_empty()) {
Handle<FixedArray> array =
@@ -11321,7 +11321,7 @@ void HOptimizedGraphBuilder::VisitModuleStatement(ModuleStatement* stmt) {
// Generators for inline runtime functions.
// Support for types.
void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HIsSmiAndBranch* result = New<HIsSmiAndBranch>(value);
@@ -11330,7 +11330,7 @@ void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsSpecObject(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HHasInstanceTypeAndBranch* result =
@@ -11342,7 +11342,7 @@ void HOptimizedGraphBuilder::GenerateIsSpecObject(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HHasInstanceTypeAndBranch* result =
@@ -11352,7 +11352,7 @@ void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsMinusZero(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HCompareMinusZeroAndBranch* result = New<HCompareMinusZeroAndBranch>(value);
@@ -11361,7 +11361,7 @@ void HOptimizedGraphBuilder::GenerateIsMinusZero(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateHasCachedArrayIndex(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HHasCachedArrayIndexAndBranch* result =
@@ -11371,7 +11371,7 @@ void HOptimizedGraphBuilder::GenerateHasCachedArrayIndex(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsArray(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HHasInstanceTypeAndBranch* result =
@@ -11381,7 +11381,7 @@ void HOptimizedGraphBuilder::GenerateIsArray(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsRegExp(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HHasInstanceTypeAndBranch* result =
@@ -11391,7 +11391,7 @@ void HOptimizedGraphBuilder::GenerateIsRegExp(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsObject(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HIsObjectAndBranch* result = New<HIsObjectAndBranch>(value);
@@ -11405,7 +11405,7 @@ void HOptimizedGraphBuilder::GenerateIsNonNegativeSmi(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateIsUndetectableObject(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HIsUndetectableAndBranch* result = New<HIsUndetectableAndBranch>(value);
@@ -11421,7 +11421,7 @@ void HOptimizedGraphBuilder::GenerateIsStringWrapperSafeForDefaultValueOf(
// Support for construct call checks.
void HOptimizedGraphBuilder::GenerateIsConstructCall(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 0);
+ DCHECK(call->arguments()->length() == 0);
if (function_state()->outer() != NULL) {
// We are generating graph for inlined function.
HValue* value = function_state()->inlining_kind() == CONSTRUCT_CALL_RETURN
@@ -11437,7 +11437,7 @@ void HOptimizedGraphBuilder::GenerateIsConstructCall(CallRuntime* call) {
// Support for arguments.length and arguments[?].
void HOptimizedGraphBuilder::GenerateArgumentsLength(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 0);
+ DCHECK(call->arguments()->length() == 0);
HInstruction* result = NULL;
if (function_state()->outer() == NULL) {
HInstruction* elements = Add<HArgumentsElements>(false);
@@ -11453,7 +11453,7 @@ void HOptimizedGraphBuilder::GenerateArgumentsLength(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateArguments(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* index = Pop();
HInstruction* result = NULL;
@@ -11486,7 +11486,7 @@ void HOptimizedGraphBuilder::GenerateClassOf(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateValueOf(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* object = Pop();
@@ -11514,8 +11514,8 @@ void HOptimizedGraphBuilder::GenerateValueOf(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 2);
- ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral());
+ DCHECK(call->arguments()->length() == 2);
+ DCHECK_NE(NULL, call->arguments()->at(1)->AsLiteral());
Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value()));
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* date = Pop();
@@ -11526,7 +11526,7 @@ void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateOneByteSeqStringSetChar(
CallRuntime* call) {
- ASSERT(call->arguments()->length() == 3);
+ DCHECK(call->arguments()->length() == 3);
// We need to follow the evaluation order of full codegen.
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(2)));
@@ -11543,7 +11543,7 @@ void HOptimizedGraphBuilder::GenerateOneByteSeqStringSetChar(
void HOptimizedGraphBuilder::GenerateTwoByteSeqStringSetChar(
CallRuntime* call) {
- ASSERT(call->arguments()->length() == 3);
+ DCHECK(call->arguments()->length() == 3);
// We need to follow the evaluation order of full codegen.
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(2)));
@@ -11559,7 +11559,7 @@ void HOptimizedGraphBuilder::GenerateTwoByteSeqStringSetChar(
void HOptimizedGraphBuilder::GenerateSetValueOf(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 2);
+ DCHECK(call->arguments()->length() == 2);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* value = Pop();
@@ -11597,7 +11597,7 @@ void HOptimizedGraphBuilder::GenerateSetValueOf(CallRuntime* call) {
// Fast support for charCodeAt(n).
void HOptimizedGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 2);
+ DCHECK(call->arguments()->length() == 2);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* index = Pop();
@@ -11609,7 +11609,7 @@ void HOptimizedGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) {
// Fast support for string.charAt(n) and string[n].
void HOptimizedGraphBuilder::GenerateStringCharFromCode(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* char_code = Pop();
HInstruction* result = NewUncasted<HStringCharFromCode>(char_code);
@@ -11619,7 +11619,7 @@ void HOptimizedGraphBuilder::GenerateStringCharFromCode(CallRuntime* call) {
// Fast support for string.charAt(n) and string[n].
void HOptimizedGraphBuilder::GenerateStringCharAt(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 2);
+ DCHECK(call->arguments()->length() == 2);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* index = Pop();
@@ -11633,7 +11633,7 @@ void HOptimizedGraphBuilder::GenerateStringCharAt(CallRuntime* call) {
// Fast support for object equality testing.
void HOptimizedGraphBuilder::GenerateObjectEquals(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 2);
+ DCHECK(call->arguments()->length() == 2);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* right = Pop();
@@ -11646,7 +11646,7 @@ void HOptimizedGraphBuilder::GenerateObjectEquals(CallRuntime* call) {
// Fast support for StringAdd.
void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) {
- ASSERT_EQ(2, call->arguments()->length());
+ DCHECK_EQ(2, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* right = Pop();
@@ -11658,7 +11658,7 @@ void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) {
// Fast support for SubString.
void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) {
- ASSERT_EQ(3, call->arguments()->length());
+ DCHECK_EQ(3, call->arguments()->length());
CHECK_ALIVE(VisitExpressions(call->arguments()));
PushArgumentsFromEnvironment(call->arguments()->length());
HCallStub* result = New<HCallStub>(CodeStub::SubString, 3);
@@ -11668,7 +11668,7 @@ void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) {
// Fast support for StringCompare.
void HOptimizedGraphBuilder::GenerateStringCompare(CallRuntime* call) {
- ASSERT_EQ(2, call->arguments()->length());
+ DCHECK_EQ(2, call->arguments()->length());
CHECK_ALIVE(VisitExpressions(call->arguments()));
PushArgumentsFromEnvironment(call->arguments()->length());
HCallStub* result = New<HCallStub>(CodeStub::StringCompare, 2);
@@ -11678,7 +11678,7 @@ void HOptimizedGraphBuilder::GenerateStringCompare(CallRuntime* call) {
// Support for direct calls from JavaScript to native RegExp code.
void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) {
- ASSERT_EQ(4, call->arguments()->length());
+ DCHECK_EQ(4, call->arguments()->length());
CHECK_ALIVE(VisitExpressions(call->arguments()));
PushArgumentsFromEnvironment(call->arguments()->length());
HCallStub* result = New<HCallStub>(CodeStub::RegExpExec, 4);
@@ -11687,7 +11687,7 @@ void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateDoubleLo(CallRuntime* call) {
- ASSERT_EQ(1, call->arguments()->length());
+ DCHECK_EQ(1, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HInstruction* result = NewUncasted<HDoubleBits>(value, HDoubleBits::LOW);
@@ -11696,7 +11696,7 @@ void HOptimizedGraphBuilder::GenerateDoubleLo(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateDoubleHi(CallRuntime* call) {
- ASSERT_EQ(1, call->arguments()->length());
+ DCHECK_EQ(1, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HInstruction* result = NewUncasted<HDoubleBits>(value, HDoubleBits::HIGH);
@@ -11705,7 +11705,7 @@ void HOptimizedGraphBuilder::GenerateDoubleHi(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateConstructDouble(CallRuntime* call) {
- ASSERT_EQ(2, call->arguments()->length());
+ DCHECK_EQ(2, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* lo = Pop();
@@ -11717,7 +11717,7 @@ void HOptimizedGraphBuilder::GenerateConstructDouble(CallRuntime* call) {
// Construct a RegExp exec result with two in-object properties.
void HOptimizedGraphBuilder::GenerateRegExpConstructResult(CallRuntime* call) {
- ASSERT_EQ(3, call->arguments()->length());
+ DCHECK_EQ(3, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(2)));
@@ -11737,7 +11737,7 @@ void HOptimizedGraphBuilder::GenerateGetFromCache(CallRuntime* call) {
// Fast support for number to string.
void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
- ASSERT_EQ(1, call->arguments()->length());
+ DCHECK_EQ(1, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* number = Pop();
HValue* result = BuildNumberToString(number, Type::Any(zone()));
@@ -11749,7 +11749,7 @@ void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) {
// 1 ~ The function to call is not itself an argument to the call.
int arg_count = call->arguments()->length() - 1;
- ASSERT(arg_count >= 1); // There's always at least a receiver.
+ DCHECK(arg_count >= 1); // There's always at least a receiver.
CHECK_ALIVE(VisitExpressions(call->arguments()));
// The function is the last argument
@@ -11793,7 +11793,7 @@ void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) {
// Fast call to math functions.
void HOptimizedGraphBuilder::GenerateMathPow(CallRuntime* call) {
- ASSERT_EQ(2, call->arguments()->length());
+ DCHECK_EQ(2, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
HValue* right = Pop();
@@ -11804,7 +11804,7 @@ void HOptimizedGraphBuilder::GenerateMathPow(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateMathLogRT(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HInstruction* result = NewUncasted<HUnaryMathOperation>(value, kMathLog);
@@ -11813,7 +11813,7 @@ void HOptimizedGraphBuilder::GenerateMathLogRT(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateMathSqrtRT(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HInstruction* result = NewUncasted<HUnaryMathOperation>(value, kMathSqrt);
@@ -11822,7 +11822,7 @@ void HOptimizedGraphBuilder::GenerateMathSqrtRT(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateGetCachedArrayIndex(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 1);
+ DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HGetCachedArrayIndex* result = New<HGetCachedArrayIndex>(value);
@@ -11854,7 +11854,7 @@ void HOptimizedGraphBuilder::GenerateDebugBreakInOptimizedCode(
void HOptimizedGraphBuilder::GenerateDebugIsActive(CallRuntime* call) {
- ASSERT(call->arguments()->length() == 0);
+ DCHECK(call->arguments()->length() == 0);
HValue* ref =
Add<HConstant>(ExternalReference::debug_is_active_address(isolate()));
HValue* value = Add<HLoadNamedField>(
@@ -11971,8 +11971,8 @@ void HEnvironment::Initialize(const HEnvironment* other) {
void HEnvironment::AddIncomingEdge(HBasicBlock* block, HEnvironment* other) {
- ASSERT(!block->IsLoopHeader());
- ASSERT(values_.length() == other->values_.length());
+ DCHECK(!block->IsLoopHeader());
+ DCHECK(values_.length() == other->values_.length());
int length = values_.length();
for (int i = 0; i < length; ++i) {
@@ -11981,12 +11981,12 @@ void HEnvironment::AddIncomingEdge(HBasicBlock* block, HEnvironment* other) {
// There is already a phi for the i'th value.
HPhi* phi = HPhi::cast(value);
// Assert index is correct and that we haven't missed an incoming edge.
- ASSERT(phi->merged_index() == i || !phi->HasMergedIndex());
- ASSERT(phi->OperandCount() == block->predecessors()->length());
+ DCHECK(phi->merged_index() == i || !phi->HasMergedIndex());
+ DCHECK(phi->OperandCount() == block->predecessors()->length());
phi->AddInput(other->values_[i]);
} else if (values_[i] != other->values_[i]) {
// There is a fresh value on the incoming edge, a phi is needed.
- ASSERT(values_[i] != NULL && other->values_[i] != NULL);
+ DCHECK(values_[i] != NULL && other->values_[i] != NULL);
HPhi* phi = block->AddNewPhi(i);
HValue* old_value = values_[i];
for (int j = 0; j < block->predecessors()->length(); j++) {
@@ -12000,7 +12000,7 @@ void HEnvironment::AddIncomingEdge(HBasicBlock* block, HEnvironment* other) {
void HEnvironment::Bind(int index, HValue* value) {
- ASSERT(value != NULL);
+ DCHECK(value != NULL);
assigned_variables_.Add(index, zone());
values_[index] = value;
}
@@ -12012,7 +12012,7 @@ bool HEnvironment::HasExpressionAt(int index) const {
bool HEnvironment::ExpressionStackIsEmpty() const {
- ASSERT(length() >= first_expression_index());
+ DCHECK(length() >= first_expression_index());
return length() == first_expression_index();
}
@@ -12020,7 +12020,7 @@ bool HEnvironment::ExpressionStackIsEmpty() const {
void HEnvironment::SetExpressionStackAt(int index_from_top, HValue* value) {
int count = index_from_top + 1;
int index = values_.length() - count;
- ASSERT(HasExpressionAt(index));
+ DCHECK(HasExpressionAt(index));
// The push count must include at least the element in question or else
// the new value will not be included in this environment's history.
if (push_count_ < count) {
@@ -12084,7 +12084,7 @@ HEnvironment* HEnvironment::CopyForInlining(
FunctionLiteral* function,
HConstant* undefined,
InliningKind inlining_kind) const {
- ASSERT(frame_type() == JS_FUNCTION);
+ DCHECK(frame_type() == JS_FUNCTION);
// Outer environment is a copy of this one without the arguments.
int arity = function->scope()->num_parameters();
@@ -12172,7 +12172,7 @@ void HTracer::TraceCompilation(CompilationInfo* info) {
void HTracer::TraceLithium(const char* name, LChunk* chunk) {
- ASSERT(!chunk->isolate()->concurrent_recompilation_enabled());
+ DCHECK(!chunk->isolate()->concurrent_recompilation_enabled());
AllowHandleDereference allow_deref;
AllowDeferredHandleDereference allow_deferred_deref;
Trace(name, chunk->graph(), chunk);
@@ -12180,7 +12180,7 @@ void HTracer::TraceLithium(const char* name, LChunk* chunk) {
void HTracer::TraceHydrogen(const char* name, HGraph* graph) {
- ASSERT(!graph->isolate()->concurrent_recompilation_enabled());
+ DCHECK(!graph->isolate()->concurrent_recompilation_enabled());
AllowHandleDereference allow_deref;
AllowDeferredHandleDereference allow_deferred_deref;
Trace(name, graph, NULL);
@@ -12348,7 +12348,7 @@ void HTracer::TraceLiveRange(LiveRange* range, const char* type,
trace_.Add(" \"%s\"",
DoubleRegister::AllocationIndexToString(assigned_reg));
} else {
- ASSERT(op->IsRegister());
+ DCHECK(op->IsRegister());
trace_.Add(" \"%s\"", Register::AllocationIndexToString(assigned_reg));
}
} else if (range->IsSpilled()) {
@@ -12356,7 +12356,7 @@ void HTracer::TraceLiveRange(LiveRange* range, const char* type,
if (op->IsDoubleStackSlot()) {
trace_.Add(" \"double_stack:%d\"", op->index());
} else {
- ASSERT(op->IsStackSlot());
+ DCHECK(op->IsStackSlot());
trace_.Add(" \"stack:%d\"", op->index());
}
}
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-bce.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698