• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // Invalid depth in prototype chain.
65 const int kInvalidProtoDepth = -1;
66 
67 #if V8_TARGET_ARCH_IA32
68 #include "assembler.h"
69 #include "ia32/assembler-ia32.h"
70 #include "ia32/assembler-ia32-inl.h"
71 #include "code.h"  // must be after assembler_*.h
72 #include "ia32/macro-assembler-ia32.h"
73 #elif V8_TARGET_ARCH_X64
74 #include "assembler.h"
75 #include "x64/assembler-x64.h"
76 #include "x64/assembler-x64-inl.h"
77 #include "code.h"  // must be after assembler_*.h
78 #include "x64/macro-assembler-x64.h"
79 #elif V8_TARGET_ARCH_ARM
80 #include "arm/constants-arm.h"
81 #include "assembler.h"
82 #ifdef V8_ARM_VARIANT_THUMB
83 #include "arm/assembler-thumb2.h"
84 #include "arm/assembler-thumb2-inl.h"
85 #else
86 #include "arm/assembler-arm.h"
87 #include "arm/assembler-arm-inl.h"
88 #endif
89 #include "code.h"  // must be after assembler_*.h
90 #include "arm/macro-assembler-arm.h"
91 #elif V8_TARGET_ARCH_MIPS
92 #include "mips/constants-mips.h"
93 #include "assembler.h"
94 #include "mips/assembler-mips.h"
95 #include "mips/assembler-mips-inl.h"
96 #include "code.h"  // must be after assembler_*.h
97 #include "mips/macro-assembler-mips.h"
98 #else
99 #error Unsupported target architecture.
100 #endif
101 
102 #endif  // V8_MACRO_ASSEMBLER_H_
103