| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 class VirtualFrame : public Malloced { | 44 class VirtualFrame : public Malloced { |
| 45 public: | 45 public: |
| 46 // A utility class to introduce a scope where the virtual frame is | 46 // A utility class to introduce a scope where the virtual frame is |
| 47 // expected to remain spilled. The constructor spills the code | 47 // expected to remain spilled. The constructor spills the code |
| 48 // generator's current frame, but no attempt is made to require it | 48 // generator's current frame, but no attempt is made to require it |
| 49 // to stay spilled. It is intended as documentation while the code | 49 // to stay spilled. It is intended as documentation while the code |
| 50 // generator is being transformed. | 50 // generator is being transformed. |
| 51 class SpilledScope BASE_EMBEDDED { | 51 class SpilledScope BASE_EMBEDDED { |
| 52 public: | 52 public: |
| 53 explicit SpilledScope(CodeGenerator* cgen); | 53 explicit SpilledScope(CodeGenerator* cgen) { |
| 54 #ifdef DEBUG |
| 55 cgen_ = cgen; |
| 56 previous_state_ = cgen->in_spilled_code(); |
| 57 cgen->set_in_spilled_code(true); |
| 58 #endif |
| 59 ASSERT(cgen->has_valid_frame()); |
| 60 cgen->frame()->SpillAll(); |
| 61 } |
| 54 | 62 |
| 55 ~SpilledScope(); | 63 ~SpilledScope() { |
| 64 #ifdef DEBUG |
| 65 cgen_->set_in_spilled_code(previous_state_); |
| 66 #endif |
| 67 } |
| 56 | 68 |
| 57 private: | 69 private: |
| 70 #ifdef DEBUG |
| 58 CodeGenerator* cgen_; | 71 CodeGenerator* cgen_; |
| 59 bool previous_state_; | 72 bool previous_state_; |
| 73 #endif |
| 60 }; | 74 }; |
| 61 | 75 |
| 62 // An illegal index into the virtual frame. | 76 // An illegal index into the virtual frame. |
| 63 static const int kIllegalIndex = -1; | 77 static const int kIllegalIndex = -1; |
| 64 | 78 |
| 65 // Construct an initial virtual frame on entry to a JS function. | 79 // Construct an initial virtual frame on entry to a JS function. |
| 66 explicit VirtualFrame(CodeGenerator* cgen); | 80 explicit VirtualFrame(CodeGenerator* cgen); |
| 67 | 81 |
| 68 // Construct a virtual frame as a clone of an existing one. | 82 // Construct a virtual frame as a clone of an existing one. |
| 69 explicit VirtualFrame(VirtualFrame* original); | 83 explicit VirtualFrame(VirtualFrame* original); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 485 |
| 472 bool Equals(VirtualFrame* other); | 486 bool Equals(VirtualFrame* other); |
| 473 | 487 |
| 474 friend class JumpTarget; | 488 friend class JumpTarget; |
| 475 }; | 489 }; |
| 476 | 490 |
| 477 | 491 |
| 478 } } // namespace v8::internal | 492 } } // namespace v8::internal |
| 479 | 493 |
| 480 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ | 494 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ |
| OLD | NEW |