| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 class VirtualFrame : public ZoneObject { | 46 class VirtualFrame : public ZoneObject { |
| 47 public: | 47 public: |
| 48 // A utility class to introduce a scope where the virtual frame is | 48 // A utility class to introduce a scope where the virtual frame is |
| 49 // expected to remain spilled. The constructor spills the code | 49 // expected to remain spilled. The constructor spills the code |
| 50 // generator's current frame, but no attempt is made to require it | 50 // generator's current frame, but no attempt is made to require it |
| 51 // to stay spilled. It is intended as documentation while the code | 51 // to stay spilled. It is intended as documentation while the code |
| 52 // generator is being transformed. | 52 // generator is being transformed. |
| 53 class SpilledScope BASE_EMBEDDED { | 53 class SpilledScope BASE_EMBEDDED { |
| 54 public: | 54 public: |
| 55 SpilledScope() : previous_state_(cgen()->in_spilled_code()) { | 55 SpilledScope() {} |
| 56 ASSERT(cgen()->has_valid_frame()); | |
| 57 cgen()->frame()->SpillAll(); | |
| 58 cgen()->set_in_spilled_code(true); | |
| 59 } | |
| 60 | |
| 61 ~SpilledScope() { | |
| 62 cgen()->set_in_spilled_code(previous_state_); | |
| 63 } | |
| 64 | |
| 65 private: | |
| 66 bool previous_state_; | |
| 67 | |
| 68 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } | |
| 69 }; | 56 }; |
| 70 | 57 |
| 71 // An illegal index into the virtual frame. | 58 // An illegal index into the virtual frame. |
| 72 static const int kIllegalIndex = -1; | 59 static const int kIllegalIndex = -1; |
| 73 | 60 |
| 74 // Construct an initial virtual frame on entry to a JS function. | 61 // Construct an initial virtual frame on entry to a JS function. |
| 75 VirtualFrame(); | 62 VirtualFrame(); |
| 76 | 63 |
| 77 // Construct a virtual frame as a clone of an existing one. | 64 // Construct a virtual frame as a clone of an existing one. |
| 78 explicit VirtualFrame(VirtualFrame* original); | 65 explicit VirtualFrame(VirtualFrame* original); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 514 |
| 528 // Classes that need raw access to the elements_ array. | 515 // Classes that need raw access to the elements_ array. |
| 529 friend class DeferredCode; | 516 friend class DeferredCode; |
| 530 friend class JumpTarget; | 517 friend class JumpTarget; |
| 531 }; | 518 }; |
| 532 | 519 |
| 533 | 520 |
| 534 } } // namespace v8::internal | 521 } } // namespace v8::internal |
| 535 | 522 |
| 536 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ | 523 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ |
| OLD | NEW |