| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Virtual frames | 179 // Virtual frames |
| 180 // | 180 // |
| 181 // The virtual frame is an abstraction of the physical stack frame. It | 181 // The virtual frame is an abstraction of the physical stack frame. It |
| 182 // encapsulates the parameters, frame-allocated locals, and the expression | 182 // encapsulates the parameters, frame-allocated locals, and the expression |
| 183 // stack. It supports push/pop operations on the expression stack, as well | 183 // stack. It supports push/pop operations on the expression stack, as well |
| 184 // as random access to the expression stack elements, locals, and | 184 // as random access to the expression stack elements, locals, and |
| 185 // parameters. | 185 // parameters. |
| 186 | 186 |
| 187 class VirtualFrame : public Malloced { | 187 class VirtualFrame : public Malloced { |
| 188 public: | 188 public: |
| 189 // A utility class to introduce a scope where the virtual frame is |
| 190 // expected to remain spilled. The constructor spills the code |
| 191 // generator's current frame, but no attempt is made to require it to stay |
| 192 // stay spilled. It is intended as documentation while the code generator |
| 193 // is being transformed. |
| 194 class SpilledScope BASE_EMBEDDED { |
| 195 public: |
| 196 explicit SpilledScope(CodeGenerator* cgen); |
| 197 |
| 198 ~SpilledScope(); |
| 199 |
| 200 private: |
| 201 CodeGenerator* cgen_; |
| 202 bool previous_state_; |
| 203 }; |
| 204 |
| 189 // Construct an initial virtual frame on entry to a JS function. | 205 // Construct an initial virtual frame on entry to a JS function. |
| 190 explicit VirtualFrame(CodeGenerator* cgen); | 206 explicit VirtualFrame(CodeGenerator* cgen); |
| 191 | 207 |
| 192 // Construct a virtual frame as a clone of an existing one. | 208 // Construct a virtual frame as a clone of an existing one. |
| 193 explicit VirtualFrame(VirtualFrame* original); | 209 explicit VirtualFrame(VirtualFrame* original); |
| 194 | 210 |
| 195 // The height of the virtual expression stack. | 211 // The height of the virtual expression stack. |
| 196 int height() const { | 212 int height() const { |
| 197 return elements_.length() - expression_base_index(); | 213 return elements_.length() - expression_base_index(); |
| 198 } | 214 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // This is because some new memory-to-register moves are | 491 // This is because some new memory-to-register moves are |
| 476 // created in order to break cycles of register moves. | 492 // created in order to break cycles of register moves. |
| 477 // Used in the implementation of MergeTo(). | 493 // Used in the implementation of MergeTo(). |
| 478 void MergeMoveRegistersToRegisters(VirtualFrame *expected); | 494 void MergeMoveRegistersToRegisters(VirtualFrame *expected); |
| 479 }; | 495 }; |
| 480 | 496 |
| 481 | 497 |
| 482 } } // namespace v8::internal | 498 } } // namespace v8::internal |
| 483 | 499 |
| 484 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 500 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |