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

Side by Side Diff: src/deoptimizer.cc

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 if (type == EAGER || type == SOFT || type == LAZY) { 598 if (type == EAGER || type == SOFT || type == LAZY) {
599 DCHECK(compiled_code_->kind() != Code::FUNCTION); 599 DCHECK(compiled_code_->kind() != Code::FUNCTION);
600 } 600 }
601 #endif 601 #endif
602 602
603 StackFrame::Type frame_type = function == NULL 603 StackFrame::Type frame_type = function == NULL
604 ? StackFrame::STUB 604 ? StackFrame::STUB
605 : StackFrame::JAVA_SCRIPT; 605 : StackFrame::JAVA_SCRIPT;
606 trace_scope_ = TraceEnabledFor(type, frame_type) ? 606 trace_scope_ = TraceEnabledFor(type, frame_type) ?
607 new CodeTracer::Scope(isolate->GetCodeTracer()) : NULL; 607 new CodeTracer::Scope(isolate->GetCodeTracer()) : NULL;
608 #ifdef DEBUG 608 #if DCHECK_IS_ON
609 CHECK(AllowHeapAllocation::IsAllowed()); 609 DCHECK(AllowHeapAllocation::IsAllowed());
610 disallow_heap_allocation_ = new DisallowHeapAllocation(); 610 disallow_heap_allocation_ = new DisallowHeapAllocation();
611 #endif // DEBUG 611 #endif // DCHECK_IS_ON
612 unsigned size = ComputeInputFrameSize(); 612 unsigned size = ComputeInputFrameSize();
613 input_ = new(size) FrameDescription(size, function); 613 input_ = new(size) FrameDescription(size, function);
614 input_->SetFrameType(frame_type); 614 input_->SetFrameType(frame_type);
615 } 615 }
616 616
617 617
618 Code* Deoptimizer::FindOptimizedCode(JSFunction* function, 618 Code* Deoptimizer::FindOptimizedCode(JSFunction* function,
619 Code* optimized_code) { 619 Code* optimized_code) {
620 switch (bailout_type_) { 620 switch (bailout_type_) {
621 case Deoptimizer::SOFT: 621 case Deoptimizer::SOFT:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 653
654 654
655 void Deoptimizer::DeleteFrameDescriptions() { 655 void Deoptimizer::DeleteFrameDescriptions() {
656 delete input_; 656 delete input_;
657 for (int i = 0; i < output_count_; ++i) { 657 for (int i = 0; i < output_count_; ++i) {
658 if (output_[i] != input_) delete output_[i]; 658 if (output_[i] != input_) delete output_[i];
659 } 659 }
660 delete[] output_; 660 delete[] output_;
661 input_ = NULL; 661 input_ = NULL;
662 output_ = NULL; 662 output_ = NULL;
663 #ifdef DEBUG 663 #if DCHECK_IS_ON
664 CHECK(!AllowHeapAllocation::IsAllowed()); 664 DCHECK(!AllowHeapAllocation::IsAllowed());
665 CHECK(disallow_heap_allocation_ != NULL); 665 DCHECK(disallow_heap_allocation_ != NULL);
666 delete disallow_heap_allocation_; 666 delete disallow_heap_allocation_;
667 disallow_heap_allocation_ = NULL; 667 disallow_heap_allocation_ = NULL;
668 #endif // DEBUG 668 #endif // DCHECK_IS_ON
669 } 669 }
670 670
671 671
672 Address Deoptimizer::GetDeoptimizationEntry(Isolate* isolate, 672 Address Deoptimizer::GetDeoptimizationEntry(Isolate* isolate,
673 int id, 673 int id,
674 BailoutType type, 674 BailoutType type,
675 GetEntryMode mode) { 675 GetEntryMode mode) {
676 CHECK_GE(id, 0); 676 CHECK_GE(id, 0);
677 if (id >= kMaxNumberOfEntries) return NULL; 677 if (id >= kMaxNumberOfEntries) return NULL;
678 if (mode == ENSURE_ENTRY_CODE) { 678 if (mode == ENSURE_ENTRY_CODE) {
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 3627
3628 3628
3629 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3629 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3630 v->VisitPointer(bit_cast<Object**>(&function_)); 3630 v->VisitPointer(bit_cast<Object**>(&function_));
3631 v->VisitPointer(&context_); 3631 v->VisitPointer(&context_);
3632 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3632 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3633 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3633 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3634 } 3634 }
3635 3635
3636 } } // namespace v8::internal 3636 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698