Chromium Code Reviews| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 public: | 89 public: |
| 90 explicit DeferredCode(CodeGenerator* generator); | 90 explicit DeferredCode(CodeGenerator* generator); |
| 91 virtual ~DeferredCode() { } | 91 virtual ~DeferredCode() { } |
| 92 | 92 |
| 93 virtual void Generate() = 0; | 93 virtual void Generate() = 0; |
| 94 | 94 |
| 95 MacroAssembler* masm() const { return masm_; } | 95 MacroAssembler* masm() const { return masm_; } |
| 96 CodeGenerator* generator() const { return generator_; } | 96 CodeGenerator* generator() const { return generator_; } |
| 97 | 97 |
| 98 JumpTarget* enter() { return &enter_; } | 98 JumpTarget* enter() { return &enter_; } |
| 99 JumpTarget* exit() { return &exit_; } | 99 void BindExit() { exit_.Bind(0); } |
| 100 void BindExit(Result* result) { exit_.Bind(result, 1); } | |
| 101 void BindExit(Result* result0, Result* result1, Result* result2) { | |
| 102 exit_.Bind(result0, result1, result2, 3); | |
| 103 } | |
| 104 | |
| 105 // JumpTarget* exit() { return &exit_; } | |
|
Kasper Lund
2009/02/18 12:11:17
Remove?
Kevin Millikin (Chromium)
2009/02/18 12:26:22
Yes.
| |
| 100 | 106 |
| 101 int statement_position() const { return statement_position_; } | 107 int statement_position() const { return statement_position_; } |
| 102 int position() const { return position_; } | 108 int position() const { return position_; } |
| 103 | 109 |
| 104 #ifdef DEBUG | 110 #ifdef DEBUG |
| 105 void set_comment(const char* comment) { comment_ = comment; } | 111 void set_comment(const char* comment) { comment_ = comment; } |
| 106 const char* comment() const { return comment_; } | 112 const char* comment() const { return comment_; } |
| 107 #else | 113 #else |
| 108 inline void set_comment(const char* comment) { } | 114 inline void set_comment(const char* comment) { } |
| 109 const char* comment() const { return ""; } | 115 const char* comment() const { return ""; } |
| 110 #endif | 116 #endif |
| 111 | 117 |
| 112 protected: | 118 protected: |
| 113 // The masm_ field is manipulated when compiling stubs with the | 119 CodeGenerator* const generator_; |
| 114 // BEGIN_STUB and END_STUB macros. For that reason, it cannot be | 120 MacroAssembler* const masm_; |
| 115 // constant. | 121 JumpTarget enter_; |
| 116 MacroAssembler* masm_; | 122 JumpTarget exit_; |
| 117 | 123 |
| 118 private: | 124 private: |
| 119 CodeGenerator* const generator_; | |
| 120 JumpTarget enter_; | |
| 121 JumpTarget exit_; | |
| 122 int statement_position_; | 125 int statement_position_; |
| 123 int position_; | 126 int position_; |
| 124 #ifdef DEBUG | 127 #ifdef DEBUG |
| 125 const char* comment_; | 128 const char* comment_; |
| 126 #endif | 129 #endif |
| 127 DISALLOW_COPY_AND_ASSIGN(DeferredCode); | 130 DISALLOW_COPY_AND_ASSIGN(DeferredCode); |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 | 133 |
| 131 // RuntimeStub models code stubs calling entry points in the Runtime class. | 134 // RuntimeStub models code stubs calling entry points in the Runtime class. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 291 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
| 289 } | 292 } |
| 290 #endif | 293 #endif |
| 291 }; | 294 }; |
| 292 | 295 |
| 293 | 296 |
| 294 } // namespace internal | 297 } // namespace internal |
| 295 } // namespace v8 | 298 } // namespace v8 |
| 296 | 299 |
| 297 #endif // V8_CODEGEN_H_ | 300 #endif // V8_CODEGEN_H_ |
| OLD | NEW |