| 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 "compiler.h" |
| 33 #include "register-allocator-inl.h" | 34 #include "register-allocator-inl.h" |
| 34 | 35 |
| 35 #if V8_TARGET_ARCH_IA32 | 36 #if V8_TARGET_ARCH_IA32 |
| 36 #include "ia32/codegen-ia32-inl.h" | 37 #include "ia32/codegen-ia32-inl.h" |
| 37 #elif V8_TARGET_ARCH_X64 | 38 #elif V8_TARGET_ARCH_X64 |
| 38 #include "x64/codegen-x64-inl.h" | 39 #include "x64/codegen-x64-inl.h" |
| 39 #elif V8_TARGET_ARCH_ARM | 40 #elif V8_TARGET_ARCH_ARM |
| 40 #include "arm/codegen-arm-inl.h" | 41 #include "arm/codegen-arm-inl.h" |
| 42 #elif V8_TARGET_ARCH_MIPS |
| 43 #include "mips/codegen-mips-inl.h" |
| 41 #else | 44 #else |
| 42 #error Unsupported target architecture. | 45 #error Unsupported target architecture. |
| 43 #endif | 46 #endif |
| 44 | 47 |
| 45 | 48 |
| 46 namespace v8 { | 49 namespace v8 { |
| 47 namespace internal { | 50 namespace internal { |
| 48 | 51 |
| 49 #define __ ACCESS_MASM(masm_) | 52 Handle<Script> CodeGenerator::script() { return info_->script(); } |
| 50 | 53 bool CodeGenerator::is_eval() { return info_->is_eval(); } |
| 51 // ----------------------------------------------------------------------------- | |
| 52 // Support for "structured" code comments. | |
| 53 // | |
| 54 // By selecting matching brackets in disassembler output, | |
| 55 // code segments can be identified more easily. | |
| 56 | |
| 57 #ifdef DEBUG | |
| 58 | |
| 59 class Comment BASE_EMBEDDED { | |
| 60 public: | |
| 61 Comment(MacroAssembler* masm, const char* msg) : masm_(masm), msg_(msg) { | |
| 62 __ RecordComment(msg); | |
| 63 } | |
| 64 | |
| 65 ~Comment() { | |
| 66 if (msg_[0] == '[') __ RecordComment("]"); | |
| 67 } | |
| 68 | |
| 69 private: | |
| 70 MacroAssembler* masm_; | |
| 71 const char* msg_; | |
| 72 }; | |
| 73 | |
| 74 #else | |
| 75 | |
| 76 class Comment BASE_EMBEDDED { | |
| 77 public: | |
| 78 Comment(MacroAssembler*, const char*) {} | |
| 79 }; | |
| 80 | |
| 81 #endif // DEBUG | |
| 82 | |
| 83 #undef __ | |
| 84 | |
| 85 | 54 |
| 86 } } // namespace v8::internal | 55 } } // namespace v8::internal |
| 87 | 56 |
| 88 #endif // V8_CODEGEN_INL_H_ | 57 #endif // V8_CODEGEN_INL_H_ |
| OLD | NEW |