| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 #ifndef V8_CODEGEN_INL_H_ | 29 #ifndef V8_CODEGEN_INL_H_ |
| 30 #define V8_CODEGEN_INL_H_ | 30 #define V8_CODEGEN_INL_H_ |
| 31 | 31 |
| 32 #include "codegen.h" | 32 #include "codegen.h" |
| 33 #include "virtual-frame.h" |
| 33 | 34 |
| 34 namespace v8 { namespace internal { | 35 namespace v8 { namespace internal { |
| 35 | 36 |
| 36 | 37 |
| 38 void CodeGenerator::LoadAndSpill(Expression* expression, |
| 39 TypeofState typeof_state) { |
| 40 ASSERT(in_spilled_code()); |
| 41 #ifdef DEBUG |
| 42 set_in_spilled_code(false); |
| 43 #endif |
| 44 |
| 45 Load(expression, typeof_state); |
| 46 frame_->SpillAll(); |
| 47 |
| 48 #ifdef DEBUG |
| 49 set_in_spilled_code(true); |
| 50 #endif |
| 51 } |
| 52 |
| 53 |
| 54 void CodeGenerator::VisitAndSpill(Statement* statement) { |
| 55 ASSERT(in_spilled_code()); |
| 56 #ifdef DEBUG |
| 57 set_in_spilled_code(false); |
| 58 #endif |
| 59 |
| 60 Visit(statement); |
| 61 if (frame_ != NULL) { |
| 62 frame_->SpillAll(); |
| 63 } |
| 64 |
| 65 #ifdef DEBUG |
| 66 set_in_spilled_code(true); |
| 67 #endif |
| 68 } |
| 69 |
| 70 |
| 71 void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) { |
| 72 ASSERT(in_spilled_code()); |
| 73 #ifdef DEBUG |
| 74 set_in_spilled_code(false); |
| 75 #endif |
| 76 |
| 77 VisitStatements(statements); |
| 78 if (frame_ != NULL) { |
| 79 frame_->SpillAll(); |
| 80 } |
| 81 |
| 82 #ifdef DEBUG |
| 83 set_in_spilled_code(true); |
| 84 #endif |
| 85 } |
| 86 |
| 87 |
| 37 // ----------------------------------------------------------------------------- | 88 // ----------------------------------------------------------------------------- |
| 38 // Support for "structured" code comments. | 89 // Support for "structured" code comments. |
| 39 // | 90 // |
| 40 // By selecting matching brackets in disassembler output, | 91 // By selecting matching brackets in disassembler output, |
| 41 // code segments can be identified more easily. | 92 // code segments can be identified more easily. |
| 42 | 93 |
| 43 #ifdef DEBUG | 94 #ifdef DEBUG |
| 44 | 95 |
| 45 class Comment BASE_EMBEDDED { | 96 class Comment BASE_EMBEDDED { |
| 46 public: | 97 public: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 public: | 117 public: |
| 67 Comment(MacroAssembler*, const char*) {} | 118 Comment(MacroAssembler*, const char*) {} |
| 68 }; | 119 }; |
| 69 | 120 |
| 70 #endif // DEBUG | 121 #endif // DEBUG |
| 71 | 122 |
| 72 | 123 |
| 73 } } // namespace v8::internal | 124 } } // namespace v8::internal |
| 74 | 125 |
| 75 #endif // V8_CODEGEN_INL_H_ | 126 #endif // V8_CODEGEN_INL_H_ |
| OLD | NEW |