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

Side by Side Diff: src/deoptimizer.h

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DCHECK 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 DCHECK. 496 // when using a plain DCHECK.
497 if (n >= ARRAY_SIZE(registers_)) { 497 if (n >= arraysize(registers_)) {
498 DCHECK(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 DCHECK(n < ARRAY_SIZE(double_registers_)); 506 DCHECK(n < arraysize(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 DCHECK(n < ARRAY_SIZE(registers_)); 511 DCHECK(n < arraysize(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 DCHECK(n < ARRAY_SIZE(double_registers_)); 516 DCHECK(n < arraysize(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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
« src/base/macros.h ('K') | « src/debug.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698