OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 void SetFrameSlot(unsigned offset, intptr_t value) { | 500 void SetFrameSlot(unsigned offset, intptr_t value) { |
501 *GetFrameSlotPointer(offset) = value; | 501 *GetFrameSlotPointer(offset) = value; |
502 } | 502 } |
503 | 503 |
504 void SetCallerPc(unsigned offset, intptr_t value); | 504 void SetCallerPc(unsigned offset, intptr_t value); |
505 | 505 |
506 void SetCallerFp(unsigned offset, intptr_t value); | 506 void SetCallerFp(unsigned offset, intptr_t value); |
507 | 507 |
508 intptr_t GetRegister(unsigned n) const { | 508 intptr_t GetRegister(unsigned n) const { |
509 ASSERT(n < ARRAY_SIZE(registers_)); | 509 #if DEBUG |
| 510 // This convoluted ASSERT is needed to work around a gcc problem that |
| 511 // improperly detects an array bounds overflow in optimized debug builds |
| 512 // when using a plain ASSERT. |
| 513 if (n >= ARRAY_SIZE(registers_)) { |
| 514 ASSERT(false); |
| 515 return 0; |
| 516 } |
| 517 #endif |
510 return registers_[n]; | 518 return registers_[n]; |
511 } | 519 } |
512 | 520 |
513 double GetDoubleRegister(unsigned n) const { | 521 double GetDoubleRegister(unsigned n) const { |
514 ASSERT(n < ARRAY_SIZE(double_registers_)); | 522 ASSERT(n < ARRAY_SIZE(double_registers_)); |
515 return double_registers_[n]; | 523 return double_registers_[n]; |
516 } | 524 } |
517 | 525 |
518 void SetRegister(unsigned n, intptr_t value) { | 526 void SetRegister(unsigned n, intptr_t value) { |
519 ASSERT(n < ARRAY_SIZE(registers_)); | 527 ASSERT(n < ARRAY_SIZE(registers_)); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 Object** expression_stack_; | 932 Object** expression_stack_; |
925 int source_position_; | 933 int source_position_; |
926 | 934 |
927 friend class Deoptimizer; | 935 friend class Deoptimizer; |
928 }; | 936 }; |
929 #endif | 937 #endif |
930 | 938 |
931 } } // namespace v8::internal | 939 } } // namespace v8::internal |
932 | 940 |
933 #endif // V8_DEOPTIMIZER_H_ | 941 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |