ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | // Copyright 2006-2008 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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. |
| 27 | |
| 28 | #ifndef V8_MACRO_ASSEMBLER_H_ |
| 29 | #define V8_MACRO_ASSEMBLER_H_ |
| 30 | |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 31 | |
| 32 | // Helper types to make boolean flag easier to read at call-site. |
| 33 | enum InvokeFlag { |
| 34 | CALL_FUNCTION, |
| 35 | JUMP_FUNCTION |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | enum CodeLocation { |
| 40 | IN_JAVASCRIPT, |
| 41 | IN_JS_ENTRY, |
| 42 | IN_C_ENTRY |
| 43 | }; |
| 44 | |
| 45 | |
| 46 | enum HandlerType { |
| 47 | TRY_CATCH_HANDLER, |
| 48 | TRY_FINALLY_HANDLER, |
| 49 | JS_ENTRY_HANDLER |
| 50 | }; |
| 51 | |
| 52 | |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 53 | // Invalid depth in prototype chain. |
| 54 | const int kInvalidProtoDepth = -1; |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 55 | |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 56 | #if V8_TARGET_ARCH_IA32 |
| 57 | #include "assembler.h" |
| 58 | #include "ia32/assembler-ia32.h" |
| 59 | #include "ia32/assembler-ia32-inl.h" |
| 60 | #include "code.h" // must be after assembler_*.h |
| 61 | #include "ia32/macro-assembler-ia32.h" |
| 62 | #elif V8_TARGET_ARCH_X64 |
| 63 | #include "assembler.h" |
| 64 | #include "x64/assembler-x64.h" |
| 65 | #include "x64/assembler-x64-inl.h" |
| 66 | #include "code.h" // must be after assembler_*.h |
| 67 | #include "x64/macro-assembler-x64.h" |
| 68 | #elif V8_TARGET_ARCH_ARM |
ager@chromium.org | 3a37e9b | 2009-04-27 09:26:21 +0000 | [diff] [blame] | 69 | #include "arm/constants-arm.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 70 | #include "assembler.h" |
ager@chromium.org | 3a37e9b | 2009-04-27 09:26:21 +0000 | [diff] [blame] | 71 | #include "arm/assembler-arm.h" |
| 72 | #include "arm/assembler-arm-inl.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 73 | #include "code.h" // must be after assembler_*.h |
ager@chromium.org | 3a37e9b | 2009-04-27 09:26:21 +0000 | [diff] [blame] | 74 | #include "arm/macro-assembler-arm.h" |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 75 | #elif V8_TARGET_ARCH_MIPS |
| 76 | #include "mips/constants-mips.h" |
| 77 | #include "assembler.h" |
| 78 | #include "mips/assembler-mips.h" |
| 79 | #include "mips/assembler-mips-inl.h" |
| 80 | #include "code.h" // must be after assembler_*.h |
| 81 | #include "mips/macro-assembler-mips.h" |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 82 | #else |
| 83 | #error Unsupported target architecture. |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 84 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 85 | |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 86 | namespace v8 { |
| 87 | namespace internal { |
| 88 | |
| 89 | // Support for "structured" code comments. |
| 90 | #ifdef DEBUG |
| 91 | |
| 92 | class Comment { |
| 93 | public: |
| 94 | Comment(MacroAssembler* masm, const char* msg); |
| 95 | ~Comment(); |
| 96 | |
| 97 | private: |
| 98 | MacroAssembler* masm_; |
| 99 | const char* msg_; |
| 100 | }; |
| 101 | |
| 102 | #else |
| 103 | |
| 104 | class Comment { |
| 105 | public: |
| 106 | Comment(MacroAssembler*, const char*) {} |
| 107 | }; |
| 108 | |
| 109 | #endif // DEBUG |
| 110 | |
| 111 | } } // namespace v8::internal |
| 112 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 113 | #endif // V8_MACRO_ASSEMBLER_H_ |