Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 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 | |
| 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 | |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 53 | // Invalid depth in prototype chain. |
| 54 | const int kInvalidProtoDepth = -1; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 55 | |
| 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 |
| 69 | #include "arm/constants-arm.h" |
| 70 | #include "assembler.h" |
| 71 | #include "arm/assembler-arm.h" |
| 72 | #include "arm/assembler-arm-inl.h" |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 73 | #include "code.h" // must be after assembler_*.h |
| 74 | #include "arm/macro-assembler-arm.h" |
Andrei Popescu | 3100271 | 2010-02-23 13:46:05 +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" |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 82 | #else |
| 83 | #error Unsupported target architecture. |
| 84 | #endif |
| 85 | |
Kristian Monsen | 80d68ea | 2010-09-08 11:05:35 +0100 | [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 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 113 | #endif // V8_MACRO_ASSEMBLER_H_ |