| 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 14 matching lines...) Expand all Loading... |
| 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 "register-allocator-inl.h" | 33 #include "register-allocator-inl.h" |
| 34 | 34 |
| 35 #if V8_TARGET_ARCH_IA32 |
| 36 #include "ia32/codegen-ia32-inl.h" |
| 37 #elif V8_TARGET_ARCH_X64 |
| 38 #include "x64/codegen-x64-inl.h" |
| 39 #elif V8_TARGET_ARCH_ARM |
| 40 #include "arm/codegen-arm-inl.h" |
| 41 #else |
| 42 #error Unsupported target architecture. |
| 43 #endif |
| 44 |
| 45 |
| 35 namespace v8 { | 46 namespace v8 { |
| 36 namespace internal { | 47 namespace internal { |
| 37 | 48 |
| 38 | 49 #define __ ACCESS_MASM(masm_) |
| 39 void DeferredCode::SetEntryFrame(Result* arg) { | |
| 40 ASSERT(cgen()->has_valid_frame()); | |
| 41 cgen()->frame()->Push(arg); | |
| 42 enter()->set_entry_frame(new VirtualFrame(cgen()->frame())); | |
| 43 *arg = cgen()->frame()->Pop(); | |
| 44 } | |
| 45 | |
| 46 | |
| 47 void DeferredCode::SetEntryFrame(Result* arg0, Result* arg1) { | |
| 48 ASSERT(cgen()->has_valid_frame()); | |
| 49 cgen()->frame()->Push(arg0); | |
| 50 cgen()->frame()->Push(arg1); | |
| 51 enter()->set_entry_frame(new VirtualFrame(cgen()->frame())); | |
| 52 *arg1 = cgen()->frame()->Pop(); | |
| 53 *arg0 = cgen()->frame()->Pop(); | |
| 54 } | |
| 55 | |
| 56 | 50 |
| 57 // ----------------------------------------------------------------------------- | 51 // ----------------------------------------------------------------------------- |
| 58 // Support for "structured" code comments. | 52 // Support for "structured" code comments. |
| 59 // | 53 // |
| 60 // By selecting matching brackets in disassembler output, | 54 // By selecting matching brackets in disassembler output, |
| 61 // code segments can be identified more easily. | 55 // code segments can be identified more easily. |
| 62 | 56 |
| 63 #ifdef DEBUG | 57 #ifdef DEBUG |
| 64 | 58 |
| 65 class Comment BASE_EMBEDDED { | 59 class Comment BASE_EMBEDDED { |
| 66 public: | 60 public: |
| 67 Comment(MacroAssembler* masm, const char* msg) | 61 Comment(MacroAssembler* masm, const char* msg) : masm_(masm), msg_(msg) { |
| 68 : masm_(masm), | 62 __ RecordComment(msg); |
| 69 msg_(msg) { | |
| 70 masm_->RecordComment(msg); | |
| 71 } | 63 } |
| 72 | 64 |
| 73 ~Comment() { | 65 ~Comment() { |
| 74 if (msg_[0] == '[') | 66 if (msg_[0] == '[') __ RecordComment("]"); |
| 75 masm_->RecordComment("]"); | |
| 76 } | 67 } |
| 77 | 68 |
| 78 private: | 69 private: |
| 79 MacroAssembler* masm_; | 70 MacroAssembler* masm_; |
| 80 const char* msg_; | 71 const char* msg_; |
| 81 }; | 72 }; |
| 82 | 73 |
| 83 #else | 74 #else |
| 84 | 75 |
| 85 class Comment BASE_EMBEDDED { | 76 class Comment BASE_EMBEDDED { |
| 86 public: | 77 public: |
| 87 Comment(MacroAssembler*, const char*) {} | 78 Comment(MacroAssembler*, const char*) {} |
| 88 }; | 79 }; |
| 89 | 80 |
| 90 #endif // DEBUG | 81 #endif // DEBUG |
| 91 | 82 |
| 83 #undef __ |
| 84 |
| 92 | 85 |
| 93 } } // namespace v8::internal | 86 } } // namespace v8::internal |
| 94 | 87 |
| 95 #endif // V8_CODEGEN_INL_H_ | 88 #endif // V8_CODEGEN_INL_H_ |
| OLD | NEW |