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 | |
| 53 | // Flags used for the AllocateInNewSpace functions. |
| 54 | enum AllocationFlags { |
| 55 | // No special flags. |
| 56 | NO_ALLOCATION_FLAGS = 0, |
| 57 | // Return the pointer to the allocated already tagged as a heap object. |
| 58 | TAG_OBJECT = 1 << 0, |
| 59 | // The content of the result register already contains the allocation top in |
| 60 | // new space. |
| 61 | RESULT_CONTAINS_TOP = 1 << 1 |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | #if V8_TARGET_ARCH_IA32 |
| 66 | #include "assembler.h" |
| 67 | #include "ia32/assembler-ia32.h" |
| 68 | #include "ia32/assembler-ia32-inl.h" |
| 69 | #include "code.h" // must be after assembler_*.h |
| 70 | #include "ia32/macro-assembler-ia32.h" |
| 71 | #elif V8_TARGET_ARCH_X64 |
| 72 | #include "assembler.h" |
| 73 | #include "x64/assembler-x64.h" |
| 74 | #include "x64/assembler-x64-inl.h" |
| 75 | #include "code.h" // must be after assembler_*.h |
| 76 | #include "x64/macro-assembler-x64.h" |
| 77 | #elif V8_TARGET_ARCH_ARM |
| 78 | #include "arm/constants-arm.h" |
| 79 | #include "assembler.h" |
| 80 | #include "arm/assembler-arm.h" |
| 81 | #include "arm/assembler-arm-inl.h" |
| 82 | #include "code.h" // must be after assembler_*.h |
| 83 | #include "arm/macro-assembler-arm.h" |
| 84 | #else |
| 85 | #error Unsupported target architecture. |
| 86 | #endif |
| 87 | |
| 88 | #endif // V8_MACRO_ASSEMBLER_H_ |