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

Side by Side Diff: src/deoptimizer.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_DEOPTIMIZER_H_ 5 #ifndef V8_DEOPTIMIZER_H_
6 #define V8_DEOPTIMIZER_H_ 6 #define V8_DEOPTIMIZER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 void operator delete(void* pointer, uint32_t frame_size) { 456 void operator delete(void* pointer, uint32_t frame_size) {
457 free(pointer); 457 free(pointer);
458 } 458 }
459 459
460 void operator delete(void* description) { 460 void operator delete(void* description) {
461 free(description); 461 free(description);
462 } 462 }
463 463
464 uint32_t GetFrameSize() const { 464 uint32_t GetFrameSize() const {
465 ASSERT(static_cast<uint32_t>(frame_size_) == frame_size_); 465 DCHECK(static_cast<uint32_t>(frame_size_) == frame_size_);
466 return static_cast<uint32_t>(frame_size_); 466 return static_cast<uint32_t>(frame_size_);
467 } 467 }
468 468
469 JSFunction* GetFunction() const { return function_; } 469 JSFunction* GetFunction() const { return function_; }
470 470
471 unsigned GetOffsetFromSlotIndex(int slot_index); 471 unsigned GetOffsetFromSlotIndex(int slot_index);
472 472
473 intptr_t GetFrameSlot(unsigned offset) { 473 intptr_t GetFrameSlot(unsigned offset) {
474 return *GetFrameSlotPointer(offset); 474 return *GetFrameSlotPointer(offset);
475 } 475 }
476 476
477 double GetDoubleFrameSlot(unsigned offset) { 477 double GetDoubleFrameSlot(unsigned offset) {
478 intptr_t* ptr = GetFrameSlotPointer(offset); 478 intptr_t* ptr = GetFrameSlotPointer(offset);
479 return read_double_value(reinterpret_cast<Address>(ptr)); 479 return read_double_value(reinterpret_cast<Address>(ptr));
480 } 480 }
481 481
482 void SetFrameSlot(unsigned offset, intptr_t value) { 482 void SetFrameSlot(unsigned offset, intptr_t value) {
483 *GetFrameSlotPointer(offset) = value; 483 *GetFrameSlotPointer(offset) = value;
484 } 484 }
485 485
486 void SetCallerPc(unsigned offset, intptr_t value); 486 void SetCallerPc(unsigned offset, intptr_t value);
487 487
488 void SetCallerFp(unsigned offset, intptr_t value); 488 void SetCallerFp(unsigned offset, intptr_t value);
489 489
490 void SetCallerConstantPool(unsigned offset, intptr_t value); 490 void SetCallerConstantPool(unsigned offset, intptr_t value);
491 491
492 intptr_t GetRegister(unsigned n) const { 492 intptr_t GetRegister(unsigned n) const {
493 #if DEBUG 493 #if DEBUG
494 // This convoluted ASSERT is needed to work around a gcc problem that 494 // This convoluted DCHECK is needed to work around a gcc problem that
495 // improperly detects an array bounds overflow in optimized debug builds 495 // improperly detects an array bounds overflow in optimized debug builds
496 // when using a plain ASSERT. 496 // when using a plain DCHECK.
497 if (n >= ARRAY_SIZE(registers_)) { 497 if (n >= ARRAY_SIZE(registers_)) {
498 ASSERT(false); 498 DCHECK(false);
499 return 0; 499 return 0;
500 } 500 }
501 #endif 501 #endif
502 return registers_[n]; 502 return registers_[n];
503 } 503 }
504 504
505 double GetDoubleRegister(unsigned n) const { 505 double GetDoubleRegister(unsigned n) const {
506 ASSERT(n < ARRAY_SIZE(double_registers_)); 506 DCHECK(n < ARRAY_SIZE(double_registers_));
507 return double_registers_[n]; 507 return double_registers_[n];
508 } 508 }
509 509
510 void SetRegister(unsigned n, intptr_t value) { 510 void SetRegister(unsigned n, intptr_t value) {
511 ASSERT(n < ARRAY_SIZE(registers_)); 511 DCHECK(n < ARRAY_SIZE(registers_));
512 registers_[n] = value; 512 registers_[n] = value;
513 } 513 }
514 514
515 void SetDoubleRegister(unsigned n, double value) { 515 void SetDoubleRegister(unsigned n, double value) {
516 ASSERT(n < ARRAY_SIZE(double_registers_)); 516 DCHECK(n < ARRAY_SIZE(double_registers_));
517 double_registers_[n] = value; 517 double_registers_[n] = value;
518 } 518 }
519 519
520 intptr_t GetTop() const { return top_; } 520 intptr_t GetTop() const { return top_; }
521 void SetTop(intptr_t top) { top_ = top; } 521 void SetTop(intptr_t top) { top_ = top; }
522 522
523 intptr_t GetPc() const { return pc_; } 523 intptr_t GetPc() const { return pc_; }
524 void SetPc(intptr_t pc) { pc_ = pc; } 524 void SetPc(intptr_t pc) { pc_ = pc; }
525 525
526 intptr_t GetFp() const { return fp_; } 526 intptr_t GetFp() const { return fp_; }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 // Continuation is the PC where the execution continues after 603 // Continuation is the PC where the execution continues after
604 // deoptimizing. 604 // deoptimizing.
605 intptr_t continuation_; 605 intptr_t continuation_;
606 606
607 // This must be at the end of the object as the object is allocated larger 607 // This must be at the end of the object as the object is allocated larger
608 // than it's definition indicate to extend this array. 608 // than it's definition indicate to extend this array.
609 intptr_t frame_content_[1]; 609 intptr_t frame_content_[1];
610 610
611 intptr_t* GetFrameSlotPointer(unsigned offset) { 611 intptr_t* GetFrameSlotPointer(unsigned offset) {
612 ASSERT(offset < frame_size_); 612 DCHECK(offset < frame_size_);
613 return reinterpret_cast<intptr_t*>( 613 return reinterpret_cast<intptr_t*>(
614 reinterpret_cast<Address>(this) + frame_content_offset() + offset); 614 reinterpret_cast<Address>(this) + frame_content_offset() + offset);
615 } 615 }
616 616
617 int ComputeFixedSize(); 617 int ComputeFixedSize();
618 }; 618 };
619 619
620 620
621 class DeoptimizerData { 621 class DeoptimizerData {
622 public: 622 public:
(...skipping 28 matching lines...) Expand all
651 651
652 private: 652 private:
653 ZoneList<uint8_t> contents_; 653 ZoneList<uint8_t> contents_;
654 }; 654 };
655 655
656 656
657 class TranslationIterator BASE_EMBEDDED { 657 class TranslationIterator BASE_EMBEDDED {
658 public: 658 public:
659 TranslationIterator(ByteArray* buffer, int index) 659 TranslationIterator(ByteArray* buffer, int index)
660 : buffer_(buffer), index_(index) { 660 : buffer_(buffer), index_(index) {
661 ASSERT(index >= 0 && index < buffer->length()); 661 DCHECK(index >= 0 && index < buffer->length());
662 } 662 }
663 663
664 int32_t Next(); 664 int32_t Next();
665 665
666 bool HasNext() const { return index_ < buffer_->length(); } 666 bool HasNext() const { return index_ < buffer_->length(); }
667 667
668 void Skip(int n) { 668 void Skip(int n) {
669 for (int i = 0; i < n; i++) Next(); 669 for (int i = 0; i < n; i++) Next();
670 } 670 }
671 671
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 } 923 }
924 924
925 // Check if this frame is preceded by construct stub frame. The bottom-most 925 // Check if this frame is preceded by construct stub frame. The bottom-most
926 // inlined frame might still be called by an uninlined construct stub. 926 // inlined frame might still be called by an uninlined construct stub.
927 bool HasConstructStub() { 927 bool HasConstructStub() {
928 return has_construct_stub_; 928 return has_construct_stub_;
929 } 929 }
930 930
931 // Get an incoming argument. 931 // Get an incoming argument.
932 Object* GetParameter(int index) { 932 Object* GetParameter(int index) {
933 ASSERT(0 <= index && index < parameters_count()); 933 DCHECK(0 <= index && index < parameters_count());
934 return parameters_[index]; 934 return parameters_[index];
935 } 935 }
936 936
937 // Get an expression from the expression stack. 937 // Get an expression from the expression stack.
938 Object* GetExpression(int index) { 938 Object* GetExpression(int index) {
939 ASSERT(0 <= index && index < expression_count()); 939 DCHECK(0 <= index && index < expression_count());
940 return expression_stack_[index]; 940 return expression_stack_[index];
941 } 941 }
942 942
943 int GetSourcePosition() { 943 int GetSourcePosition() {
944 return source_position_; 944 return source_position_;
945 } 945 }
946 946
947 private: 947 private:
948 // Set an incoming argument. 948 // Set an incoming argument.
949 void SetParameter(int index, Object* obj) { 949 void SetParameter(int index, Object* obj) {
950 ASSERT(0 <= index && index < parameters_count()); 950 DCHECK(0 <= index && index < parameters_count());
951 parameters_[index] = obj; 951 parameters_[index] = obj;
952 } 952 }
953 953
954 // Set an expression on the expression stack. 954 // Set an expression on the expression stack.
955 void SetExpression(int index, Object* obj) { 955 void SetExpression(int index, Object* obj) {
956 ASSERT(0 <= index && index < expression_count()); 956 DCHECK(0 <= index && index < expression_count());
957 expression_stack_[index] = obj; 957 expression_stack_[index] = obj;
958 } 958 }
959 959
960 JSFunction* function_; 960 JSFunction* function_;
961 bool has_construct_stub_; 961 bool has_construct_stub_;
962 int parameters_count_; 962 int parameters_count_;
963 int expression_count_; 963 int expression_count_;
964 Object** parameters_; 964 Object** parameters_;
965 Object** expression_stack_; 965 Object** expression_stack_;
966 int source_position_; 966 int source_position_;
967 967
968 friend class Deoptimizer; 968 friend class Deoptimizer;
969 }; 969 };
970 970
971 } } // namespace v8::internal 971 } } // namespace v8::internal
972 972
973 #endif // V8_DEOPTIMIZER_H_ 973 #endif // V8_DEOPTIMIZER_H_
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698